Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Scala/Java version agnostic option for setting the SemanticDB target root and source root directories #2692

Merged
merged 4 commits into from
Jan 25, 2024

Conversation

Gedochao
Copy link
Contributor

@Gedochao Gedochao commented Jan 18, 2024

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.

@Gedochao Gedochao force-pushed the maintenance/semanticdb-improvements branch from af9515e to 9336862 Compare January 19, 2024 11:29
@Gedochao Gedochao changed the title Add a Scala/Java version agnostic option for setting the SemanticDB target root directory Add a Scala/Java version agnostic option for setting the SemanticDB target root and source root directories Jan 19, 2024
@Gedochao Gedochao requested a review from tgodzik January 19, 2024 14:08
Copy link
Member

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM

@Gedochao Gedochao merged commit 4ee83bc into VirtusLab:main Jan 25, 2024
58 checks passed
@Gedochao Gedochao deleted the maintenance/semanticdb-improvements branch January 25, 2024 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

It should be possible for SemanticDB targetroot to be different from projectWorkspace/.scala-build
2 participants