Merge changes Ifd2858dd,I2585dd99,I65e7a456 am: 0c6f111d7b
am: d6b1515935
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1348951 Change-Id: Idcc16a40f953019278ea34829ca297a353da0820
This commit is contained in:
@@ -58,7 +58,7 @@ type AndroidMkData struct {
|
|||||||
|
|
||||||
Extra []AndroidMkExtraFunc
|
Extra []AndroidMkExtraFunc
|
||||||
|
|
||||||
preamble bytes.Buffer
|
Entries AndroidMkEntries
|
||||||
}
|
}
|
||||||
|
|
||||||
type AndroidMkExtraFunc func(w io.Writer, outputFile Path)
|
type AndroidMkExtraFunc func(w io.Writer, outputFile Path)
|
||||||
@@ -483,7 +483,7 @@ func translateGoBinaryModule(ctx SingletonContext, w io.Writer, mod blueprint.Mo
|
|||||||
|
|
||||||
func (data *AndroidMkData) fillInData(config Config, bpPath string, mod blueprint.Module) {
|
func (data *AndroidMkData) fillInData(config Config, bpPath string, mod blueprint.Module) {
|
||||||
// Get the preamble content through AndroidMkEntries logic.
|
// Get the preamble content through AndroidMkEntries logic.
|
||||||
entries := AndroidMkEntries{
|
data.Entries = AndroidMkEntries{
|
||||||
Class: data.Class,
|
Class: data.Class,
|
||||||
SubName: data.SubName,
|
SubName: data.SubName,
|
||||||
DistFiles: data.DistFiles,
|
DistFiles: data.DistFiles,
|
||||||
@@ -494,16 +494,12 @@ func (data *AndroidMkData) fillInData(config Config, bpPath string, mod blueprin
|
|||||||
Host_required: data.Host_required,
|
Host_required: data.Host_required,
|
||||||
Target_required: data.Target_required,
|
Target_required: data.Target_required,
|
||||||
}
|
}
|
||||||
entries.fillInEntries(config, bpPath, mod)
|
data.Entries.fillInEntries(config, bpPath, mod)
|
||||||
|
|
||||||
// preamble doesn't need the footer content.
|
|
||||||
entries.footer = bytes.Buffer{}
|
|
||||||
entries.write(&data.preamble)
|
|
||||||
|
|
||||||
// copy entries back to data since it is used in Custom
|
// copy entries back to data since it is used in Custom
|
||||||
data.Required = entries.Required
|
data.Required = data.Entries.Required
|
||||||
data.Host_required = entries.Host_required
|
data.Host_required = data.Entries.Host_required
|
||||||
data.Target_required = entries.Target_required
|
data.Target_required = data.Entries.Target_required
|
||||||
}
|
}
|
||||||
|
|
||||||
func translateAndroidModule(ctx SingletonContext, w io.Writer, mod blueprint.Module,
|
func translateAndroidModule(ctx SingletonContext, w io.Writer, mod blueprint.Module,
|
||||||
@@ -559,7 +555,9 @@ func WriteAndroidMkData(w io.Writer, data AndroidMkData) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
w.Write(data.preamble.Bytes())
|
// write preamble via Entries
|
||||||
|
data.Entries.footer = bytes.Buffer{}
|
||||||
|
data.Entries.write(w)
|
||||||
|
|
||||||
for _, extra := range data.Extra {
|
for _, extra := range data.Extra {
|
||||||
extra(w, data.OutputFile.Path())
|
extra(w, data.OutputFile.Path())
|
||||||
|
@@ -33,14 +33,7 @@ func (a *apexBundle) AndroidMk() android.AndroidMkData {
|
|||||||
Disabled: true,
|
Disabled: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
writers := []android.AndroidMkData{}
|
return a.androidMkForType()
|
||||||
writers = append(writers, a.androidMkForType())
|
|
||||||
return android.AndroidMkData{
|
|
||||||
Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) {
|
|
||||||
for _, data := range writers {
|
|
||||||
data.Custom(w, name, prefix, moduleDir, data)
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *apexBundle) androidMkForFiles(w io.Writer, apexBundleName, apexName, moduleDir string) []string {
|
func (a *apexBundle) androidMkForFiles(w io.Writer, apexBundleName, apexName, moduleDir string) []string {
|
||||||
@@ -308,6 +301,20 @@ func (a *apexBundle) androidMkForType() android.AndroidMkData {
|
|||||||
fmt.Fprintln(w, "LOCAL_MODULE_PATH :=", a.installDir.ToMakePath().String())
|
fmt.Fprintln(w, "LOCAL_MODULE_PATH :=", a.installDir.ToMakePath().String())
|
||||||
fmt.Fprintln(w, "LOCAL_MODULE_STEM :=", name+apexType.suffix())
|
fmt.Fprintln(w, "LOCAL_MODULE_STEM :=", name+apexType.suffix())
|
||||||
fmt.Fprintln(w, "LOCAL_UNINSTALLABLE_MODULE :=", !a.installable())
|
fmt.Fprintln(w, "LOCAL_UNINSTALLABLE_MODULE :=", !a.installable())
|
||||||
|
|
||||||
|
// Because apex writes .mk with Custom(), we need to write manually some common properties
|
||||||
|
// which are available via data.Entries
|
||||||
|
commonProperties := []string{
|
||||||
|
"LOCAL_INIT_RC", "LOCAL_VINTF_FRAGMENTS",
|
||||||
|
"LOCAL_PROPRIETARY_MODULE", "LOCAL_VENDOR_MODULE", "LOCAL_ODM_MODULE", "LOCAL_PRODUCT_MODULE", "LOCAL_SYSTEM_EXT_MODULE",
|
||||||
|
"LOCAL_MODULE_OWNER",
|
||||||
|
}
|
||||||
|
for _, name := range commonProperties {
|
||||||
|
if value, ok := data.Entries.EntryMap[name]; ok {
|
||||||
|
fmt.Fprintln(w, name+" := "+strings.Join(value, " "))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if len(a.overridableProperties.Overrides) > 0 {
|
if len(a.overridableProperties.Overrides) > 0 {
|
||||||
fmt.Fprintln(w, "LOCAL_OVERRIDES_MODULES :=", strings.Join(a.overridableProperties.Overrides, " "))
|
fmt.Fprintln(w, "LOCAL_OVERRIDES_MODULES :=", strings.Join(a.overridableProperties.Overrides, " "))
|
||||||
}
|
}
|
||||||
|
76
apex/apex.go
76
apex/apex.go
@@ -1431,6 +1431,7 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) {
|
|||||||
|
|
||||||
targets := ctx.MultiTargets()
|
targets := ctx.MultiTargets()
|
||||||
config := ctx.DeviceConfig()
|
config := ctx.DeviceConfig()
|
||||||
|
imageVariation := a.getImageVariation(ctx)
|
||||||
|
|
||||||
a.combineProperties(ctx)
|
a.combineProperties(ctx)
|
||||||
|
|
||||||
@@ -1450,13 +1451,13 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) {
|
|||||||
Jni_libs: a.properties.Jni_libs,
|
Jni_libs: a.properties.Jni_libs,
|
||||||
Binaries: nil,
|
Binaries: nil,
|
||||||
},
|
},
|
||||||
target, a.getImageVariation(config))
|
target, imageVariation)
|
||||||
|
|
||||||
// Add native modules targetting both ABIs
|
// Add native modules targetting both ABIs
|
||||||
addDependenciesForNativeModules(ctx,
|
addDependenciesForNativeModules(ctx,
|
||||||
a.properties.Multilib.Both,
|
a.properties.Multilib.Both,
|
||||||
target,
|
target,
|
||||||
a.getImageVariation(config))
|
imageVariation)
|
||||||
|
|
||||||
isPrimaryAbi := i == 0
|
isPrimaryAbi := i == 0
|
||||||
if isPrimaryAbi {
|
if isPrimaryAbi {
|
||||||
@@ -1469,13 +1470,13 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) {
|
|||||||
Jni_libs: nil,
|
Jni_libs: nil,
|
||||||
Binaries: a.properties.Binaries,
|
Binaries: a.properties.Binaries,
|
||||||
},
|
},
|
||||||
target, a.getImageVariation(config))
|
target, imageVariation)
|
||||||
|
|
||||||
// Add native modules targetting the first ABI
|
// Add native modules targetting the first ABI
|
||||||
addDependenciesForNativeModules(ctx,
|
addDependenciesForNativeModules(ctx,
|
||||||
a.properties.Multilib.First,
|
a.properties.Multilib.First,
|
||||||
target,
|
target,
|
||||||
a.getImageVariation(config))
|
imageVariation)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch target.Arch.ArchType.Multilib {
|
switch target.Arch.ArchType.Multilib {
|
||||||
@@ -1484,24 +1485,24 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) {
|
|||||||
addDependenciesForNativeModules(ctx,
|
addDependenciesForNativeModules(ctx,
|
||||||
a.properties.Multilib.Lib32,
|
a.properties.Multilib.Lib32,
|
||||||
target,
|
target,
|
||||||
a.getImageVariation(config))
|
imageVariation)
|
||||||
|
|
||||||
addDependenciesForNativeModules(ctx,
|
addDependenciesForNativeModules(ctx,
|
||||||
a.properties.Multilib.Prefer32,
|
a.properties.Multilib.Prefer32,
|
||||||
target,
|
target,
|
||||||
a.getImageVariation(config))
|
imageVariation)
|
||||||
case "lib64":
|
case "lib64":
|
||||||
// Add native modules targetting 64-bit ABI
|
// Add native modules targetting 64-bit ABI
|
||||||
addDependenciesForNativeModules(ctx,
|
addDependenciesForNativeModules(ctx,
|
||||||
a.properties.Multilib.Lib64,
|
a.properties.Multilib.Lib64,
|
||||||
target,
|
target,
|
||||||
a.getImageVariation(config))
|
imageVariation)
|
||||||
|
|
||||||
if !has32BitTarget {
|
if !has32BitTarget {
|
||||||
addDependenciesForNativeModules(ctx,
|
addDependenciesForNativeModules(ctx,
|
||||||
a.properties.Multilib.Prefer32,
|
a.properties.Multilib.Prefer32,
|
||||||
target,
|
target,
|
||||||
a.getImageVariation(config))
|
imageVariation)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1603,15 +1604,33 @@ func (a *apexBundle) testOnlyShouldSkipPayloadSign() bool {
|
|||||||
return proptools.Bool(a.properties.Test_only_unsigned_payload)
|
return proptools.Bool(a.properties.Test_only_unsigned_payload)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *apexBundle) getImageVariation(config android.DeviceConfig) string {
|
func (a *apexBundle) getImageVariation(ctx android.BottomUpMutatorContext) string {
|
||||||
|
deviceConfig := ctx.DeviceConfig()
|
||||||
if a.vndkApex {
|
if a.vndkApex {
|
||||||
return cc.VendorVariationPrefix + a.vndkVersion(config)
|
return cc.VendorVariationPrefix + a.vndkVersion(deviceConfig)
|
||||||
}
|
}
|
||||||
if config.VndkVersion() != "" && proptools.Bool(a.properties.Use_vendor) {
|
|
||||||
return cc.VendorVariationPrefix + config.PlatformVndkVersion()
|
var prefix string
|
||||||
} else {
|
var vndkVersion string
|
||||||
return android.CoreVariation
|
if deviceConfig.VndkVersion() != "" {
|
||||||
|
if proptools.Bool(a.properties.Use_vendor) {
|
||||||
|
prefix = cc.VendorVariationPrefix
|
||||||
|
vndkVersion = deviceConfig.PlatformVndkVersion()
|
||||||
|
} else if a.SocSpecific() || a.DeviceSpecific() {
|
||||||
|
prefix = cc.VendorVariationPrefix
|
||||||
|
vndkVersion = deviceConfig.VndkVersion()
|
||||||
|
} else if a.ProductSpecific() {
|
||||||
|
prefix = cc.ProductVariationPrefix
|
||||||
|
vndkVersion = deviceConfig.ProductVndkVersion()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if vndkVersion == "current" {
|
||||||
|
vndkVersion = deviceConfig.PlatformVndkVersion()
|
||||||
|
}
|
||||||
|
if vndkVersion != "" {
|
||||||
|
return prefix + vndkVersion
|
||||||
|
}
|
||||||
|
return android.CoreVariation
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *apexBundle) EnableSanitizer(sanitizerName string) {
|
func (a *apexBundle) EnableSanitizer(sanitizerName string) {
|
||||||
@@ -1643,7 +1662,7 @@ func (a *apexBundle) AddSanitizerDependencies(ctx android.BottomUpMutatorContext
|
|||||||
for _, target := range ctx.MultiTargets() {
|
for _, target := range ctx.MultiTargets() {
|
||||||
if target.Arch.ArchType.Multilib == "lib64" {
|
if target.Arch.ArchType.Multilib == "lib64" {
|
||||||
ctx.AddFarVariationDependencies(append(target.Variations(), []blueprint.Variation{
|
ctx.AddFarVariationDependencies(append(target.Variations(), []blueprint.Variation{
|
||||||
{Mutator: "image", Variation: a.getImageVariation(ctx.DeviceConfig())},
|
{Mutator: "image", Variation: a.getImageVariation(ctx)},
|
||||||
{Mutator: "link", Variation: "shared"},
|
{Mutator: "link", Variation: "shared"},
|
||||||
{Mutator: "version", Variation: ""}, // "" is the non-stub variant
|
{Mutator: "version", Variation: ""}, // "" is the non-stub variant
|
||||||
}...), sharedLibTag, "libclang_rt.hwasan-aarch64-android")
|
}...), sharedLibTag, "libclang_rt.hwasan-aarch64-android")
|
||||||
@@ -1887,6 +1906,12 @@ func (a *apexBundle) checkApexAvailability(ctx android.ModuleContext) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Because APEXes targeting other than system/system_ext partitions
|
||||||
|
// can't set apex_available, we skip checks for these APEXes
|
||||||
|
if ctx.SocSpecific() || ctx.DeviceSpecific() || ctx.ProductSpecific() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Coverage build adds additional dependencies for the coverage-only runtime libraries.
|
// Coverage build adds additional dependencies for the coverage-only runtime libraries.
|
||||||
// Requiring them and their transitive depencies with apex_available is not right
|
// Requiring them and their transitive depencies with apex_available is not right
|
||||||
// because they just add noise.
|
// because they just add noise.
|
||||||
@@ -2194,7 +2219,7 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
|||||||
}
|
}
|
||||||
af := apexFileForNativeLibrary(ctx, cc, handleSpecialLibs)
|
af := apexFileForNativeLibrary(ctx, cc, handleSpecialLibs)
|
||||||
af.transitiveDep = true
|
af.transitiveDep = true
|
||||||
if !a.Host() && !android.DirectlyInApex(ctx.ModuleName(), ctx.OtherModuleName(cc)) && (cc.IsStubs() || cc.HasStubsVariants()) {
|
if !a.Host() && !android.DirectlyInApex(ctx.ModuleName(), depName) && (cc.IsStubs() || cc.HasStubsVariants()) {
|
||||||
// If the dependency is a stubs lib, don't include it in this APEX,
|
// If the dependency is a stubs lib, don't include it in this APEX,
|
||||||
// but make sure that the lib is installed on the device.
|
// but make sure that the lib is installed on the device.
|
||||||
// In case no APEX is having the lib, the lib is installed to the system
|
// In case no APEX is having the lib, the lib is installed to the system
|
||||||
@@ -2202,8 +2227,17 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
|||||||
//
|
//
|
||||||
// Always include if we are a host-apex however since those won't have any
|
// Always include if we are a host-apex however since those won't have any
|
||||||
// system libraries.
|
// system libraries.
|
||||||
if !android.DirectlyInAnyApex(ctx, cc.Name()) && !android.InList(cc.BaseModuleName(), a.requiredDeps) {
|
if !android.DirectlyInAnyApex(ctx, depName) {
|
||||||
a.requiredDeps = append(a.requiredDeps, cc.BaseModuleName())
|
// we need a module name for Make
|
||||||
|
name := cc.BaseModuleName() + cc.Properties.SubName
|
||||||
|
if proptools.Bool(a.properties.Use_vendor) {
|
||||||
|
// we don't use subName(.vendor) for a "use_vendor: true" apex
|
||||||
|
// which is supposed to be installed in /system
|
||||||
|
name = cc.BaseModuleName()
|
||||||
|
}
|
||||||
|
if !android.InList(name, a.requiredDeps) {
|
||||||
|
a.requiredDeps = append(a.requiredDeps, name)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
requireNativeLibs = append(requireNativeLibs, af.Stem())
|
requireNativeLibs = append(requireNativeLibs, af.Stem())
|
||||||
// Don't track further
|
// Don't track further
|
||||||
@@ -2298,6 +2332,12 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
|||||||
a.installable() &&
|
a.installable() &&
|
||||||
!proptools.Bool(a.properties.Use_vendor)
|
!proptools.Bool(a.properties.Use_vendor)
|
||||||
|
|
||||||
|
// APEXes targeting other than system/system_ext partitions use vendor/product variants.
|
||||||
|
// So we can't link them to /system/lib libs which are core variants.
|
||||||
|
if a.SocSpecific() || a.DeviceSpecific() || a.ProductSpecific() {
|
||||||
|
a.linkToSystemLib = false
|
||||||
|
}
|
||||||
|
|
||||||
// We don't need the optimization for updatable APEXes, as it might give false signal
|
// We don't need the optimization for updatable APEXes, as it might give false signal
|
||||||
// to the system health when the APEXes are still bundled (b/149805758)
|
// to the system health when the APEXes are still bundled (b/149805758)
|
||||||
if a.Updatable() && a.properties.ApexType == imageApex {
|
if a.Updatable() && a.properties.ApexType == imageApex {
|
||||||
|
@@ -2105,7 +2105,7 @@ func TestUseVendor(t *testing.T) {
|
|||||||
ensureNotContains(t, inputsString, "android_arm64_armv8-a_shared_myapex/mylib2.so")
|
ensureNotContains(t, inputsString, "android_arm64_armv8-a_shared_myapex/mylib2.so")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestUseVendorRestriction(t *testing.T) {
|
func TestUseVendorNotAllowedForSystemApexes(t *testing.T) {
|
||||||
testApexError(t, `module "myapex" .*: use_vendor: not allowed`, `
|
testApexError(t, `module "myapex" .*: use_vendor: not allowed`, `
|
||||||
apex {
|
apex {
|
||||||
name: "myapex",
|
name: "myapex",
|
||||||
@@ -2161,6 +2161,141 @@ func TestUseVendorFailsIfNotVendorAvailable(t *testing.T) {
|
|||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestVendorApex(t *testing.T) {
|
||||||
|
ctx, config := testApex(t, `
|
||||||
|
apex {
|
||||||
|
name: "myapex",
|
||||||
|
key: "myapex.key",
|
||||||
|
binaries: ["mybin"],
|
||||||
|
vendor: true,
|
||||||
|
}
|
||||||
|
apex_key {
|
||||||
|
name: "myapex.key",
|
||||||
|
public_key: "testkey.avbpubkey",
|
||||||
|
private_key: "testkey.pem",
|
||||||
|
}
|
||||||
|
cc_binary {
|
||||||
|
name: "mybin",
|
||||||
|
vendor: true,
|
||||||
|
shared_libs: ["libfoo"],
|
||||||
|
}
|
||||||
|
cc_library {
|
||||||
|
name: "libfoo",
|
||||||
|
proprietary: true,
|
||||||
|
}
|
||||||
|
`)
|
||||||
|
|
||||||
|
ensureExactContents(t, ctx, "myapex", "android_common_myapex_image", []string{
|
||||||
|
"bin/mybin",
|
||||||
|
"lib64/libfoo.so",
|
||||||
|
// TODO(b/159195575): Add an option to use VNDK libs from VNDK APEX
|
||||||
|
"lib64/libc++.so",
|
||||||
|
})
|
||||||
|
|
||||||
|
apexBundle := ctx.ModuleForTests("myapex", "android_common_myapex_image").Module().(*apexBundle)
|
||||||
|
data := android.AndroidMkDataForTest(t, config, "", apexBundle)
|
||||||
|
name := apexBundle.BaseModuleName()
|
||||||
|
prefix := "TARGET_"
|
||||||
|
var builder strings.Builder
|
||||||
|
data.Custom(&builder, name, prefix, "", data)
|
||||||
|
androidMk := builder.String()
|
||||||
|
ensureContains(t, androidMk, `LOCAL_MODULE_PATH := /tmp/target/product/test_device/vendor/apex`)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestAndroidMk_UseVendorRequired(t *testing.T) {
|
||||||
|
ctx, config := testApex(t, `
|
||||||
|
apex {
|
||||||
|
name: "myapex",
|
||||||
|
key: "myapex.key",
|
||||||
|
use_vendor: true,
|
||||||
|
native_shared_libs: ["mylib"],
|
||||||
|
}
|
||||||
|
|
||||||
|
apex_key {
|
||||||
|
name: "myapex.key",
|
||||||
|
public_key: "testkey.avbpubkey",
|
||||||
|
private_key: "testkey.pem",
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_library {
|
||||||
|
name: "mylib",
|
||||||
|
vendor_available: true,
|
||||||
|
apex_available: ["myapex"],
|
||||||
|
}
|
||||||
|
`, func(fs map[string][]byte, config android.Config) {
|
||||||
|
setUseVendorAllowListForTest(config, []string{"myapex"})
|
||||||
|
})
|
||||||
|
|
||||||
|
apexBundle := ctx.ModuleForTests("myapex", "android_common_myapex_image").Module().(*apexBundle)
|
||||||
|
data := android.AndroidMkDataForTest(t, config, "", apexBundle)
|
||||||
|
name := apexBundle.BaseModuleName()
|
||||||
|
prefix := "TARGET_"
|
||||||
|
var builder strings.Builder
|
||||||
|
data.Custom(&builder, name, prefix, "", data)
|
||||||
|
androidMk := builder.String()
|
||||||
|
ensureContains(t, androidMk, "LOCAL_REQUIRED_MODULES += libc libm libdl\n")
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestAndroidMk_VendorApexRequired(t *testing.T) {
|
||||||
|
ctx, config := testApex(t, `
|
||||||
|
apex {
|
||||||
|
name: "myapex",
|
||||||
|
key: "myapex.key",
|
||||||
|
vendor: true,
|
||||||
|
native_shared_libs: ["mylib"],
|
||||||
|
}
|
||||||
|
|
||||||
|
apex_key {
|
||||||
|
name: "myapex.key",
|
||||||
|
public_key: "testkey.avbpubkey",
|
||||||
|
private_key: "testkey.pem",
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_library {
|
||||||
|
name: "mylib",
|
||||||
|
vendor_available: true,
|
||||||
|
}
|
||||||
|
`)
|
||||||
|
|
||||||
|
apexBundle := ctx.ModuleForTests("myapex", "android_common_myapex_image").Module().(*apexBundle)
|
||||||
|
data := android.AndroidMkDataForTest(t, config, "", apexBundle)
|
||||||
|
name := apexBundle.BaseModuleName()
|
||||||
|
prefix := "TARGET_"
|
||||||
|
var builder strings.Builder
|
||||||
|
data.Custom(&builder, name, prefix, "", data)
|
||||||
|
androidMk := builder.String()
|
||||||
|
ensureContains(t, androidMk, "LOCAL_REQUIRED_MODULES += libc.vendor libm.vendor libdl.vendor\n")
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestAndroidMkWritesCommonProperties(t *testing.T) {
|
||||||
|
ctx, config := testApex(t, `
|
||||||
|
apex {
|
||||||
|
name: "myapex",
|
||||||
|
key: "myapex.key",
|
||||||
|
vintf_fragments: ["fragment.xml"],
|
||||||
|
init_rc: ["init.rc"],
|
||||||
|
}
|
||||||
|
apex_key {
|
||||||
|
name: "myapex.key",
|
||||||
|
public_key: "testkey.avbpubkey",
|
||||||
|
private_key: "testkey.pem",
|
||||||
|
}
|
||||||
|
cc_binary {
|
||||||
|
name: "mybin",
|
||||||
|
}
|
||||||
|
`)
|
||||||
|
|
||||||
|
apexBundle := ctx.ModuleForTests("myapex", "android_common_myapex_image").Module().(*apexBundle)
|
||||||
|
data := android.AndroidMkDataForTest(t, config, "", apexBundle)
|
||||||
|
name := apexBundle.BaseModuleName()
|
||||||
|
prefix := "TARGET_"
|
||||||
|
var builder strings.Builder
|
||||||
|
data.Custom(&builder, name, prefix, "", data)
|
||||||
|
androidMk := builder.String()
|
||||||
|
ensureContains(t, androidMk, "LOCAL_VINTF_FRAGMENTS := fragment.xml\n")
|
||||||
|
ensureContains(t, androidMk, "LOCAL_INIT_RC := init.rc\n")
|
||||||
|
}
|
||||||
|
|
||||||
func TestStaticLinking(t *testing.T) {
|
func TestStaticLinking(t *testing.T) {
|
||||||
ctx, _ := testApex(t, `
|
ctx, _ := testApex(t, `
|
||||||
apex {
|
apex {
|
||||||
|
Reference in New Issue
Block a user