@@ -905,10 +905,11 @@ public static class Options extends FragmentOptions {
905
905
},
906
906
help = "Enable persistent Android dex and desugar actions by using workers." ,
907
907
expansion = {
908
+ "--internal_persistent_android_dex_desugar" ,
908
909
"--strategy=Desugar=worker" ,
909
910
"--strategy=DexBuilder=worker" ,
910
911
})
911
- public Void persistentDexDesugar ;
912
+ public Void persistentAndroidDexDesugar ;
912
913
913
914
@ Option (
914
915
name = "persistent_multiplex_android_dex_desugar" ,
@@ -921,10 +922,9 @@ public static class Options extends FragmentOptions {
921
922
help = "Enable persistent multiplexed Android dex and desugar actions by using workers." ,
922
923
expansion = {
923
924
"--persistent_android_dex_desugar" ,
924
- "--modify_execution_info=Desugar=+supports-multiplex-workers" ,
925
- "--modify_execution_info=DexBuilder=+supports-multiplex-workers" ,
925
+ "--internal_persistent_multiplex_android_dex_desugar" ,
926
926
})
927
- public Void persistentMultiplexDexDesugar ;
927
+ public Void persistentMultiplexAndroidDexDesugar ;
928
928
929
929
@ Option (
930
930
name = "persistent_multiplex_android_tools" ,
@@ -974,6 +974,36 @@ public static class Options extends FragmentOptions {
974
974
help = "Tracking flag for when multiplexed busybox workers are enabled." )
975
975
public boolean persistentMultiplexBusyboxTools ;
976
976
977
+ /**
978
+ * We use this option to decide when to enable workers for busybox tools. This flag is also a
979
+ * guard against enabling workers using nothing but --persistent_android_resource_processor.
980
+ *
981
+ * <p>Consequently, we use this option to decide between param files or regular command line
982
+ * parameters. If we're not using workers or on Windows, there's no need to always use param
983
+ * files for I/O performance reasons.
984
+ */
985
+ @ Option (
986
+ name = "internal_persistent_android_dex_desugar" ,
987
+ documentationCategory = OptionDocumentationCategory .UNDOCUMENTED ,
988
+ effectTags = {
989
+ OptionEffectTag .HOST_MACHINE_RESOURCE_OPTIMIZATIONS ,
990
+ OptionEffectTag .EXECUTION ,
991
+ },
992
+ defaultValue = "false" ,
993
+ help = "Tracking flag for when dexing and desugaring workers are enabled." )
994
+ public boolean persistentDexDesugar ;
995
+
996
+ @ Option (
997
+ name = "internal_persistent_multiplex_android_dex_desugar" ,
998
+ documentationCategory = OptionDocumentationCategory .UNDOCUMENTED ,
999
+ effectTags = {
1000
+ OptionEffectTag .HOST_MACHINE_RESOURCE_OPTIMIZATIONS ,
1001
+ OptionEffectTag .EXECUTION ,
1002
+ },
1003
+ defaultValue = "false" ,
1004
+ help = "Tracking flag for when multiplexed dexing and desugaring workers are enabled." )
1005
+ public boolean persistentMultiplexDexDesugar ;
1006
+
977
1007
@ Option (
978
1008
name = "experimental_remove_r_classes_from_instrumentation_test_jar" ,
979
1009
defaultValue = "true" ,
@@ -1155,6 +1185,8 @@ public FragmentOptions getHost() {
1155
1185
private final boolean dataBindingAndroidX ;
1156
1186
private final boolean persistentBusyboxTools ;
1157
1187
private final boolean persistentMultiplexBusyboxTools ;
1188
+ private final boolean persistentDexDesugar ;
1189
+ private final boolean persistentMultiplexDexDesugar ;
1158
1190
private final boolean filterRJarsFromAndroidTest ;
1159
1191
private final boolean removeRClassesFromInstrumentationTestJar ;
1160
1192
private final boolean alwaysFilterDuplicateClassesFromAndroidTest ;
@@ -1216,6 +1248,8 @@ public AndroidConfiguration(BuildOptions buildOptions) throws InvalidConfigurati
1216
1248
this .dataBindingAndroidX = options .dataBindingAndroidX ;
1217
1249
this .persistentBusyboxTools = options .persistentBusyboxTools ;
1218
1250
this .persistentMultiplexBusyboxTools = options .persistentMultiplexBusyboxTools ;
1251
+ this .persistentDexDesugar = options .persistentDexDesugar ;
1252
+ this .persistentMultiplexDexDesugar = options .persistentMultiplexDexDesugar ;
1219
1253
this .filterRJarsFromAndroidTest = options .filterRJarsFromAndroidTest ;
1220
1254
this .removeRClassesFromInstrumentationTestJar =
1221
1255
options .removeRClassesFromInstrumentationTestJar ;
@@ -1319,12 +1353,6 @@ public ImmutableList<String> getTargetDexoptsThatPreventIncrementalDexing() {
1319
1353
return targetDexoptsThatPreventIncrementalDexing ;
1320
1354
}
1321
1355
1322
- /** Whether to assume the dexbuilder tool supports local worker mode. */
1323
- @ Override
1324
- public boolean useWorkersWithDexbuilder () {
1325
- return useWorkersWithDexbuilder ;
1326
- }
1327
-
1328
1356
@ Override
1329
1357
public boolean desugarJava8 () {
1330
1358
return desugarJava8 ;
@@ -1473,6 +1501,16 @@ public boolean persistentMultiplexBusyboxTools() {
1473
1501
return persistentMultiplexBusyboxTools ;
1474
1502
}
1475
1503
1504
+ @ Override
1505
+ public boolean persistentDexDesugar () {
1506
+ return persistentDexDesugar ;
1507
+ }
1508
+
1509
+ @ Override
1510
+ public boolean persistentMultiplexDexDesugar () {
1511
+ return persistentMultiplexDexDesugar ;
1512
+ }
1513
+
1476
1514
@ Override
1477
1515
public boolean incompatibleUseToolchainResolution () {
1478
1516
return incompatibleUseToolchainResolution ;
@@ -1500,6 +1538,7 @@ public boolean alwaysFilterDuplicateClassesFromAndroidTest() {
1500
1538
return alwaysFilterDuplicateClassesFromAndroidTest ;
1501
1539
}
1502
1540
1541
+ @ Override
1503
1542
public boolean filterLibraryJarWithProgramJar () {
1504
1543
return filterLibraryJarWithProgramJar ;
1505
1544
}
0 commit comments