Add a Scala/Java version agnostic option for setting the SemanticDB target root and source root directories #2692
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.
Fixes #2646
This adds
--semanticdb-targetroot
and--semanticdb-sourceroot
options.--semanticdb-targetroot
accepts a path to the directory, where SemanticDB files should be written.--semanticdb-sourceroot
accepts a path to the directory, from which the relative paths for SemanticDB files should be calculated.Technically this could have already been done by passing the correct compiler options, but those were very much dependent on a number of things, including Scala/Java version and the manner the semanticdb plugin is passed to the compiler.
The options added here provide unified syntax for all of these cases.
When the target directory is not set, the default follows compiler defaults, which means the semanticdb files are saved alongside compiled class files.
When the source directory is not set, the default follows the Scala CLI project root.
Please note that the Scala CLI project root is not necessarily a parent directory for all project sources.