Merge changes from topic "vendor_snapshot_remove_suffix"
* changes: Fix arch in snapshot DepsMutator. Automatically set Androidmk suffix of snapshot
This commit is contained in:
@@ -337,7 +337,8 @@ func (s *snapshot) DepsMutator(ctx android.BottomUpMutatorContext) {
|
||||
for _, name := range names {
|
||||
snapshotMap[name] = name +
|
||||
getSnapshotNameSuffix(snapshotSuffix+moduleSuffix,
|
||||
s.baseSnapshot.version(), ctx.Arch().ArchType.Name)
|
||||
s.baseSnapshot.version(),
|
||||
ctx.DeviceConfig().Arches()[0].ArchType.String())
|
||||
}
|
||||
return snapshotMap
|
||||
}
|
||||
@@ -396,7 +397,7 @@ type baseSnapshotDecoratorProperties struct {
|
||||
Target_arch string
|
||||
|
||||
// Suffix to be added to the module name when exporting to Android.mk, e.g. ".vendor".
|
||||
Androidmk_suffix string
|
||||
Androidmk_suffix string `blueprint:"mutated"`
|
||||
|
||||
// Suffix to be added to the module name, e.g., vendor_shared,
|
||||
// recovery_shared, etc.
|
||||
@@ -417,6 +418,7 @@ type baseSnapshotDecoratorProperties struct {
|
||||
// will be seen as "libbase.vendor_static.30.arm64" by Soong.
|
||||
type baseSnapshotDecorator struct {
|
||||
baseProperties baseSnapshotDecoratorProperties
|
||||
image snapshotImage
|
||||
}
|
||||
|
||||
func (p *baseSnapshotDecorator) Name(name string) string {
|
||||
@@ -447,10 +449,21 @@ func (p *baseSnapshotDecorator) snapshotAndroidMkSuffix() string {
|
||||
return p.baseProperties.Androidmk_suffix
|
||||
}
|
||||
|
||||
func (p *baseSnapshotDecorator) setSnapshotAndroidMkSuffix(ctx android.ModuleContext) {
|
||||
if ctx.OtherModuleDependencyVariantExists([]blueprint.Variation{
|
||||
{Mutator: "image", Variation: android.CoreVariation},
|
||||
}, ctx.Module().(*Module).BaseModuleName()) {
|
||||
p.baseProperties.Androidmk_suffix = p.image.moduleNameSuffix()
|
||||
} else {
|
||||
p.baseProperties.Androidmk_suffix = ""
|
||||
}
|
||||
}
|
||||
|
||||
// Call this with a module suffix after creating a snapshot module, such as
|
||||
// vendorSnapshotSharedSuffix, recoverySnapshotBinarySuffix, etc.
|
||||
func (p *baseSnapshotDecorator) init(m *Module, snapshotSuffix, moduleSuffix string) {
|
||||
p.baseProperties.ModuleSuffix = snapshotSuffix + moduleSuffix
|
||||
func (p *baseSnapshotDecorator) init(m *Module, image snapshotImage, moduleSuffix string) {
|
||||
p.image = image
|
||||
p.baseProperties.ModuleSuffix = image.moduleNameSuffix() + moduleSuffix
|
||||
m.AddProperties(&p.baseProperties)
|
||||
android.AddLoadHook(m, func(ctx android.LoadHookContext) {
|
||||
vendorSnapshotLoadHook(ctx, p)
|
||||
@@ -532,6 +545,8 @@ func (p *snapshotLibraryDecorator) matchesWithDevice(config android.DeviceConfig
|
||||
// As snapshots are prebuilts, this just returns the prebuilt binary after doing things which are
|
||||
// done by normal library decorator, e.g. exporting flags.
|
||||
func (p *snapshotLibraryDecorator) link(ctx ModuleContext, flags Flags, deps PathDeps, objs Objects) android.Path {
|
||||
p.setSnapshotAndroidMkSuffix(ctx)
|
||||
|
||||
if p.header() {
|
||||
return p.libraryDecorator.link(ctx, flags, deps, objs)
|
||||
}
|
||||
@@ -614,7 +629,7 @@ func (p *snapshotLibraryDecorator) setSanitizerVariation(t SanitizerType, enable
|
||||
}
|
||||
}
|
||||
|
||||
func snapshotLibraryFactory(snapshotSuffix, moduleSuffix string) (*Module, *snapshotLibraryDecorator) {
|
||||
func snapshotLibraryFactory(image snapshotImage, moduleSuffix string) (*Module, *snapshotLibraryDecorator) {
|
||||
module, library := NewLibrary(android.DeviceSupported)
|
||||
|
||||
module.stl = nil
|
||||
@@ -637,7 +652,7 @@ func snapshotLibraryFactory(snapshotSuffix, moduleSuffix string) (*Module, *snap
|
||||
module.linker = prebuilt
|
||||
module.installer = prebuilt
|
||||
|
||||
prebuilt.init(module, snapshotSuffix, moduleSuffix)
|
||||
prebuilt.init(module, image, moduleSuffix)
|
||||
module.AddProperties(
|
||||
&prebuilt.properties,
|
||||
&prebuilt.sanitizerProperties,
|
||||
@@ -651,7 +666,7 @@ func snapshotLibraryFactory(snapshotSuffix, moduleSuffix string) (*Module, *snap
|
||||
// overrides the vendor variant of the cc shared library with the same name, if BOARD_VNDK_VERSION
|
||||
// is set.
|
||||
func VendorSnapshotSharedFactory() android.Module {
|
||||
module, prebuilt := snapshotLibraryFactory(vendorSnapshotImageSingleton.moduleNameSuffix(), snapshotSharedSuffix)
|
||||
module, prebuilt := snapshotLibraryFactory(vendorSnapshotImageSingleton, snapshotSharedSuffix)
|
||||
prebuilt.libraryDecorator.BuildOnlyShared()
|
||||
return module.Init()
|
||||
}
|
||||
@@ -661,7 +676,7 @@ func VendorSnapshotSharedFactory() android.Module {
|
||||
// overrides the recovery variant of the cc shared library with the same name, if BOARD_VNDK_VERSION
|
||||
// is set.
|
||||
func RecoverySnapshotSharedFactory() android.Module {
|
||||
module, prebuilt := snapshotLibraryFactory(recoverySnapshotImageSingleton.moduleNameSuffix(), snapshotSharedSuffix)
|
||||
module, prebuilt := snapshotLibraryFactory(recoverySnapshotImageSingleton, snapshotSharedSuffix)
|
||||
prebuilt.libraryDecorator.BuildOnlyShared()
|
||||
return module.Init()
|
||||
}
|
||||
@@ -671,7 +686,7 @@ func RecoverySnapshotSharedFactory() android.Module {
|
||||
// overrides the vendor variant of the cc static library with the same name, if BOARD_VNDK_VERSION
|
||||
// is set.
|
||||
func VendorSnapshotStaticFactory() android.Module {
|
||||
module, prebuilt := snapshotLibraryFactory(vendorSnapshotImageSingleton.moduleNameSuffix(), snapshotStaticSuffix)
|
||||
module, prebuilt := snapshotLibraryFactory(vendorSnapshotImageSingleton, snapshotStaticSuffix)
|
||||
prebuilt.libraryDecorator.BuildOnlyStatic()
|
||||
return module.Init()
|
||||
}
|
||||
@@ -681,7 +696,7 @@ func VendorSnapshotStaticFactory() android.Module {
|
||||
// overrides the recovery variant of the cc static library with the same name, if BOARD_VNDK_VERSION
|
||||
// is set.
|
||||
func RecoverySnapshotStaticFactory() android.Module {
|
||||
module, prebuilt := snapshotLibraryFactory(recoverySnapshotImageSingleton.moduleNameSuffix(), snapshotStaticSuffix)
|
||||
module, prebuilt := snapshotLibraryFactory(recoverySnapshotImageSingleton, snapshotStaticSuffix)
|
||||
prebuilt.libraryDecorator.BuildOnlyStatic()
|
||||
return module.Init()
|
||||
}
|
||||
@@ -691,7 +706,7 @@ func RecoverySnapshotStaticFactory() android.Module {
|
||||
// overrides the vendor variant of the cc header library with the same name, if BOARD_VNDK_VERSION
|
||||
// is set.
|
||||
func VendorSnapshotHeaderFactory() android.Module {
|
||||
module, prebuilt := snapshotLibraryFactory(vendorSnapshotImageSingleton.moduleNameSuffix(), snapshotHeaderSuffix)
|
||||
module, prebuilt := snapshotLibraryFactory(vendorSnapshotImageSingleton, snapshotHeaderSuffix)
|
||||
prebuilt.libraryDecorator.HeaderOnly()
|
||||
return module.Init()
|
||||
}
|
||||
@@ -701,7 +716,7 @@ func VendorSnapshotHeaderFactory() android.Module {
|
||||
// overrides the recovery variant of the cc header library with the same name, if BOARD_VNDK_VERSION
|
||||
// is set.
|
||||
func RecoverySnapshotHeaderFactory() android.Module {
|
||||
module, prebuilt := snapshotLibraryFactory(recoverySnapshotImageSingleton.moduleNameSuffix(), snapshotHeaderSuffix)
|
||||
module, prebuilt := snapshotLibraryFactory(recoverySnapshotImageSingleton, snapshotHeaderSuffix)
|
||||
prebuilt.libraryDecorator.HeaderOnly()
|
||||
return module.Init()
|
||||
}
|
||||
@@ -739,6 +754,8 @@ func (p *snapshotBinaryDecorator) matchesWithDevice(config android.DeviceConfig)
|
||||
// cc modules' link functions are to link compiled objects into final binaries.
|
||||
// As snapshots are prebuilts, this just returns the prebuilt binary
|
||||
func (p *snapshotBinaryDecorator) link(ctx ModuleContext, flags Flags, deps PathDeps, objs Objects) android.Path {
|
||||
p.setSnapshotAndroidMkSuffix(ctx)
|
||||
|
||||
if !p.matchesWithDevice(ctx.DeviceConfig()) {
|
||||
return nil
|
||||
}
|
||||
@@ -767,17 +784,17 @@ func (p *snapshotBinaryDecorator) nativeCoverage() bool {
|
||||
// development/vendor_snapshot/update.py. As a part of vendor snapshot, vendor_snapshot_binary
|
||||
// overrides the vendor variant of the cc binary with the same name, if BOARD_VNDK_VERSION is set.
|
||||
func VendorSnapshotBinaryFactory() android.Module {
|
||||
return snapshotBinaryFactory(vendorSnapshotImageSingleton.moduleNameSuffix(), snapshotBinarySuffix)
|
||||
return snapshotBinaryFactory(vendorSnapshotImageSingleton, snapshotBinarySuffix)
|
||||
}
|
||||
|
||||
// recovery_snapshot_binary is a special prebuilt executable binary which is auto-generated by
|
||||
// development/vendor_snapshot/update.py. As a part of recovery snapshot, recovery_snapshot_binary
|
||||
// overrides the recovery variant of the cc binary with the same name, if BOARD_VNDK_VERSION is set.
|
||||
func RecoverySnapshotBinaryFactory() android.Module {
|
||||
return snapshotBinaryFactory(recoverySnapshotImageSingleton.moduleNameSuffix(), snapshotBinarySuffix)
|
||||
return snapshotBinaryFactory(recoverySnapshotImageSingleton, snapshotBinarySuffix)
|
||||
}
|
||||
|
||||
func snapshotBinaryFactory(snapshotSuffix, moduleSuffix string) android.Module {
|
||||
func snapshotBinaryFactory(image snapshotImage, moduleSuffix string) android.Module {
|
||||
module, binary := NewBinary(android.DeviceSupported)
|
||||
binary.baseLinker.Properties.No_libcrt = BoolPtr(true)
|
||||
binary.baseLinker.Properties.Nocrt = BoolPtr(true)
|
||||
@@ -796,7 +813,7 @@ func snapshotBinaryFactory(snapshotSuffix, moduleSuffix string) android.Module {
|
||||
module.stl = nil
|
||||
module.linker = prebuilt
|
||||
|
||||
prebuilt.init(module, snapshotSuffix, moduleSuffix)
|
||||
prebuilt.init(module, image, moduleSuffix)
|
||||
module.AddProperties(&prebuilt.properties)
|
||||
return module.Init()
|
||||
}
|
||||
@@ -832,6 +849,8 @@ func (p *snapshotObjectLinker) matchesWithDevice(config android.DeviceConfig) bo
|
||||
// cc modules' link functions are to link compiled objects into final binaries.
|
||||
// As snapshots are prebuilts, this just returns the prebuilt binary
|
||||
func (p *snapshotObjectLinker) link(ctx ModuleContext, flags Flags, deps PathDeps, objs Objects) android.Path {
|
||||
p.setSnapshotAndroidMkSuffix(ctx)
|
||||
|
||||
if !p.matchesWithDevice(ctx.DeviceConfig()) {
|
||||
return nil
|
||||
}
|
||||
@@ -856,7 +875,7 @@ func VendorSnapshotObjectFactory() android.Module {
|
||||
}
|
||||
module.linker = prebuilt
|
||||
|
||||
prebuilt.init(module, vendorSnapshotImageSingleton.moduleNameSuffix(), snapshotObjectSuffix)
|
||||
prebuilt.init(module, vendorSnapshotImageSingleton, snapshotObjectSuffix)
|
||||
module.AddProperties(&prebuilt.properties)
|
||||
return module.Init()
|
||||
}
|
||||
@@ -874,7 +893,7 @@ func RecoverySnapshotObjectFactory() android.Module {
|
||||
}
|
||||
module.linker = prebuilt
|
||||
|
||||
prebuilt.init(module, recoverySnapshotImageSingleton.moduleNameSuffix(), snapshotObjectSuffix)
|
||||
prebuilt.init(module, recoverySnapshotImageSingleton, snapshotObjectSuffix)
|
||||
module.AddProperties(&prebuilt.properties)
|
||||
return module.Init()
|
||||
}
|
||||
|
@@ -238,7 +238,6 @@ func isSnapshotAware(cfg android.DeviceConfig, m *Module, inProprietaryPath bool
|
||||
type snapshotJsonFlags struct {
|
||||
ModuleName string `json:",omitempty"`
|
||||
RelativeInstallPath string `json:",omitempty"`
|
||||
AndroidMkSuffix string `json:",omitempty"`
|
||||
|
||||
// library flags
|
||||
ExportedDirs []string `json:",omitempty"`
|
||||
@@ -352,7 +351,6 @@ func (c *snapshotSingleton) GenerateBuildActions(ctx android.SingletonContext) {
|
||||
} else {
|
||||
prop.RelativeInstallPath = m.RelativeInstallPath()
|
||||
}
|
||||
prop.AndroidMkSuffix = m.Properties.SubName
|
||||
prop.RuntimeLibs = m.Properties.SnapshotRuntimeLibs
|
||||
prop.Required = m.RequiredModuleNames()
|
||||
for _, path := range m.InitRc() {
|
||||
|
@@ -271,7 +271,6 @@ func TestVendorSnapshotUse(t *testing.T) {
|
||||
enabled: true,
|
||||
},
|
||||
nocrt: true,
|
||||
compile_multilib: "64",
|
||||
}
|
||||
|
||||
cc_library {
|
||||
@@ -281,7 +280,6 @@ func TestVendorSnapshotUse(t *testing.T) {
|
||||
no_libcrt: true,
|
||||
stl: "none",
|
||||
system_shared_libs: [],
|
||||
compile_multilib: "64",
|
||||
}
|
||||
|
||||
cc_library {
|
||||
@@ -291,6 +289,25 @@ func TestVendorSnapshotUse(t *testing.T) {
|
||||
no_libcrt: true,
|
||||
stl: "none",
|
||||
system_shared_libs: [],
|
||||
}
|
||||
|
||||
cc_library {
|
||||
name: "lib32",
|
||||
vendor: true,
|
||||
nocrt: true,
|
||||
no_libcrt: true,
|
||||
stl: "none",
|
||||
system_shared_libs: [],
|
||||
compile_multilib: "32",
|
||||
}
|
||||
|
||||
cc_library {
|
||||
name: "lib64",
|
||||
vendor: true,
|
||||
nocrt: true,
|
||||
no_libcrt: true,
|
||||
stl: "none",
|
||||
system_shared_libs: [],
|
||||
compile_multilib: "64",
|
||||
}
|
||||
|
||||
@@ -301,7 +318,16 @@ func TestVendorSnapshotUse(t *testing.T) {
|
||||
no_libcrt: true,
|
||||
stl: "none",
|
||||
system_shared_libs: [],
|
||||
compile_multilib: "64",
|
||||
}
|
||||
|
||||
cc_binary {
|
||||
name: "bin32",
|
||||
vendor: true,
|
||||
nocrt: true,
|
||||
no_libcrt: true,
|
||||
stl: "none",
|
||||
system_shared_libs: [],
|
||||
compile_multilib: "32",
|
||||
}
|
||||
`
|
||||
|
||||
@@ -320,6 +346,10 @@ func TestVendorSnapshotUse(t *testing.T) {
|
||||
srcs: ["libvndk.so"],
|
||||
export_include_dirs: ["include/libvndk"],
|
||||
},
|
||||
arm: {
|
||||
srcs: ["libvndk.so"],
|
||||
export_include_dirs: ["include/libvndk"],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -338,6 +368,28 @@ func TestVendorSnapshotUse(t *testing.T) {
|
||||
srcs: ["libvndk.so"],
|
||||
export_include_dirs: ["include/libvndk"],
|
||||
},
|
||||
arm: {
|
||||
srcs: ["libvndk.so"],
|
||||
export_include_dirs: ["include/libvndk"],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
// different arch snapshot which has to be ignored
|
||||
vndk_prebuilt_shared {
|
||||
name: "libvndk",
|
||||
version: "28",
|
||||
target_arch: "arm",
|
||||
vendor_available: true,
|
||||
product_available: true,
|
||||
vndk: {
|
||||
enabled: true,
|
||||
},
|
||||
arch: {
|
||||
arm: {
|
||||
srcs: ["libvndk.so"],
|
||||
export_include_dirs: ["include/libvndk"],
|
||||
},
|
||||
},
|
||||
}
|
||||
`
|
||||
@@ -350,7 +402,6 @@ func TestVendorSnapshotUse(t *testing.T) {
|
||||
no_libcrt: true,
|
||||
stl: "none",
|
||||
system_shared_libs: [],
|
||||
compile_multilib: "64",
|
||||
}
|
||||
|
||||
cc_library_shared {
|
||||
@@ -362,7 +413,14 @@ func TestVendorSnapshotUse(t *testing.T) {
|
||||
system_shared_libs: [],
|
||||
shared_libs: ["libvndk", "libvendor_available"],
|
||||
static_libs: ["libvendor", "libvendor_without_snapshot"],
|
||||
compile_multilib: "64",
|
||||
arch: {
|
||||
arm64: {
|
||||
shared_libs: ["lib64"],
|
||||
},
|
||||
arm: {
|
||||
shared_libs: ["lib32"],
|
||||
},
|
||||
},
|
||||
srcs: ["client.cpp"],
|
||||
}
|
||||
|
||||
@@ -374,14 +432,14 @@ func TestVendorSnapshotUse(t *testing.T) {
|
||||
stl: "none",
|
||||
system_shared_libs: [],
|
||||
static_libs: ["libvndk"],
|
||||
compile_multilib: "64",
|
||||
srcs: ["bin.cpp"],
|
||||
}
|
||||
|
||||
vendor_snapshot {
|
||||
name: "vendor_snapshot",
|
||||
compile_multilib: "first",
|
||||
version: "28",
|
||||
arch: {
|
||||
arm64: {
|
||||
vndk_libs: [
|
||||
"libvndk",
|
||||
],
|
||||
@@ -389,26 +447,54 @@ func TestVendorSnapshotUse(t *testing.T) {
|
||||
"libvendor",
|
||||
"libvendor_available",
|
||||
"libvndk",
|
||||
"lib64",
|
||||
],
|
||||
shared_libs: [
|
||||
"libvendor",
|
||||
"libvendor_available",
|
||||
"lib64",
|
||||
],
|
||||
binaries: [
|
||||
"bin",
|
||||
],
|
||||
},
|
||||
arm: {
|
||||
vndk_libs: [
|
||||
"libvndk",
|
||||
],
|
||||
static_libs: [
|
||||
"libvendor",
|
||||
"libvendor_available",
|
||||
"libvndk",
|
||||
"lib32",
|
||||
],
|
||||
shared_libs: [
|
||||
"libvendor",
|
||||
"libvendor_available",
|
||||
"lib32",
|
||||
],
|
||||
binaries: [
|
||||
"bin32",
|
||||
],
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
vendor_snapshot_static {
|
||||
name: "libvndk",
|
||||
version: "28",
|
||||
target_arch: "arm64",
|
||||
compile_multilib: "both",
|
||||
vendor: true,
|
||||
arch: {
|
||||
arm64: {
|
||||
src: "libvndk.a",
|
||||
export_include_dirs: ["include/libvndk"],
|
||||
},
|
||||
arm: {
|
||||
src: "libvndk.a",
|
||||
export_include_dirs: ["include/libvndk"],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -416,7 +502,7 @@ func TestVendorSnapshotUse(t *testing.T) {
|
||||
name: "libvendor",
|
||||
version: "28",
|
||||
target_arch: "arm64",
|
||||
compile_multilib: "64",
|
||||
compile_multilib: "both",
|
||||
vendor: true,
|
||||
shared_libs: [
|
||||
"libvendor_without_snapshot",
|
||||
@@ -428,6 +514,62 @@ func TestVendorSnapshotUse(t *testing.T) {
|
||||
src: "libvendor.so",
|
||||
export_include_dirs: ["include/libvendor"],
|
||||
},
|
||||
arm: {
|
||||
src: "libvendor.so",
|
||||
export_include_dirs: ["include/libvendor"],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
vendor_snapshot_static {
|
||||
name: "lib32",
|
||||
version: "28",
|
||||
target_arch: "arm64",
|
||||
compile_multilib: "32",
|
||||
vendor: true,
|
||||
arch: {
|
||||
arm: {
|
||||
src: "lib32.a",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
vendor_snapshot_shared {
|
||||
name: "lib32",
|
||||
version: "28",
|
||||
target_arch: "arm64",
|
||||
compile_multilib: "32",
|
||||
vendor: true,
|
||||
arch: {
|
||||
arm: {
|
||||
src: "lib32.so",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
vendor_snapshot_static {
|
||||
name: "lib64",
|
||||
version: "28",
|
||||
target_arch: "arm64",
|
||||
compile_multilib: "64",
|
||||
vendor: true,
|
||||
arch: {
|
||||
arm64: {
|
||||
src: "lib64.a",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
vendor_snapshot_shared {
|
||||
name: "lib64",
|
||||
version: "28",
|
||||
target_arch: "arm64",
|
||||
compile_multilib: "64",
|
||||
vendor: true,
|
||||
arch: {
|
||||
arm64: {
|
||||
src: "lib64.so",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -435,40 +577,53 @@ func TestVendorSnapshotUse(t *testing.T) {
|
||||
name: "libvendor",
|
||||
version: "28",
|
||||
target_arch: "arm64",
|
||||
compile_multilib: "both",
|
||||
vendor: true,
|
||||
arch: {
|
||||
arm64: {
|
||||
src: "libvendor.a",
|
||||
export_include_dirs: ["include/libvendor"],
|
||||
},
|
||||
arm: {
|
||||
src: "libvendor.a",
|
||||
export_include_dirs: ["include/libvendor"],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
vendor_snapshot_shared {
|
||||
name: "libvendor_available",
|
||||
androidmk_suffix: ".vendor",
|
||||
version: "28",
|
||||
target_arch: "arm64",
|
||||
compile_multilib: "both",
|
||||
vendor: true,
|
||||
arch: {
|
||||
arm64: {
|
||||
src: "libvendor_available.so",
|
||||
export_include_dirs: ["include/libvendor"],
|
||||
},
|
||||
arm: {
|
||||
src: "libvendor_available.so",
|
||||
export_include_dirs: ["include/libvendor"],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
vendor_snapshot_static {
|
||||
name: "libvendor_available",
|
||||
androidmk_suffix: ".vendor",
|
||||
version: "28",
|
||||
target_arch: "arm64",
|
||||
compile_multilib: "both",
|
||||
vendor: true,
|
||||
arch: {
|
||||
arm64: {
|
||||
src: "libvendor_available.a",
|
||||
export_include_dirs: ["include/libvendor"],
|
||||
},
|
||||
arm: {
|
||||
src: "libvendor_available.so",
|
||||
export_include_dirs: ["include/libvendor"],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -476,6 +631,7 @@ func TestVendorSnapshotUse(t *testing.T) {
|
||||
name: "bin",
|
||||
version: "28",
|
||||
target_arch: "arm64",
|
||||
compile_multilib: "64",
|
||||
vendor: true,
|
||||
arch: {
|
||||
arm64: {
|
||||
@@ -484,11 +640,39 @@ func TestVendorSnapshotUse(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
vendor_snapshot_binary {
|
||||
name: "bin32",
|
||||
version: "28",
|
||||
target_arch: "arm64",
|
||||
compile_multilib: "32",
|
||||
vendor: true,
|
||||
arch: {
|
||||
arm: {
|
||||
src: "bin32",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
// old snapshot module which has to be ignored
|
||||
vendor_snapshot_binary {
|
||||
name: "bin",
|
||||
version: "26",
|
||||
target_arch: "arm64",
|
||||
compile_multilib: "first",
|
||||
vendor: true,
|
||||
arch: {
|
||||
arm64: {
|
||||
src: "bin",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
// different arch snapshot which has to be ignored
|
||||
vendor_snapshot_binary {
|
||||
name: "bin",
|
||||
version: "28",
|
||||
target_arch: "arm",
|
||||
compile_multilib: "first",
|
||||
vendor: true,
|
||||
arch: {
|
||||
arm64: {
|
||||
@@ -504,6 +688,7 @@ func TestVendorSnapshotUse(t *testing.T) {
|
||||
"framework/Android.bp": []byte(frameworkBp),
|
||||
"vendor/Android.bp": []byte(vendorProprietaryBp),
|
||||
"vendor/bin": nil,
|
||||
"vendor/bin32": nil,
|
||||
"vendor/bin.cpp": nil,
|
||||
"vendor/client.cpp": nil,
|
||||
"vendor/include/libvndk/a.h": nil,
|
||||
@@ -511,6 +696,10 @@ func TestVendorSnapshotUse(t *testing.T) {
|
||||
"vendor/libvndk.a": nil,
|
||||
"vendor/libvendor.a": nil,
|
||||
"vendor/libvendor.so": nil,
|
||||
"vendor/lib32.a": nil,
|
||||
"vendor/lib32.so": nil,
|
||||
"vendor/lib64.a": nil,
|
||||
"vendor/lib64.so": nil,
|
||||
"vndk/Android.bp": []byte(vndkBp),
|
||||
"vndk/include/libvndk/a.h": nil,
|
||||
"vndk/libvndk.so": nil,
|
||||
@@ -531,6 +720,9 @@ func TestVendorSnapshotUse(t *testing.T) {
|
||||
staticVariant := "android_vendor.28_arm64_armv8-a_static"
|
||||
binaryVariant := "android_vendor.28_arm64_armv8-a"
|
||||
|
||||
shared32Variant := "android_vendor.28_arm_armv7-a-neon_shared"
|
||||
binary32Variant := "android_vendor.28_arm_armv7-a-neon"
|
||||
|
||||
// libclient uses libvndk.vndk.28.arm64, libvendor.vendor_static.28.arm64, libvendor_without_snapshot
|
||||
libclientCcFlags := ctx.ModuleForTests("libclient", sharedVariant).Rule("cc").Args["cFlags"]
|
||||
for _, includeFlags := range []string{
|
||||
@@ -556,7 +748,7 @@ func TestVendorSnapshotUse(t *testing.T) {
|
||||
}
|
||||
|
||||
libclientAndroidMkSharedLibs := ctx.ModuleForTests("libclient", sharedVariant).Module().(*Module).Properties.AndroidMkSharedLibs
|
||||
if g, w := libclientAndroidMkSharedLibs, []string{"libvndk.vendor", "libvendor_available.vendor"}; !reflect.DeepEqual(g, w) {
|
||||
if g, w := libclientAndroidMkSharedLibs, []string{"libvndk.vendor", "libvendor_available.vendor", "lib64"}; !reflect.DeepEqual(g, w) {
|
||||
t.Errorf("wanted libclient AndroidMkSharedLibs %q, got %q", w, g)
|
||||
}
|
||||
|
||||
@@ -565,6 +757,11 @@ func TestVendorSnapshotUse(t *testing.T) {
|
||||
t.Errorf("wanted libclient AndroidMkStaticLibs %q, got %q", w, g)
|
||||
}
|
||||
|
||||
libclient32AndroidMkSharedLibs := ctx.ModuleForTests("libclient", shared32Variant).Module().(*Module).Properties.AndroidMkSharedLibs
|
||||
if g, w := libclient32AndroidMkSharedLibs, []string{"libvndk.vendor", "libvendor_available.vendor", "lib32"}; !reflect.DeepEqual(g, w) {
|
||||
t.Errorf("wanted libclient32 AndroidMkSharedLibs %q, got %q", w, g)
|
||||
}
|
||||
|
||||
// bin_without_snapshot uses libvndk.vendor_static.28.arm64
|
||||
binWithoutSnapshotCcFlags := ctx.ModuleForTests("bin_without_snapshot", binaryVariant).Rule("cc").Args["cFlags"]
|
||||
if !strings.Contains(binWithoutSnapshotCcFlags, "-Ivendor/include/libvndk") {
|
||||
@@ -582,6 +779,12 @@ func TestVendorSnapshotUse(t *testing.T) {
|
||||
// libvendor.so is installed by libvendor.vendor_shared.28.arm64
|
||||
ctx.ModuleForTests("libvendor.vendor_shared.28.arm64", sharedVariant).Output("libvendor.so")
|
||||
|
||||
// lib64.so is installed by lib64.vendor_shared.28.arm64
|
||||
ctx.ModuleForTests("lib64.vendor_shared.28.arm64", sharedVariant).Output("lib64.so")
|
||||
|
||||
// lib32.so is installed by lib32.vendor_shared.28.arm64
|
||||
ctx.ModuleForTests("lib32.vendor_shared.28.arm64", shared32Variant).Output("lib32.so")
|
||||
|
||||
// libvendor_available.so is installed by libvendor_available.vendor_shared.28.arm64
|
||||
ctx.ModuleForTests("libvendor_available.vendor_shared.28.arm64", sharedVariant).Output("libvendor_available.so")
|
||||
|
||||
@@ -591,6 +794,9 @@ func TestVendorSnapshotUse(t *testing.T) {
|
||||
// bin is installed by bin.vendor_binary.28.arm64
|
||||
ctx.ModuleForTests("bin.vendor_binary.28.arm64", binaryVariant).Output("bin")
|
||||
|
||||
// bin32 is installed by bin32.vendor_binary.28.arm64
|
||||
ctx.ModuleForTests("bin32.vendor_binary.28.arm64", binary32Variant).Output("bin32")
|
||||
|
||||
// bin_without_snapshot is installed by bin_without_snapshot
|
||||
ctx.ModuleForTests("bin_without_snapshot", binaryVariant).Output("bin_without_snapshot")
|
||||
|
||||
|
Reference in New Issue
Block a user