-
Notifications
You must be signed in to change notification settings - Fork 5
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
Don't generate SemanticDB for generated or external sources #79
Don't generate SemanticDB for generated or external sources #79
Conversation
if ( | ||
source.extension == "scala" and \ | ||
source.is_source and \ | ||
source.owner.workspace_name == ctx.label.workspace_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since I'm seeing the word workspace here, is this bazel 8 compatible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it's not. Good catch. It seems it was deprecated in favor of the more accurately named repo_name
:
https://bazel.build/rules/lib/builtins/Label#workspace_name
I'll correct this.
b3630c0
to
3723c3a
Compare
Squashed. |
09830b0
to
5f84626
Compare
Squashed. |
Previously, we only checked if a source ended with the "scala" extension before adding it to `SemanticDbInfo`. However, we don't want to generate SemanticDB files for generated files or external files, because they'll have the output directory (beginning with `bazel-out`) in their paths, which isn't guaranteed to be consistent. Also, tell the SemanticDB compiler plugin to generate SemanticDB outside of the output JAR, even if we don't want SemanticDB generated for any of the sources. That way, the output JAR won't include SemanticDB files we don't want.
6f3b476
to
1a8dcb0
Compare
Squashed. |
Previously, we only checked if a source ended with the "scala" extension before adding it to
SemanticDbInfo
. However, we don't want to generate SemanticDB files for generated files or external files, because they'll have the output directory (beginning withbazel-out
) in their paths, which isn't guaranteed to be consistent.Also, tell the SemanticDB compiler plugin to generate SemanticDB outside of the output JAR, even if we don't want SemanticDB generated for any of the sources. That way, the output JAR won't include SemanticDB files we don't want.