Change host transitions to exec transition in android sdk.
Closes #12220.
PiperOrigin-RevId: 335633528
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidSdkBaseRule.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidSdkBaseRule.java
index e5a100a..d5b5d33 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidSdkBaseRule.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidSdkBaseRule.java
@@ -20,7 +20,7 @@
import com.google.devtools.build.lib.analysis.RuleDefinition;
import com.google.devtools.build.lib.analysis.RuleDefinitionEnvironment;
-import com.google.devtools.build.lib.analysis.config.HostTransition;
+import com.google.devtools.build.lib.analysis.config.ExecutionTransitionFactory;
import com.google.devtools.build.lib.packages.RuleClass;
import com.google.devtools.build.lib.packages.RuleClass.Builder.RuleClassType;
import com.google.devtools.build.lib.packages.StarlarkProviderIdentifier;
@@ -40,7 +40,7 @@
// This is the Proguard that comes from the --proguard_top attribute.
.add(
attr(":proguard", LABEL)
- .cfg(HostTransition.createFactory())
+ .cfg(ExecutionTransitionFactory.create())
.value(JavaSemantics.PROGUARD)
.exec())
// This is the Proguard in the BUILD file that contains the android_sdk rule. Used when
@@ -48,89 +48,89 @@
.add(
attr("proguard", LABEL)
.mandatory()
- .cfg(HostTransition.createFactory())
+ .cfg(ExecutionTransitionFactory.create())
.allowedFileTypes(ANY_FILE)
.exec())
.add(
attr("aapt", LABEL)
.mandatory()
- .cfg(HostTransition.createFactory())
+ .cfg(ExecutionTransitionFactory.create())
.allowedFileTypes(ANY_FILE)
.exec())
.add(
attr("aapt2", LABEL)
- .cfg(HostTransition.createFactory())
+ .cfg(ExecutionTransitionFactory.create())
.allowedFileTypes(ANY_FILE)
.exec())
.add(
attr("dx", LABEL)
.mandatory()
- .cfg(HostTransition.createFactory())
+ .cfg(ExecutionTransitionFactory.create())
.allowedFileTypes(ANY_FILE)
.exec())
.add(
attr("main_dex_list_creator", LABEL)
.mandatory()
- .cfg(HostTransition.createFactory())
+ .cfg(ExecutionTransitionFactory.create())
.allowedFileTypes(ANY_FILE)
.exec())
.add(
attr("adb", LABEL)
.mandatory()
- .cfg(HostTransition.createFactory())
+ .cfg(ExecutionTransitionFactory.create())
.allowedFileTypes(ANY_FILE)
.exec())
.add(
attr("framework_aidl", LABEL)
.mandatory()
- .cfg(HostTransition.createFactory())
+ .cfg(ExecutionTransitionFactory.create())
.allowedFileTypes(ANY_FILE))
.add(
attr("aidl", LABEL)
.mandatory()
- .cfg(HostTransition.createFactory())
+ .cfg(ExecutionTransitionFactory.create())
.allowedFileTypes(ANY_FILE)
.exec())
.add(attr("aidl_lib", LABEL).allowedFileTypes(JavaSemantics.JAR))
.add(
attr("android_jar", LABEL)
.mandatory()
- .cfg(HostTransition.createFactory())
+ .cfg(ExecutionTransitionFactory.create())
.allowedFileTypes(JavaSemantics.JAR))
// TODO(b/67903726): Make this attribute mandatory after updating all android_sdk rules.
.add(
attr("source_properties", LABEL)
- .cfg(HostTransition.createFactory())
+ .cfg(ExecutionTransitionFactory.create())
.allowedFileTypes(ANY_FILE))
.add(
attr("shrinked_android_jar", LABEL)
.mandatory()
- .cfg(HostTransition.createFactory())
+ .cfg(ExecutionTransitionFactory.create())
.allowedFileTypes(ANY_FILE))
.add(
attr("annotations_jar", LABEL)
- .cfg(HostTransition.createFactory())
+ .cfg(ExecutionTransitionFactory.create())
.allowedFileTypes(ANY_FILE))
.add(
attr("main_dex_classes", LABEL)
.mandatory()
- .cfg(HostTransition.createFactory())
+ .cfg(ExecutionTransitionFactory.create())
.allowedFileTypes(ANY_FILE))
.add(
attr("apkbuilder", LABEL)
- .cfg(HostTransition.createFactory())
+ .cfg(ExecutionTransitionFactory.create())
.allowedFileTypes(ANY_FILE)
.exec())
.add(
attr("apksigner", LABEL)
.mandatory()
- .cfg(HostTransition.createFactory())
+ .cfg(ExecutionTransitionFactory.create())
.allowedFileTypes(ANY_FILE)
.exec())
.add(
attr("zipalign", LABEL)
.mandatory()
- .cfg(HostTransition.createFactory())
+ .cfg(ExecutionTransitionFactory.create())
.allowedFileTypes(ANY_FILE)
.exec())
.advertiseStarlarkProvider(
diff --git a/src/test/java/com/google/devtools/build/lib/rules/android/AndroidBinaryTest.java b/src/test/java/com/google/devtools/build/lib/rules/android/AndroidBinaryTest.java
index 6d42378..70b2331 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/android/AndroidBinaryTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/android/AndroidBinaryTest.java
@@ -1400,7 +1400,7 @@
.getExecutable();
assertWithMessage("ProGuard implementation was not correctly taken from the configuration")
.that(proguardAction.getCommandFilename())
- .isEqualTo(jkrunchyExecutable.getExecPathString());
+ .endsWith(jkrunchyExecutable.getOutputDirRelativePathString());
}
@Test