diff options
author | Jiyong Park <jiyong@google.com> | 2019-02-08 02:53:06 +0900 |
---|---|---|
committer | Jiyong Park <jiyong@google.com> | 2019-02-13 16:24:59 +0900 |
commit | 40e26a2a995dabed6129f774d84c6363c833f192 (patch) | |
tree | a7b06bba52675d23643c8589c4fe1e69ef4246d6 /apex | |
parent | ad0328deb830b1eaaa46f31adcbac43bbb636cee (diff) | |
download | build_soong-40e26a2a995dabed6129f774d84c6363c833f192.tar.gz build_soong-40e26a2a995dabed6129f774d84c6363c833f192.tar.bz2 build_soong-40e26a2a995dabed6129f774d84c6363c833f192.zip |
Allow each APEX to provide its own AndroidManifest
AndroidManifest.xml file can be specified via the 'androidManifest'
property in the apex module type. It can be used to have a custom
AndroidManifest.xml that have additional tags (such as <uses-sdk> or
<uses-feature>) for precise targeting.
The property is optional; if unspecified, then one is auto-generated as
before.
Bug: 123857186
Test: m apex_test_build_features
Change-Id: Id7ee0471661887cfa11124cbaa3beea8cffcdda4
Diffstat (limited to 'apex')
-rw-r--r-- | apex/apex.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/apex/apex.go b/apex/apex.go index f4bc1b9a..ef22afb3 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -212,6 +212,10 @@ type apexBundleProperties struct { // "apex_manifest.json" Manifest *string + // AndroidManifest.xml file used for the zip container of this APEX bundle. + // If unspecified, a default one is automatically generated. + AndroidManifest *string + // Determines the file contexts file for setting security context to each file in this APEX bundle. // Specifically, when this is set to <value>, /system/sepolicy/apex/<value>_file_contexts file is // used. @@ -901,6 +905,12 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext, keyFile and optFlags = append(optFlags, "--override_apk_package_name "+manifestPackageName) } + if a.properties.AndroidManifest != nil { + androidManifestFile := android.PathForModuleSrc(ctx, proptools.String(a.properties.AndroidManifest)) + implicitInputs = append(implicitInputs, androidManifestFile) + optFlags = append(optFlags, "--android_manifest "+androidManifestFile.String()) + } + ctx.Build(pctx, android.BuildParams{ Rule: apexRule, Implicits: implicitInputs, |