Merge "rust modules in APEX don't get installed to the system partition"
This commit is contained in:
14
rust/rust.go
14
rust/rust.go
@@ -482,6 +482,16 @@ func (mod *Module) CoverageFiles() android.Paths {
|
|||||||
panic(fmt.Errorf("CoverageFiles called on non-library module: %q", mod.BaseModuleName()))
|
panic(fmt.Errorf("CoverageFiles called on non-library module: %q", mod.BaseModuleName()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (mod *Module) installable(apexInfo android.ApexInfo) bool {
|
||||||
|
// The apex variant is not installable because it is included in the APEX and won't appear
|
||||||
|
// in the system partition as a standalone file.
|
||||||
|
if !apexInfo.IsForPlatform() {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return mod.outputFile.Valid() && !mod.Properties.PreventInstall
|
||||||
|
}
|
||||||
|
|
||||||
var _ cc.LinkableInterface = (*Module)(nil)
|
var _ cc.LinkableInterface = (*Module)(nil)
|
||||||
|
|
||||||
func (mod *Module) Init() android.Module {
|
func (mod *Module) Init() android.Module {
|
||||||
@@ -653,7 +663,9 @@ func (mod *Module) GenerateAndroidBuildActions(actx android.ModuleContext) {
|
|||||||
outputFile := mod.compiler.compile(ctx, flags, deps)
|
outputFile := mod.compiler.compile(ctx, flags, deps)
|
||||||
|
|
||||||
mod.outputFile = android.OptionalPathForPath(outputFile)
|
mod.outputFile = android.OptionalPathForPath(outputFile)
|
||||||
if mod.outputFile.Valid() && !mod.Properties.PreventInstall {
|
|
||||||
|
apexInfo := actx.Provider(android.ApexInfoProvider).(android.ApexInfo)
|
||||||
|
if mod.installable(apexInfo) {
|
||||||
mod.compiler.install(ctx)
|
mod.compiler.install(ctx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user