aboutsummaryrefslogtreecommitdiffstats
path: root/apex
diff options
context:
space:
mode:
authorNikita Ioffe <ioffe@google.com>2019-04-05 02:10:45 +0100
committerNikita Ioffe <ioffe@google.com>2019-04-08 09:48:58 +0100
commitbed7cd31018813d0042cc86ae3bcb85da97e9997 (patch)
tree2b0f9b3025d0301d1831707b0ede65b942d51860 /apex
parented75f6139899bd0301eaa0321ccfbc8cab620003 (diff)
downloadbuild_soong-bed7cd31018813d0042cc86ae3bcb85da97e9997.tar.gz
build_soong-bed7cd31018813d0042cc86ae3bcb85da97e9997.tar.bz2
build_soong-bed7cd31018813d0042cc86ae3bcb85da97e9997.zip
Make prebuilt_apex be usable via :modulename syntax
Test: m Bug: 127789981 Bug: 128677967 Change-Id: Ie1a1147c1d5570cd7eda48e274faabf95566d53f Merged-In: Ie1a1147c1d5570cd7eda48e274faabf95566d53f (cherry picked from commit 89ecd590ea9cb1424964f98f88a76830b6953a6a)
Diffstat (limited to 'apex')
-rw-r--r--apex/apex.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/apex/apex.go b/apex/apex.go
index 389290c1..665e3630 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -1297,6 +1297,7 @@ type Prebuilt struct {
inputApex android.Path
installDir android.OutputPath
installFilename string
+ outputApex android.WritablePath
}
type PrebuiltProperties struct {
@@ -1357,6 +1358,10 @@ func (p *Prebuilt) DepsMutator(ctx android.BottomUpMutatorContext) {
p.properties.Source = src
}
+func (p *Prebuilt) Srcs() android.Paths {
+ return android.Paths{p.outputApex}
+}
+
func (p *Prebuilt) GenerateAndroidBuildActions(ctx android.ModuleContext) {
// TODO(jungjw): Check the key validity.
p.inputApex = p.Prebuilt().SingleSourcePath(ctx)
@@ -1365,6 +1370,12 @@ func (p *Prebuilt) GenerateAndroidBuildActions(ctx android.ModuleContext) {
if !strings.HasSuffix(p.installFilename, imageApexSuffix) {
ctx.ModuleErrorf("filename should end in %s for prebuilt_apex", imageApexSuffix)
}
+ p.outputApex = android.PathForModuleOut(ctx, p.installFilename)
+ ctx.Build(pctx, android.BuildParams{
+ Rule: android.Cp,
+ Input: p.inputApex,
+ Output: p.outputApex,
+ })
if p.installable() {
ctx.InstallFile(p.installDir, p.installFilename, p.inputApex)
}