summaryrefslogtreecommitdiff
path: root/java/aar.go
diff options
context:
space:
mode:
Diffstat (limited to 'java/aar.go')
-rw-r--r--java/aar.go15
1 files changed, 6 insertions, 9 deletions
diff --git a/java/aar.go b/java/aar.go
index f61fc8374..146b17319 100644
--- a/java/aar.go
+++ b/java/aar.go
@@ -23,6 +23,7 @@ import (
"android/soong/android"
"android/soong/dexpreopt"
+
"github.com/google/blueprint"
"github.com/google/blueprint/proptools"
)
@@ -414,17 +415,11 @@ func (a *aapt) buildActions(ctx android.ModuleContext, opts aaptBuildActionOptio
linkFlags = append(linkFlags, "--static-lib")
}
+ linkFlags = append(linkFlags, "--no-static-lib-packages")
if a.isLibrary && a.useResourceProcessorBusyBox(ctx) {
- // When building an android_library using ResourceProcessorBusyBox the resources are merged into
- // package-res.apk with --merge-only, but --no-static-lib-packages is not used so that R.txt only
- // contains resources from this library.
+ // When building an android_library using ResourceProcessorBusyBox pass --merge-only to skip resource
+ // references validation until the final app link step when all static libraries are present.
linkFlags = append(linkFlags, "--merge-only")
- } else {
- // When building and app or when building an android_library without ResourceProcessorBusyBox
- // --no-static-lib-packages is used to put all the resources into the app. If ResourceProcessorBusyBox
- // is used then the app's R.txt will be post-processed along with the R.txt files from dependencies to
- // sort resources into the right packages in R.class.
- linkFlags = append(linkFlags, "--no-static-lib-packages")
}
packageRes := android.PathForModuleOut(ctx, "package-res.apk")
@@ -1177,6 +1172,7 @@ func (a *AARImport) GenerateAndroidBuildActions(ctx android.ModuleContext) {
"--static-lib",
"--merge-only",
"--auto-add-overlay",
+ "--no-static-lib-packages",
}
linkFlags = append(linkFlags, "--manifest "+a.manifest.String())
@@ -1250,6 +1246,7 @@ func (a *AARImport) GenerateAndroidBuildActions(ctx android.ModuleContext) {
TransitiveStaticLibsHeaderJars: a.transitiveStaticLibsHeaderJars,
ImplementationAndResourcesJars: android.PathsIfNonNil(a.classpathFile),
ImplementationJars: android.PathsIfNonNil(a.classpathFile),
+ StubsLinkType: Implementation,
// TransitiveAconfigFiles: // TODO(b/289117800): LOCAL_ACONFIG_FILES for prebuilts
})