diff options
author | Jiyong Park <jiyong@google.com> | 2019-02-13 21:33:49 +0900 |
---|---|---|
committer | Jiyong Park <jiyong@google.com> | 2019-02-14 15:28:58 +0900 |
commit | 809bb724f576c64ba2ae7fb292689abf90569b5d (patch) | |
tree | dcf860eb957eafaa6443ecfa693dc2b6a455b9b6 /apex | |
parent | f97782b18cc3dae0f0fb4b680e1488b000723396 (diff) | |
download | build_soong-809bb724f576c64ba2ae7fb292689abf90569b5d.tar.gz build_soong-809bb724f576c64ba2ae7fb292689abf90569b5d.tar.bz2 build_soong-809bb724f576c64ba2ae7fb292689abf90569b5d.zip |
Add ":name" support for manifest and androidManifest properties in apex
The manifest and androidManifest properties in the apex module type now
supports ":name" syntax.
Bug: 123857186
Test: m (apex_test amended)
Change-Id: Ic4e5a73cf73260d156ec61d07932ad07b2561413
Diffstat (limited to 'apex')
-rw-r--r-- | apex/apex.go | 14 | ||||
-rw-r--r-- | apex/apex_test.go | 14 |
2 files changed, 25 insertions, 3 deletions
diff --git a/apex/apex.go b/apex/apex.go index 7633ad20..3b06a995 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -511,6 +511,14 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) { if cert != "" { ctx.AddDependency(ctx.Module(), certificateTag, cert) } + + if String(a.properties.Manifest) != "" { + android.ExtractSourceDeps(ctx, a.properties.Manifest) + } + + if String(a.properties.AndroidManifest) != "" { + android.ExtractSourceDeps(ctx, a.properties.AndroidManifest) + } } func (a *apexBundle) getCertString(ctx android.BaseContext) string { @@ -793,7 +801,7 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext, keyFile and certificate = java.Certificate{pem, key} } - manifest := android.PathForModuleSrc(ctx, proptools.StringDefault(a.properties.Manifest, "apex_manifest.json")) + manifest := ctx.ExpandSource(proptools.StringDefault(a.properties.Manifest, "apex_manifest.json"), "manifest") var abis []string for _, target := range ctx.MultiTargets() { @@ -890,7 +898,7 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext, keyFile and } if a.properties.AndroidManifest != nil { - androidManifestFile := android.PathForModuleSrc(ctx, proptools.String(a.properties.AndroidManifest)) + androidManifestFile := ctx.ExpandSource(proptools.String(a.properties.AndroidManifest), "androidManifest") implicitInputs = append(implicitInputs, androidManifestFile) optFlags = append(optFlags, "--android_manifest "+androidManifestFile.String()) } @@ -969,7 +977,7 @@ func (a *apexBundle) buildFlattenedApex(ctx android.ModuleContext) { if a.installable() { // For flattened APEX, do nothing but make sure that apex_manifest.json file is also copied along // with other ordinary files. - manifest := android.PathForModuleSrc(ctx, proptools.StringDefault(a.properties.Manifest, "apex_manifest.json")) + manifest := ctx.ExpandSource(proptools.StringDefault(a.properties.Manifest, "apex_manifest.json"), "manifest") // rename to apex_manifest.json copiedManifest := android.PathForModuleOut(ctx, "apex_manifest.json") diff --git a/apex/apex_test.go b/apex/apex_test.go index 13ddb55d..66f07259 100644 --- a/apex/apex_test.go +++ b/apex/apex_test.go @@ -53,6 +53,7 @@ func testApex(t *testing.T, bp string) *android.TestContext { ctx.RegisterModuleType("prebuilt_etc", android.ModuleFactoryAdaptor(android.PrebuiltEtcFactory)) ctx.RegisterModuleType("sh_binary", android.ModuleFactoryAdaptor(android.ShBinaryFactory)) ctx.RegisterModuleType("android_app_certificate", android.ModuleFactoryAdaptor(java.AndroidAppCertificateFactory)) + ctx.RegisterModuleType("filegroup", android.ModuleFactoryAdaptor(android.FileGroupFactory)) ctx.PreDepsMutators(func(ctx android.RegisterMutatorsContext) { ctx.BottomUp("image", cc.ImageMutator).Parallel() ctx.BottomUp("link", cc.LinkageMutator).Parallel() @@ -143,6 +144,7 @@ func testApex(t *testing.T, bp string) *android.TestContext { "Android.bp": []byte(bp), "build/target/product/security": nil, "apex_manifest.json": nil, + "AndroidManifest.xml": nil, "system/sepolicy/apex/myapex-file_contexts": nil, "system/sepolicy/apex/myapex_keytest-file_contexts": nil, "system/sepolicy/apex/otherapex-file_contexts": nil, @@ -214,6 +216,8 @@ func TestBasicApex(t *testing.T) { ctx := testApex(t, ` apex_defaults { name: "myapex-defaults", + manifest: ":myapex.manifest", + androidManifest: ":myapex.androidmanifest", key: "myapex.key", native_shared_libs: ["mylib"], multilib: { @@ -234,6 +238,16 @@ func TestBasicApex(t *testing.T) { private_key: "testkey.pem", } + filegroup { + name: "myapex.manifest", + srcs: ["apex_manifest.json"], + } + + filegroup { + name: "myapex.androidmanifest", + srcs: ["AndroidManifest.xml"], + } + cc_library { name: "mylib", srcs: ["mylib.cpp"], |