Merge "rust: Hook up InstallIn functions + Product" am: 13b3b785ec
am: d7bfb87eec
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1803098 Change-Id: I408691811f547dd995807601ac49bad3f934fb3e
This commit is contained in:
@@ -397,8 +397,15 @@ func (compiler *baseCompiler) installDir(ctx ModuleContext) android.InstallPath
|
|||||||
}
|
}
|
||||||
|
|
||||||
if compiler.location == InstallInData && ctx.RustModule().UseVndk() {
|
if compiler.location == InstallInData && ctx.RustModule().UseVndk() {
|
||||||
dir = filepath.Join(dir, "vendor")
|
if ctx.RustModule().InProduct() {
|
||||||
|
dir = filepath.Join(dir, "product")
|
||||||
|
} else if ctx.RustModule().InVendor() {
|
||||||
|
dir = filepath.Join(dir, "vendor")
|
||||||
|
} else {
|
||||||
|
ctx.ModuleErrorf("Unknown data+VNDK installation kind")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return android.PathForModuleInstall(ctx, dir, compiler.subDir,
|
return android.PathForModuleInstall(ctx, dir, compiler.subDir,
|
||||||
compiler.relativeInstallPath(), compiler.relative)
|
compiler.relativeInstallPath(), compiler.relative)
|
||||||
}
|
}
|
||||||
|
@@ -136,7 +136,13 @@ func (c *Module) VendorVariantToOdm() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (ctx *moduleContext) ProductSpecific() bool {
|
func (ctx *moduleContext) ProductSpecific() bool {
|
||||||
return false
|
return ctx.ModuleContext.ProductSpecific() || ctx.RustModule().productSpecificModuleContext()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Module) productSpecificModuleContext() bool {
|
||||||
|
// Additionally check if this module is inProduct() that means it is a "product" variant of a
|
||||||
|
// module. As well as product specific modules, product variants must be installed to /product.
|
||||||
|
return c.InProduct()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (mod *Module) InRecovery() bool {
|
func (mod *Module) InRecovery() bool {
|
||||||
|
12
rust/rust.go
12
rust/rust.go
@@ -1233,6 +1233,18 @@ func (mod *Module) InstallInData() bool {
|
|||||||
return mod.compiler.inData()
|
return mod.compiler.inData()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (mod *Module) InstallInRamdisk() bool {
|
||||||
|
return mod.InRamdisk()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (mod *Module) InstallInVendorRamdisk() bool {
|
||||||
|
return mod.InVendorRamdisk()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (mod *Module) InstallInRecovery() bool {
|
||||||
|
return mod.InRecovery()
|
||||||
|
}
|
||||||
|
|
||||||
func linkPathFromFilePath(filepath android.Path) string {
|
func linkPathFromFilePath(filepath android.Path) string {
|
||||||
return strings.Split(filepath.String(), filepath.Base())[0]
|
return strings.Split(filepath.String(), filepath.Base())[0]
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user