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

Don't create a subpath for extracted_srcjar #767

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions examples/bazel-example/src/main/java/srcjar_example/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,12 @@ java_library(
":generated-srcjar",
],
)

java_test(
name = "testing_test",
srcs = [
"Foo.java",
":generated-srcjar",
],
test_class = "Foo",
)
12 changes: 6 additions & 6 deletions scip-java/src/main/resources/scip-java/scip_java.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ different contents.
This aspect is needed for scip-java to inspect the structure of the Bazel build
and register actions to index all java_library/java_test/java_binary targets.
The result of running this aspect is that your bazel-bin/ directory will contain
many *.scip (https://github.com/sourcegraph/scip) and
many *.scip (https://github.com/sourcegraph/scip) and
*.semanticdb (https://scalameta.org/docs/semanticdb/specification.html) files.
These files encode information about which symbols are referenced from which
locations in your source code.
Expand Down Expand Up @@ -66,13 +66,13 @@ def _scip_java(target, ctx):

if len(source_files) == 0:
return None

output_dir = []

for source_jar in source_jars:
dir = ctx.actions.declare_directory(ctx.label.name + "/extracted_srcjar/" + source_jar.short_path)
dir = ctx.actions.declare_directory(ctx.label.name + ".extracted_srcjar/" + source_jar.short_path)
output_dir.append(dir)

ctx.actions.run_shell(
inputs = javac_action.inputs,
outputs = [dir],
Expand All @@ -99,7 +99,7 @@ def _scip_java(target, ctx):

launcher_javac_flags = []
compiler_javac_flags = []

# In different versions of bazel javac options are either a nested set or a depset or a list...
javac_options = []
if hasattr(compilation, "javac_options_list"):
Expand All @@ -108,7 +108,7 @@ def _scip_java(target, ctx):
javac_options = compilation.javac_options

for value in javac_options:
# NOTE(Anton): for some bizarre reason I see empty string starting the list of
# NOTE(Anton): for some bizarre reason I see empty string starting the list of
# javac options - which then gets propagated into the JSON config, and ends up
# crashing the actual javac invokation.
if value != "":
Expand Down
Loading