Skip to content

Commit

Permalink
Use labelname when declaring output for unzipped sourcejar
Browse files Browse the repository at this point in the history
  • Loading branch information
antonsviridov-src committed Oct 30, 2024
1 parent 6c183d8 commit 09ef011
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
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 @@ -11,3 +11,12 @@ java_library(
":generated-srcjar",
],
)

java_library(
name = "other_library",
srcs = [
"Baz.java", # create a new file in source at test/Baz.java, alongside test/Foo.java
":generated-srcjar",
],
)

7 changes: 7 additions & 0 deletions examples/bazel-example/src/main/java/srcjar_example/Baz.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.testing;

public class Baz {
public Bar baz(Bar value) {
return value;
}
}
2 changes: 1 addition & 1 deletion scip-java/src/main/resources/scip-java/scip_java.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _scip_java(target, ctx):
output_dir = []

for source_jar in source_jars:
dir = ctx.actions.declare_directory("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(
Expand Down

0 comments on commit 09ef011

Please sign in to comment.