Skip to content

Commit

Permalink
Remove skipParsingAction() from AndroidConfiguration.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 258502740
  • Loading branch information
Googler authored and copybara-github committed Jul 17, 2019
1 parent 1abdb0b commit 6530003
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,7 @@ public static class Options extends FragmentOptions {
help =
"Skips resource parsing action for library targets"
+ " and uses the output of the compile action instead for resource merging.")
// TODO(b/136572475): Remove this flag once the usage has been removed from blazerc files.
public boolean skipParsingAction;

@Option(
Expand Down Expand Up @@ -1073,7 +1074,6 @@ public ImmutableSet<Class<? extends FragmentOptions>> requiredOptions() {
private final boolean useAapt2ForRobolectric;
private final boolean throwOnResourceConflict;
private final boolean useParallelDex2Oat;
private final boolean skipParsingAction;
private final boolean omitResourcesInfoProviderFromAndroidBinary;
private final boolean fixedResourceNeverlinking;
private final AndroidRobolectricTestDeprecationLevel robolectricTestDeprecationLevel;
Expand Down Expand Up @@ -1122,7 +1122,6 @@ private AndroidConfiguration(Options options) throws InvalidConfigurationExcepti
this.useAapt2ForRobolectric = options.useAapt2ForRobolectric;
this.throwOnResourceConflict = options.throwOnResourceConflict;
this.useParallelDex2Oat = options.useParallelDex2Oat;
this.skipParsingAction = options.skipParsingAction;
this.omitResourcesInfoProviderFromAndroidBinary =
options.omitResourcesInfoProviderFromAndroidBinary;
this.fixedResourceNeverlinking = options.fixedResourceNeverlinking;
Expand Down Expand Up @@ -1342,11 +1341,6 @@ public boolean throwOnResourceConflict() {
return throwOnResourceConflict;
}

@Override
public boolean skipParsingAction() {
return this.skipParsingAction;
}

@Override
public boolean omitResourcesInfoProviderFromAndroidBinary() {
return this.omitResourcesInfoProviderFromAndroidBinary;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@ public static MergedAndroidResources mergeFrom(
AndroidAaptVersion aaptVersion)
throws InterruptedException {

AndroidConfiguration androidConfiguration = dataContext.getAndroidConfig();

boolean useCompiledMerge =
aaptVersion == AndroidAaptVersion.AAPT2 && androidConfiguration.skipParsingAction();
boolean useCompiledMerge = aaptVersion == AndroidAaptVersion.AAPT2;

Preconditions.checkState(
!useCompiledMerge || parsed.getCompiledSymbols() != null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,7 @@ public static ProcessedAndroidData processLocalTestDataFrom(

return builderForNonIncrementalTopLevelTarget(
dataContext, manifest, manifestValues, aaptVersion)
.setUseCompiledResourcesForMerge(
aaptVersion == AndroidAaptVersion.AAPT2
&& dataContext.getAndroidConfig().skipParsingAction())
.setUseCompiledResourcesForMerge(aaptVersion == AndroidAaptVersion.AAPT2)
.setManifestOut(
dataContext.createOutputArtifact(AndroidRuleClasses.ANDROID_PROCESSED_MANIFEST))
.setMergedResourcesOut(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,6 @@ public interface AndroidConfigurationApi {
documented = false)
boolean throwOnResourceConflict();

@SkylarkCallable(name = "skip_parsing_action", structField = true, doc = "", documented = false)
boolean skipParsingAction();

@SkylarkCallable(
name = "omit_resources_info_provider_from_android_binary",
structField = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4492,7 +4492,7 @@ public void alwaysSkipParsingActionWithAapt2() throws Exception {
List<String> resourceMergingArgs =
getGeneratingSpawnActionArgs(getValidatedResources(b).getJavaClassJar());

assertThat(resourceMergingArgs).contains("MERGE");
assertThat(resourceMergingArgs).contains("MERGE_COMPILED");
}

@Test
Expand Down

0 comments on commit 6530003

Please sign in to comment.