Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Commit

Permalink
Flag cleanup (Step 1 of 3): Make use_singlejar_for_proguard_libraryja…
Browse files Browse the repository at this point in the history
…rs a no-op, and default behavior to on since it has been on in the global blazerc for awhile now.

RELNOTES: Deprecate use_singlejar_for_proguard_libraryjars and force behavior to always on.
PiperOrigin-RevId: 154890445
  • Loading branch information
Googler authored and damienmg committed May 3, 2017
1 parent 009368f commit f3ae88e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1095,8 +1095,7 @@ private static ProguardOutput applyProguard(
proguardOutputJar,
javaSemantics,
getProguardOptimizationPasses(ruleContext),
proguardOutputMap,
ruleContext.getFragment(AndroidConfiguration.class).useSingleJarForProguardLibraryJars());
proguardOutputMap);
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,11 +487,12 @@ public static class Options extends FragmentOptions {
// other settings default to empty and are set or modified via dynamic configuration.
public ResourceFilter resourceFilter;

// TODO(b/33043897) - remove this once removed from global blazerc.
@Option(
name = "use_singlejar_for_proguard_libraryjars",
defaultValue = "false",
optionUsageRestrictions = OptionUsageRestrictions.UNDOCUMENTED,
help = "Use SingleJar to combine all ProGuard library jars."
help = "Unused flag."
)
public boolean useSingleJarForProguardLibraryJars;

Expand Down Expand Up @@ -604,7 +605,6 @@ public ImmutableSet<Class<? extends FragmentOptions>> requiredOptions() {
private final ApkSigningMethod apkSigningMethod;
private final boolean useSingleJarApkBuilder;
private final ResourceFilter resourceFilter;
private final boolean useSingleJarForProguardLibraryJars;
private final boolean compressJavaResources;
private final boolean includeLibraryResourceJars;
private final boolean useNocompressExtensionsOnApk;
Expand Down Expand Up @@ -634,7 +634,6 @@ public ImmutableSet<Class<? extends FragmentOptions>> requiredOptions() {
this.manifestMerger = options.manifestMerger;
this.apkSigningMethod = options.apkSigningMethod;
this.useSingleJarApkBuilder = options.useSingleJarApkBuilder;
this.useSingleJarForProguardLibraryJars = options.useSingleJarForProguardLibraryJars;
this.useRexToCompressDexFiles = options.useRexToCompressDexFiles;
this.resourceFilter = options.resourceFilter;
this.compressJavaResources = options.compressJavaResources;
Expand Down Expand Up @@ -740,10 +739,6 @@ public ResourceFilter getResourceFilter() {
return resourceFilter;
}

public boolean useSingleJarForProguardLibraryJars() {
return useSingleJarForProguardLibraryJars;
}

boolean compressJavaResources() {
return compressJavaResources;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,7 @@ public ProguardOutput applyProguardIfRequested(
deployJar,
semantics,
/* optimizationPases */ 3,
proguardOutputMap,
/* useSingleJarForProguardLibraryJars */ false);
proguardOutputMap);
}

private ImmutableList<Artifact> collectProguardSpecs(
Expand Down Expand Up @@ -372,8 +371,6 @@ public static ProguardOutput getProguardOutputs(
* @param optimizationPasses if not null specifies to break proguard up into multiple passes with
* the given number of optimization passes.
* @param proguardOutputMap mapping generated by Proguard if requested. could be null.
* @param useSingleJarForProguardLibraryJars whether to combine all library jars into a single jar
* file before processing with Proguard
*/
public static ProguardOutput createOptimizationActions(RuleContext ruleContext,
FilesToRunProvider proguard,
Expand All @@ -386,8 +383,7 @@ public static ProguardOutput createOptimizationActions(RuleContext ruleContext,
Artifact proguardOutputJar,
JavaSemantics semantics,
@Nullable Integer optimizationPasses,
@Nullable Artifact proguardOutputMap,
boolean useSingleJarForProguardLibraryJars) throws InterruptedException {
@Nullable Artifact proguardOutputMap) throws InterruptedException {
JavaOptimizationMode optMode = getJavaOptimizationMode(ruleContext);
Preconditions.checkArgument(optMode != JavaOptimizationMode.NOOP);
Preconditions.checkArgument(optMode != JavaOptimizationMode.LEGACY || !proguardSpecs.isEmpty());
Expand All @@ -397,7 +393,7 @@ public static ProguardOutput createOptimizationActions(RuleContext ruleContext,
proguardOutputMap);


if (useSingleJarForProguardLibraryJars && Iterables.size(libraryJars) > 1) {
if (Iterables.size(libraryJars) > 1) {
JavaTargetAttributes attributes = new JavaTargetAttributes.Builder(semantics)
.build();
Artifact combinedLibraryJar = getProguardTempArtifact(ruleContext,
Expand Down

0 comments on commit f3ae88e

Please sign in to comment.