Skip to content

Commit f3ae88e

Browse files
Googlerdamienmg
authored andcommitted
Flag cleanup (Step 1 of 3): Make use_singlejar_for_proguard_libraryjars 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
1 parent 009368f commit f3ae88e

3 files changed

Lines changed: 6 additions & 16 deletions

File tree

src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinary.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,8 +1095,7 @@ private static ProguardOutput applyProguard(
10951095
proguardOutputJar,
10961096
javaSemantics,
10971097
getProguardOptimizationPasses(ruleContext),
1098-
proguardOutputMap,
1099-
ruleContext.getFragment(AndroidConfiguration.class).useSingleJarForProguardLibraryJars());
1098+
proguardOutputMap);
11001099
return result;
11011100
}
11021101

src/main/java/com/google/devtools/build/lib/rules/android/AndroidConfiguration.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -487,11 +487,12 @@ public static class Options extends FragmentOptions {
487487
// other settings default to empty and are set or modified via dynamic configuration.
488488
public ResourceFilter resourceFilter;
489489

490+
// TODO(b/33043897) - remove this once removed from global blazerc.
490491
@Option(
491492
name = "use_singlejar_for_proguard_libraryjars",
492493
defaultValue = "false",
493494
optionUsageRestrictions = OptionUsageRestrictions.UNDOCUMENTED,
494-
help = "Use SingleJar to combine all ProGuard library jars."
495+
help = "Unused flag."
495496
)
496497
public boolean useSingleJarForProguardLibraryJars;
497498

@@ -604,7 +605,6 @@ public ImmutableSet<Class<? extends FragmentOptions>> requiredOptions() {
604605
private final ApkSigningMethod apkSigningMethod;
605606
private final boolean useSingleJarApkBuilder;
606607
private final ResourceFilter resourceFilter;
607-
private final boolean useSingleJarForProguardLibraryJars;
608608
private final boolean compressJavaResources;
609609
private final boolean includeLibraryResourceJars;
610610
private final boolean useNocompressExtensionsOnApk;
@@ -634,7 +634,6 @@ public ImmutableSet<Class<? extends FragmentOptions>> requiredOptions() {
634634
this.manifestMerger = options.manifestMerger;
635635
this.apkSigningMethod = options.apkSigningMethod;
636636
this.useSingleJarApkBuilder = options.useSingleJarApkBuilder;
637-
this.useSingleJarForProguardLibraryJars = options.useSingleJarForProguardLibraryJars;
638637
this.useRexToCompressDexFiles = options.useRexToCompressDexFiles;
639638
this.resourceFilter = options.resourceFilter;
640639
this.compressJavaResources = options.compressJavaResources;
@@ -740,10 +739,6 @@ public ResourceFilter getResourceFilter() {
740739
return resourceFilter;
741740
}
742741

743-
public boolean useSingleJarForProguardLibraryJars() {
744-
return useSingleJarForProguardLibraryJars;
745-
}
746-
747742
boolean compressJavaResources() {
748743
return compressJavaResources;
749744
}

src/main/java/com/google/devtools/build/lib/rules/java/ProguardHelper.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,7 @@ public ProguardOutput applyProguardIfRequested(
203203
deployJar,
204204
semantics,
205205
/* optimizationPases */ 3,
206-
proguardOutputMap,
207-
/* useSingleJarForProguardLibraryJars */ false);
206+
proguardOutputMap);
208207
}
209208

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

399395

400-
if (useSingleJarForProguardLibraryJars && Iterables.size(libraryJars) > 1) {
396+
if (Iterables.size(libraryJars) > 1) {
401397
JavaTargetAttributes attributes = new JavaTargetAttributes.Builder(semantics)
402398
.build();
403399
Artifact combinedLibraryJar = getProguardTempArtifact(ruleContext,

0 commit comments

Comments
 (0)