Skip to content

Commit

Permalink
Remove unused feature_of/feature_after support from Bazel/Blaze
Browse files Browse the repository at this point in the history
This was never launched and depends on flags which exist in aapt but not
aapt2.

PiperOrigin-RevId: 268050541
  • Loading branch information
donaldchai authored and copybara-github committed Sep 9, 2019
1 parent 46ad547 commit 0bb860d
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,6 @@ private static RuleConfiguredTargetBuilder init(
ResourceFilterFactory.fromRuleContextAndAttrs(ruleContext),
ruleContext.getExpander().withDataLocations().tokenized("nocompress_extensions"),
ruleContext.attributes().get("crunch_png", Type.BOOLEAN),
ruleContext.attributes().isAttributeValueExplicitlySpecified("feature_of")
? ruleContext.getPrerequisite("feature_of", Mode.TARGET, ApkInfo.PROVIDER).getApk()
: null,
ruleContext.attributes().isAttributeValueExplicitlySpecified("feature_after")
? ruleContext
.getPrerequisite("feature_after", Mode.TARGET, ApkInfo.PROVIDER)
.getApk()
: null,
DataBinding.contextFrom(ruleContext, dataContext.getAndroidConfig()));

AndroidApplicationResourceInfo androidApplicationResourceInfo =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ public class AndroidResourcesProcessorBuilder {
private Artifact mergedResourcesOut;
private boolean isLibrary;
private boolean crunchPng = true;
private Artifact featureOf;
private Artifact featureAfter;
private AndroidAaptVersion aaptVersion;
private boolean throwOnResourceConflict;
private String packageUnderTest;
Expand Down Expand Up @@ -168,16 +166,6 @@ public AndroidResourcesProcessorBuilder setLibrary(boolean isLibrary) {
return this;
}

public AndroidResourcesProcessorBuilder setFeatureOf(Artifact featureOf) {
this.featureOf = featureOf;
return this;
}

public AndroidResourcesProcessorBuilder setFeatureAfter(Artifact featureAfter) {
this.featureAfter = featureAfter;
return this;
}

public AndroidResourcesProcessorBuilder targetAaptVersion(AndroidAaptVersion aaptVersion) {
this.aaptVersion = aaptVersion;
return this;
Expand Down Expand Up @@ -449,8 +437,6 @@ private BusyBoxActionBuilder configureCommonFlags(
.maybeAddFlag("--applicationId", applicationId)
.maybeAddOutput("--dataBindingInfoOut", dataBindingInfoZip)
.maybeAddFlag("--packageForR", customJavaPackage)
.maybeAddInput("--featureOf", featureOf)
.maybeAddInput("--featureAfter", featureAfter)
.maybeAddFlag("--throwOnResourceConflict", throwOnResourceConflict)
.maybeAddFlag("--packageUnderTest", packageUnderTest)
.maybeAddFlag("--isTestWithResources", isTestWithResources);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -594,16 +594,6 @@ public RuleClass build(RuleClass.Builder builder, final RuleDefinitionEnvironmen
.cfg(HostTransition.createFactory())
.legacyAllowAnyFileType()
.value(env.getToolsLabel("//tools/android:debug_keystore")))
.add(
attr("feature_of", LABEL)
.allowedRuleClasses("android_binary")
.allowedFileTypes()
.undocumented("experimental, see b/36226333"))
.add(
attr("feature_after", LABEL)
.allowedRuleClasses("android_binary")
.allowedFileTypes()
.undocumented("experimental, see b/36226333"))
/* <!-- #BLAZE_RULE($android_binary_base).ATTRIBUTE(nocompress_extensions) -->
A list of file extension to leave uncompressed in apk.
<!-- #END_BLAZE_RULE.ATTRIBUTE --> */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,6 @@ errorReporter, getFileProviders(resources), "resource_files"),
settings.resourceFilterFactory,
settings.noCompressExtensions,
crunchPng,
/* featureOf = */ null,
/* featureAfter = */ null,
DataBinding.contextFrom(
dataBindingEnabled,
ctx.getActionConstructionContext(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ public static ProcessedAndroidData processBinaryDataFrom(
ResourceFilterFactory resourceFilterFactory,
List<String> noCompressExtensions,
boolean crunchPng,
@Nullable Artifact featureOf,
@Nullable Artifact featureAfter,
DataBindingContext dataBindingContext)
throws RuleErrorException, InterruptedException {
if (conditionalKeepRules && aaptVersion != AndroidAaptVersion.AAPT2) {
Expand All @@ -89,9 +87,7 @@ public static ProcessedAndroidData processBinaryDataFrom(
.setMainDexProguardOut(
AndroidBinary.createMainDexProguardSpec(
dataContext.getLabel(), dataContext.getActionConstructionContext()))
.conditionalKeepRules(conditionalKeepRules)
.setFeatureOf(featureOf)
.setFeatureAfter(featureAfter);
.conditionalKeepRules(conditionalKeepRules);
if (dataContext.useResourcePathShortening()) {
builder.setResourcePathShorteningMapOut(
dataContext.createOutputArtifact(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,6 @@ public void testProcessBinaryDataGeneratesProguardOutput() throws Exception {
ResourceFilterFactory.empty(),
ImmutableList.of(),
false,
null,
null,
DataBinding.contextFrom(ruleContext, dataContext.getAndroidConfig()))
.generateRClass(dataContext, AndroidAaptVersion.AUTO);

Expand Down

0 comments on commit 0bb860d

Please sign in to comment.