Add aconfig flag support for android_app
This change adds an overrideable property flags_packages to android_app, which is used to list the aconfig_declarations module names that the app depends on. The build action of android_app is modified to pass all flags text file provided by the aconfig_declarations to aapt2 link as --feature-flags arguments. Test: m nothing --no-skip-soong-tests Bug: 306024510 Change-Id: I4924f88b9954950cc1936a472cd7ac70f41add5d
This commit is contained in:
@@ -349,6 +349,7 @@ type aaptBuildActionOptions struct {
|
||||
excludedLibs []string
|
||||
enforceDefaultTargetSdkVersion bool
|
||||
extraLinkFlags []string
|
||||
aconfigTextFiles android.Paths
|
||||
}
|
||||
|
||||
func (a *aapt) buildActions(ctx android.ModuleContext, opts aaptBuildActionOptions) {
|
||||
@@ -529,7 +530,8 @@ func (a *aapt) buildActions(ctx android.ModuleContext, opts aaptBuildActionOptio
|
||||
transitiveAssets = android.ReverseSliceInPlace(staticDeps.assets())
|
||||
}
|
||||
aapt2Link(ctx, packageRes, srcJar, proguardOptionsFile, rTxt,
|
||||
linkFlags, linkDeps, compiledRes, compiledOverlay, transitiveAssets, splitPackages)
|
||||
linkFlags, linkDeps, compiledRes, compiledOverlay, transitiveAssets, splitPackages,
|
||||
opts.aconfigTextFiles)
|
||||
// Extract assets from the resource package output so that they can be used later in aapt2link
|
||||
// for modules that depend on this one.
|
||||
if android.PrefixInList(linkFlags, "-A ") {
|
||||
@@ -1193,7 +1195,7 @@ func (a *AARImport) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
|
||||
transitiveAssets := android.ReverseSliceInPlace(staticDeps.assets())
|
||||
aapt2Link(ctx, a.exportPackage, nil, proguardOptionsFile, a.rTxt,
|
||||
linkFlags, linkDeps, nil, overlayRes, transitiveAssets, nil)
|
||||
linkFlags, linkDeps, nil, overlayRes, transitiveAssets, nil, nil)
|
||||
|
||||
a.rJar = android.PathForModuleOut(ctx, "busybox/R.jar")
|
||||
resourceProcessorBusyBoxGenerateBinaryR(ctx, a.rTxt, a.manifest, a.rJar, nil, true)
|
||||
|
Reference in New Issue
Block a user