Add the kt_android_library rule to the list of android_library rules.
This is required for the DexAspect to pull the R.jar from the AndroidIdeInfo.
RELNOTES: None.
@@ -268,15 +268,11 @@ public final class DexArchiveAspect extends NativeAspectClass implements Configu
ImmutableSet.Builder<Artifact> jars = ImmutableSet.builder();
jars.addAll(javaInfo.getDirectRuntimeJars());
- // If the target is an android_library, it may be a Starlark android_library in which case
- // get the R.jar from the AndroidIdeInfoProvider.
- if (isAndroidLibrary(ruleContext)) {
Artifact rJar = getAndroidLibraryRJar(base);
if (rJar != null) {
// TODO(b/124540821): Disable R.jar desugaring (with a flag).
jars.add(rJar);
}
- }
// For android_* targets we need to honor their bootclasspath (nicer in general to do so)
NestedSet<Artifact> bootclasspath = getBootclasspath(base, ruleContext);
@@ -321,14 +317,10 @@ public final class DexArchiveAspect extends NativeAspectClass implements Configu
jars.addAll(javaInfo.getDirectRuntimeJars());
}
- // The Starlark android_library does not put the R.jar file in the direct runtime deps of the
- // JavaInfo, it can only be retrieved from the AndroidIdeInfoProvider.
- if (isAndroidLibrary(ruleContext)) {
Artifact rJar = getAndroidLibraryRJar(base);
if (rJar != null) {
jars.add(rJar);
}
- }
return jars.build();
}
@@ -345,10 +337,6 @@ public final class DexArchiveAspect extends NativeAspectClass implements Configu
return isProtoLibrary(ruleContext) ? base.getProvider(JavaCompilationArgsProvider.class) : null;
}
- private static boolean isAndroidLibrary(RuleContext ruleContext) {
- return "android_library".equals(ruleContext.getRule().getRuleClass());
- }
-
private static boolean isProtoLibrary(RuleContext ruleContext) {
return "proto_library".equals(ruleContext.getRule().getRuleClass());
}
