diff options
Diffstat (limited to 'src/main/java/com/google/devtools')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/java/JavaInfo.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaInfo.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaInfo.java index 787d460f82..1524016978 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaInfo.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaInfo.java @@ -28,6 +28,7 @@ import com.google.devtools.build.lib.packages.NativeProvider; import com.google.devtools.build.lib.skylarkinterface.SkylarkCallable; import com.google.devtools.build.lib.skylarkinterface.SkylarkModule; import com.google.devtools.build.lib.skylarkinterface.SkylarkModuleCategory; +import com.google.devtools.build.lib.syntax.SkylarkList; import com.google.devtools.build.lib.syntax.SkylarkNestedSet; import java.util.ArrayList; import java.util.LinkedList; @@ -222,6 +223,18 @@ public final class JavaInfo extends NativeInfo { .getJavaCompilationArgs().getCompileTimeJars()); } + @SkylarkCallable( + name = "source_jars", + doc = "Returns a list of jar files containing all the uncompiled source files (including " + + "those generated by annotations) from the target itself, i.e. NOT including the sources of " + + "the transitive dependencies", + structField = true + ) + public SkylarkList<Artifact> getSourceJars() { + return SkylarkList.createImmutable( + providers.getProvider(JavaSourceJarsProvider.class).getSourceJars()); + } + @Override public boolean equals(Object otherObject) { if (this == otherObject) { |