Add an apex_contributions_defaults module to module sdk

This metadata module will contain a flattened list of all the soong
modules contributed by this module to the rest of the build. This is
supported in V and above.

Bug: 326246905
Test: m art-module-host-exports
Test: unzip -p out/soong/mainline-sdks/art-module-host-exports-current.zip Android.bp | grep -A 15 apex_contributions_defaults
apex_contributions_defaults {
    name: "art-module-host-exports.contributions",
    contents: [
        "prebuilt_art.module.api.annotations",
        "prebuilt_dex2oat",
        "prebuilt_dex2oatd",
        "prebuilt_dexdump",
        "prebuilt_hiddenapi",
        "prebuilt_oatdump",
        "prebuilt_profman",
        "prebuilt_veridex",
        "prebuilt_libartpalette",
        "prebuilt_libartbase",
    ],
}

Change-Id: Iba43a9da5430adfc0a5fd9b5dc27b5d89c5eacb8
This commit is contained in:
Spandan Das
2024-03-06 14:04:36 +00:00
parent 159b264873
commit a5e26d3cd6
11 changed files with 432 additions and 0 deletions

View File

@@ -108,6 +108,11 @@ func TestSnapshotWithJavaHeaderLibrary(t *testing.T) {
checkAndroidBpContents(`
// This is auto-generated. DO NOT EDIT.
apex_contributions_defaults {
name: "mysdk.contributions",
contents: ["prebuilt_myjavalib"],
}
java_import {
name: "myjavalib",
prefer: false,
@@ -154,6 +159,11 @@ func TestHostSnapshotWithJavaHeaderLibrary(t *testing.T) {
checkAndroidBpContents(`
// This is auto-generated. DO NOT EDIT.
apex_contributions_defaults {
name: "mysdk.contributions",
contents: ["prebuilt_myjavalib"],
}
java_import {
name: "myjavalib",
prefer: false,
@@ -193,6 +203,11 @@ func TestDeviceAndHostSnapshotWithJavaHeaderLibrary(t *testing.T) {
checkAndroidBpContents(`
// This is auto-generated. DO NOT EDIT.
apex_contributions_defaults {
name: "mysdk.contributions",
contents: ["prebuilt_myjavalib"],
}
java_import {
name: "myjavalib",
prefer: false,
@@ -245,6 +260,11 @@ func TestSnapshotWithJavaImplLibrary(t *testing.T) {
checkAndroidBpContents(`
// This is auto-generated. DO NOT EDIT.
apex_contributions_defaults {
name: "myexports.contributions",
contents: ["prebuilt_myjavalib"],
}
java_import {
name: "myjavalib",
prefer: false,
@@ -291,6 +311,11 @@ func TestSnapshotWithJavaBootLibrary(t *testing.T) {
checkAndroidBpContents(`
// This is auto-generated. DO NOT EDIT.
apex_contributions_defaults {
name: "mysdk.contributions",
contents: [],
}
java_import {
name: "myjavalib",
prefer: false,
@@ -313,6 +338,9 @@ func TestSnapshotWithJavaBootLibrary_UpdatableMedia(t *testing.T) {
android.FixtureMergeEnv(map[string]string{
"SOONG_SDK_SNAPSHOT_TARGET_BUILD_RELEASE": targetBuildRelease,
}),
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
variables.Platform_version_active_codenames = []string{"VanillaIceCream"}
}),
).RunTestWithBp(t, `
sdk {
name: "mysdk",
@@ -395,6 +423,11 @@ func TestSnapshotWithJavaLibrary_MinSdkVersion(t *testing.T) {
checkAndroidBpContents(fmt.Sprintf(`
// This is auto-generated. DO NOT EDIT.
apex_contributions_defaults {
name: "mysdk.contributions",
contents: ["prebuilt_mylib"],
}
java_import {
name: "mylib",
prefer: false,
@@ -459,6 +492,11 @@ func TestSnapshotWithJavaSystemserverLibrary(t *testing.T) {
checkAndroidBpContents(`
// This is auto-generated. DO NOT EDIT.
apex_contributions_defaults {
name: "myexports.contributions",
contents: [],
}
java_import {
name: "myjavalib",
prefer: false,
@@ -504,6 +542,11 @@ func TestHostSnapshotWithJavaImplLibrary(t *testing.T) {
checkAndroidBpContents(`
// This is auto-generated. DO NOT EDIT.
apex_contributions_defaults {
name: "myexports.contributions",
contents: ["prebuilt_myjavalib"],
}
java_import {
name: "myjavalib",
prefer: false,
@@ -542,6 +585,11 @@ func TestSnapshotWithJavaTest(t *testing.T) {
checkAndroidBpContents(`
// This is auto-generated. DO NOT EDIT.
apex_contributions_defaults {
name: "myexports.contributions",
contents: ["prebuilt_myjavatests"],
}
java_test_import {
name: "myjavatests",
prefer: false,
@@ -582,6 +630,11 @@ func TestHostSnapshotWithJavaTest(t *testing.T) {
checkAndroidBpContents(`
// This is auto-generated. DO NOT EDIT.
apex_contributions_defaults {
name: "myexports.contributions",
contents: ["prebuilt_myjavatests"],
}
java_test_import {
name: "myjavatests",
prefer: false,
@@ -661,6 +714,15 @@ func TestSnapshotWithJavaSystemModules(t *testing.T) {
checkAndroidBpContents(`
// This is auto-generated. DO NOT EDIT.
apex_contributions_defaults {
name: "mysdk.contributions",
contents: [
"prebuilt_exported-system-module",
"prebuilt_myjavalib",
"prebuilt_my-system-modules",
],
}
java_import {
name: "exported-system-module",
prefer: false,
@@ -790,6 +852,11 @@ func TestHostSnapshotWithJavaSystemModules(t *testing.T) {
checkAndroidBpContents(`
// This is auto-generated. DO NOT EDIT.
apex_contributions_defaults {
name: "mysdk.contributions",
contents: ["prebuilt_my-system-modules"],
}
java_import {
name: "mysdk_system-module",
prefer: false,
@@ -854,6 +921,15 @@ func TestDeviceAndHostSnapshotWithOsSpecificMembers(t *testing.T) {
checkAndroidBpContents(`
// This is auto-generated. DO NOT EDIT.
apex_contributions_defaults {
name: "myexports.contributions",
contents: [
"prebuilt_hostjavalib",
"prebuilt_androidjavalib",
"prebuilt_myjavalib",
],
}
java_import {
name: "hostjavalib",
prefer: false,
@@ -920,6 +996,11 @@ func TestSnapshotWithJavaSdkLibrary(t *testing.T) {
checkAndroidBpContents(`
// This is auto-generated. DO NOT EDIT.
apex_contributions_defaults {
name: "mysdk.contributions",
contents: ["prebuilt_myjavalib"],
}
java_sdk_library_import {
name: "myjavalib",
prefer: false,
@@ -993,6 +1074,11 @@ func TestSnapshotWithJavaSdkLibrary_DistStem(t *testing.T) {
checkAndroidBpContents(`
// This is auto-generated. DO NOT EDIT.
apex_contributions_defaults {
name: "mysdk.contributions",
contents: ["prebuilt_myjavalib-foo"],
}
java_sdk_library_import {
name: "myjavalib-foo",
prefer: false,
@@ -1046,6 +1132,11 @@ func TestSnapshotWithJavaSdkLibrary_UseSrcJar(t *testing.T) {
checkAndroidBpContents(`
// This is auto-generated. DO NOT EDIT.
apex_contributions_defaults {
name: "mysdk.contributions",
contents: ["prebuilt_myjavalib"],
}
java_sdk_library_import {
name: "myjavalib",
prefer: false,
@@ -1093,6 +1184,11 @@ func TestSnapshotWithJavaSdkLibrary_AnnotationsZip(t *testing.T) {
checkAndroidBpContents(`
// This is auto-generated. DO NOT EDIT.
apex_contributions_defaults {
name: "mysdk.contributions",
contents: ["prebuilt_myjavalib"],
}
java_sdk_library_import {
name: "myjavalib",
prefer: false,
@@ -1147,6 +1243,11 @@ func TestSnapshotWithJavaSdkLibrary_AnnotationsZip_PreT(t *testing.T) {
checkAndroidBpContents(`
// This is auto-generated. DO NOT EDIT.
apex_contributions_defaults {
name: "mysdk.contributions",
contents: ["prebuilt_myjavalib"],
}
java_sdk_library_import {
name: "myjavalib",
prefer: false,
@@ -1204,6 +1305,11 @@ func TestSnapshotWithJavaSdkLibrary_CompileDex(t *testing.T) {
checkAndroidBpContents(`
// This is auto-generated. DO NOT EDIT.
apex_contributions_defaults {
name: "mysdk.contributions",
contents: ["prebuilt_myjavalib"],
}
java_sdk_library_import {
name: "myjavalib",
prefer: false,
@@ -1272,6 +1378,11 @@ func TestSnapshotWithJavaSdkLibrary_SdkVersion_None(t *testing.T) {
checkAndroidBpContents(`
// This is auto-generated. DO NOT EDIT.
apex_contributions_defaults {
name: "mysdk.contributions",
contents: ["prebuilt_myjavalib"],
}
java_sdk_library_import {
name: "myjavalib",
prefer: false,
@@ -1320,6 +1431,11 @@ func TestSnapshotWithJavaSdkLibrary_SdkVersion_ForScope(t *testing.T) {
checkAndroidBpContents(`
// This is auto-generated. DO NOT EDIT.
apex_contributions_defaults {
name: "mysdk.contributions",
contents: ["prebuilt_myjavalib"],
}
java_sdk_library_import {
name: "myjavalib",
prefer: false,
@@ -1371,6 +1487,11 @@ func TestSnapshotWithJavaSdkLibrary_ApiScopes(t *testing.T) {
checkAndroidBpContents(`
// This is auto-generated. DO NOT EDIT.
apex_contributions_defaults {
name: "mysdk.contributions",
contents: ["prebuilt_myjavalib"],
}
java_sdk_library_import {
name: "myjavalib",
prefer: false,
@@ -1436,6 +1557,11 @@ func TestSnapshotWithJavaSdkLibrary_ModuleLib(t *testing.T) {
checkAndroidBpContents(`
// This is auto-generated. DO NOT EDIT.
apex_contributions_defaults {
name: "mysdk.contributions",
contents: ["prebuilt_myjavalib"],
}
java_sdk_library_import {
name: "myjavalib",
prefer: false,
@@ -1509,6 +1635,11 @@ func TestSnapshotWithJavaSdkLibrary_SystemServer(t *testing.T) {
checkAndroidBpContents(`
// This is auto-generated. DO NOT EDIT.
apex_contributions_defaults {
name: "mysdk.contributions",
contents: ["prebuilt_myjavalib"],
}
java_sdk_library_import {
name: "myjavalib",
prefer: false,
@@ -1569,6 +1700,11 @@ func TestSnapshotWithJavaSdkLibrary_NamingScheme(t *testing.T) {
checkAndroidBpContents(`
// This is auto-generated. DO NOT EDIT.
apex_contributions_defaults {
name: "mysdk.contributions",
contents: ["prebuilt_myjavalib"],
}
java_sdk_library_import {
name: "myjavalib",
prefer: false,
@@ -1626,6 +1762,11 @@ func TestSnapshotWithJavaSdkLibrary_DoctagFiles(t *testing.T) {
checkAndroidBpContents(`
// This is auto-generated. DO NOT EDIT.
apex_contributions_defaults {
name: "mysdk.contributions",
contents: ["prebuilt_myjavalib"],
}
java_sdk_library_import {
name: "myjavalib",
prefer: false,