diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/java/JavaBinary.java | 2 | ||||
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/java/ProguardHelper.java | 22 |
2 files changed, 8 insertions, 16 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 e92ba74022..79ae9bb656 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 @@ -495,7 +495,7 @@ public class JavaBinary implements RuleConfiguredTargetFactory { @Override protected ImmutableList<Artifact> collectProguardSpecsForRule( RuleContext ruleContext, ImmutableList<Artifact> bootclasspath, String mainClassName) { - return ImmutableList.of(generateSpecForJavaBinary(ruleContext, bootclasspath, mainClassName)); + return ImmutableList.of(generateSpecForJavaBinary(ruleContext, mainClassName)); } } } diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/ProguardHelper.java b/src/main/java/com/google/devtools/build/lib/rules/java/ProguardHelper.java index 136fc935fd..8864ec1421 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/ProguardHelper.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/ProguardHelper.java @@ -14,7 +14,6 @@ package com.google.devtools.build.lib.rules.java; import static com.google.common.base.Preconditions.checkNotNull; -import static com.google.devtools.build.lib.collect.nestedset.Order.NAIVE_LINK_ORDER; import com.google.common.base.Joiner; import com.google.common.base.Preconditions; @@ -27,7 +26,6 @@ import com.google.devtools.build.lib.analysis.RuleContext; import com.google.devtools.build.lib.analysis.actions.FileWriteAction; import com.google.devtools.build.lib.analysis.actions.SpawnAction; import com.google.devtools.build.lib.analysis.actions.SpawnAction.Builder; -import com.google.devtools.build.lib.collect.nestedset.NestedSet; import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder; import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable; import com.google.devtools.build.lib.packages.BuildType; @@ -113,9 +111,7 @@ public abstract class ProguardHelper { Artifact singleJar = ruleContext.getImplicitOutputArtifact(JavaSemantics.JAVA_BINARY_MERGED_JAR); return createProguardAction(ruleContext, proguard, singleJar, proguardSpecs, (Artifact) null, - NestedSetBuilder.<Artifact>emptySet(NAIVE_LINK_ORDER), deployJar, - /* mappingRequested */ false, - /* optimizationPases */ null); + bootclasspath, deployJar, /* mappingRequested */ false, /* optimizationPases */ null); } private ImmutableList<Artifact> collectProguardSpecs( @@ -200,24 +196,20 @@ public abstract class ProguardHelper { } /** - * Creates a proguard spec that tells proguard to use the JDK's rt.jar as a library jar, similar - * to how android_binary would give Android SDK's android.jar to Proguard as library jar, and - * to keep the binary's entry point, ie., the main() method to be invoked. + * Creates a proguard spec that tells proguard to keep the binary's entry point, ie., the + * {@code main()} method to be invoked. */ protected static Artifact generateSpecForJavaBinary( - RuleContext ruleContext, ImmutableList<Artifact> bootclasspath, String mainClassName) { + RuleContext ruleContext, String mainClassName) { Artifact result = ProguardHelper.getProguardConfigArtifact(ruleContext, "jvm"); ruleContext.registerAction( new FileWriteAction( ruleContext.getActionOwner(), result, String.format( - "-libraryjars %s%n" - + "-keep class %s {%n" + "-keep class %s {%n" + " public static void main(java.lang.String[]);%n" + "}", - Artifact.joinExecPaths( - ruleContext.getConfiguration().getHostPathSeparator(), bootclasspath), mainClassName), /*executable*/ false)); return result; @@ -246,7 +238,7 @@ public abstract class ProguardHelper { Artifact programJar, ImmutableList<Artifact> proguardSpecs, @Nullable Artifact proguardMapping, - NestedSet<Artifact> libraryJars, + Iterable<Artifact> libraryJars, Artifact proguardOutputJar, boolean mappingRequested, @Nullable Integer optimizationPasses) throws InterruptedException { @@ -356,7 +348,7 @@ public abstract class ProguardHelper { Artifact programJar, ImmutableList<Artifact> proguardSpecs, @Nullable Artifact proguardMapping, - NestedSet<Artifact> libraryJars, + Iterable<Artifact> libraryJars, Artifact proguardOutputJar, @Nullable Artifact proguardOutputMap) { Builder builder = new SpawnAction.Builder() |