diff options
author | Googler <noreply@google.com> | 2016-08-23 19:11:25 +0000 |
---|---|---|
committer | John Cater <jcater@google.com> | 2016-08-23 22:59:11 +0000 |
commit | 22585cb18c3666ab78fe6b02f44e7abf3b58ffea (patch) | |
tree | 4fc51f3e4c5e1f5daa700f0de0aa7728c880e017 /src | |
parent | 6a87a7ed6eedd797838f8eba86a4e8ec6309dd36 (diff) |
Use helper method for collecting transitive source jars.
--
MOS_MIGRATED_REVID=131083264
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/java/JavaBinary.java | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaBinary.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaBinary.java index 2e1d01f316..d476e9d46f 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaBinary.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaBinary.java @@ -221,7 +221,7 @@ public class JavaBinary implements RuleConfiguredTargetFactory { JavaCommon.getJavaBinSubstitution(ruleContext, launcher)); } - NestedSet<Artifact> transitiveSourceJars = collectTransitiveSourceJars(common, srcJar); + NestedSet<Artifact> transitiveSourceJars = common.collectTransitiveSourceJars(srcJar); // TODO(bazel-team): if (getOptions().sourceJars) then make this a dummy prerequisite for the // DeployArchiveAction ? Needs a few changes there as we can't pass inputs @@ -442,16 +442,6 @@ public class JavaBinary implements RuleConfiguredTargetFactory { } } - private NestedSet<Artifact> collectTransitiveSourceJars(JavaCommon common, Artifact srcJar) { - NestedSetBuilder<Artifact> builder = NestedSetBuilder.stableOrder(); - - builder.add(srcJar); - for (JavaSourceJarsProvider dep : common.getDependencies(JavaSourceJarsProvider.class)) { - builder.addTransitive(dep.getTransitiveSourceJars()); - } - return builder.build(); - } - /** * Collects the native libraries in the transitive closure of the deps. * |