diff options
author | Nikita Ioffe <ioffe@google.com> | 2019-04-04 13:42:00 +0100 |
---|---|---|
committer | Nikita Ioffe <ioffe@google.com> | 2019-04-06 11:30:10 +0100 |
commit | 03a31cc2ccfcd65a7e1fc953aa306609355bed97 (patch) | |
tree | 838d586579f058f6290d22a3864070b0275d4a64 /apex | |
parent | 0ebdd3430e8c2a49544596c6d100c2942c81c38e (diff) | |
download | build_soong-03a31cc2ccfcd65a7e1fc953aa306609355bed97.tar.gz build_soong-03a31cc2ccfcd65a7e1fc953aa306609355bed97.tar.bz2 build_soong-03a31cc2ccfcd65a7e1fc953aa306609355bed97.zip |
Add installable property for prebuilt_apex
In case of shim apexes, we prebuilt all of them, but only need to
install v1 to a system partition.
Bug: 128677967
Test: manually checked that non-installable prebuilts don't end in /system
Change-Id: I112432abfd8f03cc7d7379ea3cab3f5491ace49c
Merged-In: I112432abfd8f03cc7d7379ea3cab3f5491ace49c
(cherry picked from commit dd53e8be1891aa3db182bba24c32d48580d666d4)
Diffstat (limited to 'apex')
-rw-r--r-- | apex/apex.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/apex/apex.go b/apex/apex.go index ce1ed46b..c68d1cff 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -1317,6 +1317,12 @@ type PrebuiltProperties struct { Src *string } } + + Installable *bool +} + +func (p *Prebuilt) installable() bool { + return p.properties.Installable == nil || proptools.Bool(p.properties.Installable) } func (p *Prebuilt) DepsMutator(ctx android.BottomUpMutatorContext) { @@ -1351,7 +1357,9 @@ func (p *Prebuilt) GenerateAndroidBuildActions(ctx android.ModuleContext) { // TODO(jungjw): Check the key validity. p.inputApex = p.Prebuilt().SingleSourcePath(ctx) p.installDir = android.PathForModuleInstall(ctx, "apex") - ctx.InstallFile(p.installDir, ctx.ModuleName()+imageApexSuffix, p.inputApex) + if p.installable() { + ctx.InstallFile(p.installDir, ctx.ModuleName()+imageApexSuffix, p.inputApex) + } } func (p *Prebuilt) Prebuilt() *android.Prebuilt { @@ -1371,6 +1379,7 @@ func (p *Prebuilt) AndroidMk() android.AndroidMkData { func(w io.Writer, outputFile android.Path) { fmt.Fprintln(w, "LOCAL_MODULE_PATH :=", filepath.Join("$(OUT_DIR)", p.installDir.RelPathString())) fmt.Fprintln(w, "LOCAL_MODULE_STEM :=", p.BaseModuleName()+imageApexSuffix) + fmt.Fprintln(w, "LOCAL_UNINSTALLABLE_MODULE :=", !p.installable()) }, }, } |