Merge "Fix inconsistencies in the apex names used for the apex variations." am: f46e95899b am: 28bbdf23f7

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1748294

Change-Id: I930769a7d48eedace77d12cf51f1e50ebb874cbb
This commit is contained in:
Treehugger Robot
2021-06-25 23:33:49 +00:00
committed by Automerger Merge Worker
3 changed files with 90 additions and 22 deletions

View File

@@ -3925,13 +3925,13 @@ func TestApexName(t *testing.T) {
}
`)
module := ctx.ModuleForTests("myapex", "android_common_myapex_image")
module := ctx.ModuleForTests("myapex", "android_common_com.android.myapex_image")
apexManifestRule := module.Rule("apexManifestRule")
ensureContains(t, apexManifestRule.Args["opt"], "-v name com.android.myapex")
apexRule := module.Rule("apexRule")
ensureContains(t, apexRule.Args["opt_flags"], "--do_not_check_keyname")
apexBundle := ctx.ModuleForTests("myapex", "android_common_myapex_image").Module().(*apexBundle)
apexBundle := module.Module().(*apexBundle)
data := android.AndroidMkDataForTest(t, ctx, apexBundle)
name := apexBundle.BaseModuleName()
prefix := "TARGET_"
@@ -4474,6 +4474,59 @@ func TestPrebuiltOverrides(t *testing.T) {
}
}
func TestPrebuiltApexName(t *testing.T) {
testApex(t, `
prebuilt_apex {
name: "com.company.android.myapex",
apex_name: "com.android.myapex",
src: "company-myapex-arm.apex",
}
`).ModuleForTests("com.company.android.myapex", "android_common_com.android.myapex")
testApex(t, `
apex_set {
name: "com.company.android.myapex",
apex_name: "com.android.myapex",
set: "company-myapex.apks",
}
`).ModuleForTests("com.company.android.myapex", "android_common_com.android.myapex")
}
func TestPrebuiltApexNameWithPlatformBootclasspath(t *testing.T) {
_ = android.GroupFixturePreparers(
java.PrepareForTestWithJavaDefaultModules,
PrepareForTestWithApexBuildComponents,
android.FixtureWithRootAndroidBp(`
platform_bootclasspath {
name: "platform-bootclasspath",
fragments: [
{
apex: "com.android.art",
module: "art-bootclasspath-fragment",
},
],
}
prebuilt_apex {
name: "com.company.android.art",
apex_name: "com.android.art",
src: "com.company.android.art-arm.apex",
exported_bootclasspath_fragments: ["art-bootclasspath-fragment"],
}
prebuilt_bootclasspath_fragment {
name: "art-bootclasspath-fragment",
contents: ["core-oj"],
}
java_import {
name: "core-oj",
jars: ["prebuilt.jar"],
}
`),
).RunTest(t)
}
// These tests verify that the prebuilt_apex/deapexer to java_import wiring allows for the
// propagation of paths to dex implementation jars from the former to the latter.
func TestPrebuiltExportDexImplementationJars(t *testing.T) {