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:
@@ -202,7 +202,8 @@ var mergeAssetsRule = pctx.AndroidStaticRule("mergeAssets",
|
||||
func aapt2Link(ctx android.ModuleContext,
|
||||
packageRes, genJar, proguardOptions, rTxt android.WritablePath,
|
||||
flags []string, deps android.Paths,
|
||||
compiledRes, compiledOverlay, assetPackages android.Paths, splitPackages android.WritablePaths) {
|
||||
compiledRes, compiledOverlay, assetPackages android.Paths, splitPackages android.WritablePaths,
|
||||
featureFlagsPaths android.Paths) {
|
||||
|
||||
var inFlags []string
|
||||
|
||||
@@ -255,6 +256,11 @@ func aapt2Link(ctx android.ModuleContext,
|
||||
})
|
||||
}
|
||||
|
||||
for _, featureFlagsPath := range featureFlagsPaths {
|
||||
deps = append(deps, featureFlagsPath)
|
||||
inFlags = append(inFlags, "--feature-flags", "@"+featureFlagsPath.String())
|
||||
}
|
||||
|
||||
// Note the absence of splitPackages. The caller is supposed to compose and provide --split flag
|
||||
// values via the flags parameter when it wants to split outputs.
|
||||
// TODO(b/174509108): Perhaps we can process it in this func while keeping the code reasonably
|
||||
|
Reference in New Issue
Block a user