Merge "Don't add flattened files apex as dependencies of an image apex"
This commit is contained in:
@@ -339,14 +339,14 @@ func (a *apexBundle) writeRequiredModules(w io.Writer, moduleNames []string) {
|
|||||||
func (a *apexBundle) androidMkForType() android.AndroidMkData {
|
func (a *apexBundle) androidMkForType() android.AndroidMkData {
|
||||||
return android.AndroidMkData{
|
return android.AndroidMkData{
|
||||||
Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) {
|
Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) {
|
||||||
moduleNames := []string{}
|
|
||||||
apexType := a.properties.ApexType
|
apexType := a.properties.ApexType
|
||||||
if a.installable() {
|
|
||||||
apexName := proptools.StringDefault(a.properties.Apex_name, name)
|
|
||||||
moduleNames = a.androidMkForFiles(w, name, apexName, moduleDir, data)
|
|
||||||
}
|
|
||||||
|
|
||||||
if apexType == flattenedApex {
|
if apexType == flattenedApex {
|
||||||
|
var moduleNames []string = nil
|
||||||
|
if a.installable() {
|
||||||
|
apexName := proptools.StringDefault(a.properties.Apex_name, name)
|
||||||
|
moduleNames = a.androidMkForFiles(w, name, apexName, moduleDir, data)
|
||||||
|
}
|
||||||
// Only image APEXes can be flattened.
|
// Only image APEXes can be flattened.
|
||||||
fmt.Fprintln(w, "\ninclude $(CLEAR_VARS)")
|
fmt.Fprintln(w, "\ninclude $(CLEAR_VARS)")
|
||||||
fmt.Fprintln(w, "LOCAL_PATH :=", moduleDir)
|
fmt.Fprintln(w, "LOCAL_PATH :=", moduleDir)
|
||||||
@@ -390,7 +390,7 @@ func (a *apexBundle) androidMkForType() android.AndroidMkData {
|
|||||||
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, " "))
|
||||||
}
|
}
|
||||||
a.writeRequiredModules(w, moduleNames)
|
a.writeRequiredModules(w, nil)
|
||||||
|
|
||||||
fmt.Fprintln(w, "include $(BUILD_PREBUILT)")
|
fmt.Fprintln(w, "include $(BUILD_PREBUILT)")
|
||||||
|
|
||||||
|
@@ -527,7 +527,6 @@ func TestBasicApex(t *testing.T) {
|
|||||||
data.Custom(&builder, ab.BaseModuleName(), "TARGET_", "", data)
|
data.Custom(&builder, ab.BaseModuleName(), "TARGET_", "", data)
|
||||||
|
|
||||||
androidMk := builder.String()
|
androidMk := builder.String()
|
||||||
ensureContains(t, androidMk, "LOCAL_MODULE := mylib.myapex\n")
|
|
||||||
ensureNotContains(t, androidMk, "LOCAL_MODULE := mylib.com.android.myapex\n")
|
ensureNotContains(t, androidMk, "LOCAL_MODULE := mylib.com.android.myapex\n")
|
||||||
|
|
||||||
optFlags := apexRule.Args["opt_flags"]
|
optFlags := apexRule.Args["opt_flags"]
|
||||||
@@ -4126,7 +4125,6 @@ func TestApexName(t *testing.T) {
|
|||||||
var builder strings.Builder
|
var builder strings.Builder
|
||||||
data.Custom(&builder, name, prefix, "", data)
|
data.Custom(&builder, name, prefix, "", data)
|
||||||
androidMk := builder.String()
|
androidMk := builder.String()
|
||||||
ensureContains(t, androidMk, "LOCAL_MODULE := mylib.myapex\n")
|
|
||||||
ensureNotContains(t, androidMk, "LOCAL_MODULE := mylib.com.android.myapex\n")
|
ensureNotContains(t, androidMk, "LOCAL_MODULE := mylib.com.android.myapex\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5625,12 +5623,6 @@ func TestApexWithTests(t *testing.T) {
|
|||||||
var builder strings.Builder
|
var builder strings.Builder
|
||||||
data.Custom(&builder, name, prefix, "", data)
|
data.Custom(&builder, name, prefix, "", data)
|
||||||
androidMk := builder.String()
|
androidMk := builder.String()
|
||||||
ensureContains(t, androidMk, "LOCAL_MODULE := mytest.myapex\n")
|
|
||||||
ensureContains(t, androidMk, "LOCAL_MODULE := mytest1.myapex\n")
|
|
||||||
ensureContains(t, androidMk, "LOCAL_MODULE := mytest2.myapex\n")
|
|
||||||
ensureContains(t, androidMk, "LOCAL_MODULE := mytest3.myapex\n")
|
|
||||||
ensureContains(t, androidMk, "LOCAL_MODULE := apex_manifest.pb.myapex\n")
|
|
||||||
ensureContains(t, androidMk, "LOCAL_MODULE := apex_pubkey.myapex\n")
|
|
||||||
ensureContains(t, androidMk, "LOCAL_MODULE := myapex\n")
|
ensureContains(t, androidMk, "LOCAL_MODULE := myapex\n")
|
||||||
|
|
||||||
flatBundle := ctx.ModuleForTests("myapex", "android_common_myapex_flattened").Module().(*apexBundle)
|
flatBundle := ctx.ModuleForTests("myapex", "android_common_myapex_flattened").Module().(*apexBundle)
|
||||||
@@ -6457,12 +6449,6 @@ func TestOverrideApex(t *testing.T) {
|
|||||||
var builder strings.Builder
|
var builder strings.Builder
|
||||||
data.Custom(&builder, name, "TARGET_", "", data)
|
data.Custom(&builder, name, "TARGET_", "", data)
|
||||||
androidMk := builder.String()
|
androidMk := builder.String()
|
||||||
ensureContains(t, androidMk, "LOCAL_MODULE := override_app.override_myapex")
|
|
||||||
ensureContains(t, androidMk, "LOCAL_MODULE := overrideBpf.o.override_myapex")
|
|
||||||
ensureContains(t, androidMk, "LOCAL_MODULE := apex_manifest.pb.override_myapex")
|
|
||||||
ensureContains(t, androidMk, "LOCAL_MODULE := override_bcplib.override_myapex")
|
|
||||||
ensureContains(t, androidMk, "LOCAL_MODULE := override_systemserverlib.override_myapex")
|
|
||||||
ensureContains(t, androidMk, "LOCAL_MODULE := override_java_library.override_myapex")
|
|
||||||
ensureContains(t, androidMk, "LOCAL_MODULE_STEM := override_myapex.apex")
|
ensureContains(t, androidMk, "LOCAL_MODULE_STEM := override_myapex.apex")
|
||||||
ensureContains(t, androidMk, "LOCAL_OVERRIDES_MODULES := unknownapex myapex")
|
ensureContains(t, androidMk, "LOCAL_OVERRIDES_MODULES := unknownapex myapex")
|
||||||
ensureNotContains(t, androidMk, "LOCAL_MODULE := app.myapex")
|
ensureNotContains(t, androidMk, "LOCAL_MODULE := app.myapex")
|
||||||
@@ -7192,17 +7178,17 @@ func TestSymlinksFromApexToSystemRequiredModuleNames(t *testing.T) {
|
|||||||
}
|
}
|
||||||
`)
|
`)
|
||||||
|
|
||||||
apexBundle := ctx.ModuleForTests("myapex", "android_common_myapex_image").Module().(*apexBundle)
|
apexBundle := ctx.ModuleForTests("myapex", "android_common_myapex_flattened").Module().(*apexBundle)
|
||||||
data := android.AndroidMkDataForTest(t, ctx, apexBundle)
|
data := android.AndroidMkDataForTest(t, ctx, apexBundle)
|
||||||
var builder strings.Builder
|
var builder strings.Builder
|
||||||
data.Custom(&builder, apexBundle.BaseModuleName(), "TARGET_", "", data)
|
data.Custom(&builder, apexBundle.BaseModuleName(), "TARGET_", "", data)
|
||||||
androidMk := builder.String()
|
androidMk := builder.String()
|
||||||
// `myotherlib` is added to `myapex` as symlink
|
// `myotherlib` is added to `myapex` as symlink
|
||||||
ensureContains(t, androidMk, "LOCAL_MODULE := mylib.myapex\n")
|
ensureContains(t, androidMk, "LOCAL_MODULE := mylib.myapex.flattened\n")
|
||||||
ensureNotContains(t, androidMk, "LOCAL_MODULE := prebuilt_myotherlib.myapex\n")
|
ensureNotContains(t, androidMk, "LOCAL_MODULE := prebuilt_myotherlib.myapex\n")
|
||||||
ensureNotContains(t, androidMk, "LOCAL_MODULE := myotherlib.myapex\n")
|
ensureNotContains(t, androidMk, "LOCAL_MODULE := myotherlib.myapex\n")
|
||||||
// `myapex` should have `myotherlib` in its required line, not `prebuilt_myotherlib`
|
// `myapex` should have `myotherlib` in its required line, not `prebuilt_myotherlib`
|
||||||
ensureContains(t, androidMk, "LOCAL_REQUIRED_MODULES += mylib.myapex:64 myotherlib:64 apex_manifest.pb.myapex apex_pubkey.myapex\n")
|
ensureContains(t, androidMk, "LOCAL_REQUIRED_MODULES += mylib.myapex.flattened:64 myotherlib:64 apex_manifest.pb.myapex.flattened apex_pubkey.myapex.flattened\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestApexWithJniLibs(t *testing.T) {
|
func TestApexWithJniLibs(t *testing.T) {
|
||||||
|
Reference in New Issue
Block a user