JDK + language level autodetection (and other improvements) #315
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed that, aside from some functionality for Android projects (which I don't use) the plugin doesn't make an effort to detect what JDK version and language level the sbt projects are using (instead it derives these from the JVM that sbt runs under, and sticks them onto the IDEA project).
With this change, I look at
javacOptions
in each sbt project's scope, and if-target
is set, I set the SDK (specifically, the JDK library to use) and the language level to that version. If, further,-source
is also set, then I set the language level to the version coming after-source
.Other improvements are minor source code rearrangements, things like that, but also a fix which allows slashes in ivy module names to be used (previously, they weren't normalized to
_
and the plugin would crash when it couldn't find the XML file with a slash in it, that it supposedly generated for a library whose name contained slashes).