Merge "Use R.txt files from aar files directly" into main

This commit is contained in:
Colin Cross 2024-02-29 18:55:17 +00:00 committed by Gerrit Code Review
commit 4b6a3ae65c

View file

@ -1134,7 +1134,7 @@ func (a *AARImport) GenerateAndroidBuildActions(ctx android.ModuleContext) {
extractedAARDir := android.PathForModuleOut(ctx, "aar")
a.classpathFile = extractedAARDir.Join(ctx, "classes-combined.jar")
a.manifest = extractedAARDir.Join(ctx, "AndroidManifest.xml")
aarRTxt := extractedAARDir.Join(ctx, "R.txt")
a.rTxt = extractedAARDir.Join(ctx, "R.txt")
a.assetsPackage = android.PathForModuleOut(ctx, "assets.zip")
a.proguardFlags = extractedAARDir.Join(ctx, "proguard.txt")
android.SetProvider(ctx, ProguardSpecInfoProvider, ProguardSpecInfo{
@ -1148,7 +1148,7 @@ func (a *AARImport) GenerateAndroidBuildActions(ctx android.ModuleContext) {
ctx.Build(pctx, android.BuildParams{
Rule: unzipAAR,
Input: a.aarPath,
Outputs: android.WritablePaths{a.classpathFile, a.proguardFlags, a.manifest, a.assetsPackage, aarRTxt},
Outputs: android.WritablePaths{a.classpathFile, a.proguardFlags, a.manifest, a.assetsPackage, a.rTxt},
Description: "unzip AAR",
Args: map[string]string{
"outDir": extractedAARDir.String(),
@ -1166,7 +1166,7 @@ func (a *AARImport) GenerateAndroidBuildActions(ctx android.ModuleContext) {
a.exportPackage = android.PathForModuleOut(ctx, "package-res.apk")
proguardOptionsFile := android.PathForModuleGen(ctx, "proguard.options")
a.rTxt = android.PathForModuleOut(ctx, "R.txt")
aaptRTxt := android.PathForModuleOut(ctx, "R.txt")
a.extraAaptPackagesFile = android.PathForModuleOut(ctx, "extra_packages")
var linkDeps android.Paths
@ -1203,7 +1203,7 @@ func (a *AARImport) GenerateAndroidBuildActions(ctx android.ModuleContext) {
}
transitiveAssets := android.ReverseSliceInPlace(staticDeps.assets())
aapt2Link(ctx, a.exportPackage, nil, proguardOptionsFile, a.rTxt,
aapt2Link(ctx, a.exportPackage, nil, proguardOptionsFile, aaptRTxt,
linkFlags, linkDeps, nil, overlayRes, transitiveAssets, nil, nil)
a.rJar = android.PathForModuleOut(ctx, "busybox/R.jar")