Add InstallBypassMake

Allow modules to mark themselves as InstallBypassMake, which will
cause android.PathForModuleInstall to return a path in $OUT_DIR
instead of $OUT_DIR/soong.  This can be used for modules that
can handle installation to the final location on their own.  The
main blocker for most modules is support for the "required" property,
which requires adding dependencies on the installed location of
other modules.

Bug: 122332855
Test: m checkbuild
Change-Id: I85238d937ff30335167d4b3fec79bbefc734b5e1
This commit is contained in:
Colin Cross
2019-07-29 16:44:46 -07:00
parent 8baf29fb10
commit 607d8587e4
4 changed files with 30 additions and 5 deletions

View File

@@ -155,6 +155,7 @@ type ModuleContext interface {
InstallInData() bool
InstallInSanitizerDir() bool
InstallInRecovery() bool
InstallBypassMake() bool
RequiredModuleNames() []string
HostRequiredModuleNames() []string
@@ -192,6 +193,7 @@ type Module interface {
InstallInData() bool
InstallInSanitizerDir() bool
InstallInRecovery() bool
InstallBypassMake() bool
SkipInstall()
ExportedToMake() bool
NoticeFile() OptionalPath
@@ -837,6 +839,10 @@ func (m *ModuleBase) InstallInRecovery() bool {
return Bool(m.commonProperties.Recovery)
}
func (m *ModuleBase) InstallBypassMake() bool {
return false
}
func (m *ModuleBase) Owner() string {
return String(m.commonProperties.Owner)
}
@@ -1493,6 +1499,10 @@ func (m *moduleContext) InstallInRecovery() bool {
return m.module.InstallInRecovery()
}
func (m *moduleContext) InstallBypassMake() bool {
return m.module.InstallBypassMake()
}
func (m *moduleContext) skipInstall(fullInstallPath OutputPath) bool {
if m.module.base().commonProperties.SkipInstall {
return true
@@ -1506,7 +1516,7 @@ func (m *moduleContext) skipInstall(fullInstallPath OutputPath) bool {
}
if m.Device() {
if m.Config().SkipDeviceInstall() {
if m.Config().EmbeddedInMake() && !m.InstallBypassMake() {
return true
}