Add ApexModule interface for APEX-aware modules
am: 9d45299ba4
Change-Id: Ica517fea677af7098e7ac082cb15997b25c90f0a
This commit is contained in:
@@ -51,7 +51,7 @@ func (c *Module) subAndroidMk(data *android.AndroidMkData, obj interface{}) {
|
||||
}
|
||||
|
||||
func (c *Module) AndroidMk() android.AndroidMkData {
|
||||
if c.Properties.HideFromMake {
|
||||
if c.Properties.HideFromMake || !c.IsForPlatform() {
|
||||
return android.AndroidMkData{
|
||||
Disabled: true,
|
||||
}
|
||||
|
18
cc/cc.go
18
cc/cc.go
@@ -320,6 +320,7 @@ var (
|
||||
type Module struct {
|
||||
android.ModuleBase
|
||||
android.DefaultableModuleBase
|
||||
android.ApexModuleBase
|
||||
|
||||
Properties BaseProperties
|
||||
VendorProperties VendorProperties
|
||||
@@ -416,6 +417,8 @@ func (c *Module) Init() android.Module {
|
||||
|
||||
android.InitDefaultableModule(c)
|
||||
|
||||
android.InitApexModule(c)
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
@@ -794,7 +797,7 @@ func (c *Module) GenerateAndroidBuildActions(actx android.ModuleContext) {
|
||||
c.outputFile = android.OptionalPathForPath(outputFile)
|
||||
}
|
||||
|
||||
if c.installer != nil && !c.Properties.PreventInstall && c.outputFile.Valid() {
|
||||
if c.installer != nil && !c.Properties.PreventInstall && c.IsForPlatform() && c.outputFile.Valid() {
|
||||
c.installer.install(ctx, c.outputFile.Path())
|
||||
if ctx.Failed() {
|
||||
return
|
||||
@@ -1511,12 +1514,24 @@ func (c *Module) getMakeLinkType() string {
|
||||
}
|
||||
}
|
||||
|
||||
// Overrides ApexModule.IsInstallabeToApex()
|
||||
// Only shared libraries are installable to APEX.
|
||||
func (c *Module) IsInstallableToApex() bool {
|
||||
if shared, ok := c.linker.(interface {
|
||||
shared() bool
|
||||
}); ok {
|
||||
return shared.shared()
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
//
|
||||
// Defaults
|
||||
//
|
||||
type Defaults struct {
|
||||
android.ModuleBase
|
||||
android.DefaultsModuleBase
|
||||
android.ApexModuleBase
|
||||
}
|
||||
|
||||
func (*Defaults) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
@@ -1558,6 +1573,7 @@ func DefaultsFactory(props ...interface{}) android.Module {
|
||||
)
|
||||
|
||||
android.InitDefaultsModule(module)
|
||||
android.InitApexModule(module)
|
||||
|
||||
return module
|
||||
}
|
||||
|
Reference in New Issue
Block a user