|
|
|
@@ -5049,6 +5049,20 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
|
|
|
|
|
// Make sure that the frameworks/base/Android.bp file exists as otherwise hidden API encoding
|
|
|
|
|
// is disabled.
|
|
|
|
|
android.FixtureAddTextFile("frameworks/base/Android.bp", ""),
|
|
|
|
|
|
|
|
|
|
// Make sure that we have atleast one platform library so that we can check the monolithic hiddenapi
|
|
|
|
|
// file creation.
|
|
|
|
|
java.FixtureConfigureBootJars("platform:foo"),
|
|
|
|
|
android.FixtureModifyMockFS(func(fs android.MockFS) {
|
|
|
|
|
fs["platform/Android.bp"] = []byte(`
|
|
|
|
|
java_library {
|
|
|
|
|
name: "foo",
|
|
|
|
|
srcs: ["Test.java"],
|
|
|
|
|
compile_dex: true,
|
|
|
|
|
}
|
|
|
|
|
`)
|
|
|
|
|
fs["platform/Test.java"] = nil
|
|
|
|
|
}),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
checkBootDexJarPath := func(t *testing.T, ctx *android.TestContext, stem string, bootDexJarPath string) {
|
|
|
|
@@ -5143,7 +5157,7 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
|
|
|
|
|
checkBootDexJarPath(t, ctx, "libbar", "out/soong/.intermediates/prebuilt_myapex.deapexer/android_common/deapexer/javalib/libbar.jar")
|
|
|
|
|
|
|
|
|
|
// Verify the correct module jars contribute to the hiddenapi index file.
|
|
|
|
|
checkHiddenAPIIndexFromClassesInputs(t, ctx, ``)
|
|
|
|
|
checkHiddenAPIIndexFromClassesInputs(t, ctx, `out/soong/.intermediates/platform/foo/android_common/javac/foo.jar`)
|
|
|
|
|
checkHiddenAPIIndexFromFlagsInputs(t, ctx, `
|
|
|
|
|
my-bootclasspath-fragment/index.csv
|
|
|
|
|
out/soong/.intermediates/frameworks/base/boot/platform-bootclasspath/android_common/hiddenapi-monolithic/index-from-classes.csv
|
|
|
|
@@ -5221,7 +5235,7 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
|
|
|
|
|
checkBootDexJarPath(t, ctx, "libbar", "out/soong/.intermediates/prebuilt_myapex.deapexer/android_common/deapexer/javalib/libbar.jar")
|
|
|
|
|
|
|
|
|
|
// Verify the correct module jars contribute to the hiddenapi index file.
|
|
|
|
|
checkHiddenAPIIndexFromClassesInputs(t, ctx, ``)
|
|
|
|
|
checkHiddenAPIIndexFromClassesInputs(t, ctx, `out/soong/.intermediates/platform/foo/android_common/javac/foo.jar`)
|
|
|
|
|
checkHiddenAPIIndexFromFlagsInputs(t, ctx, `
|
|
|
|
|
my-bootclasspath-fragment/index.csv
|
|
|
|
|
out/soong/.intermediates/frameworks/base/boot/platform-bootclasspath/android_common/hiddenapi-monolithic/index-from-classes.csv
|
|
|
|
@@ -5410,7 +5424,7 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
|
|
|
|
|
checkBootDexJarPath(t, ctx, "libbar", "out/soong/.intermediates/prebuilt_myapex.deapexer/android_common/deapexer/javalib/libbar.jar")
|
|
|
|
|
|
|
|
|
|
// Verify the correct module jars contribute to the hiddenapi index file.
|
|
|
|
|
checkHiddenAPIIndexFromClassesInputs(t, ctx, ``)
|
|
|
|
|
checkHiddenAPIIndexFromClassesInputs(t, ctx, `out/soong/.intermediates/platform/foo/android_common/javac/foo.jar`)
|
|
|
|
|
checkHiddenAPIIndexFromFlagsInputs(t, ctx, `
|
|
|
|
|
my-bootclasspath-fragment/index.csv
|
|
|
|
|
out/soong/.intermediates/frameworks/base/boot/platform-bootclasspath/android_common/hiddenapi-monolithic/index-from-classes.csv
|
|
|
|
@@ -5507,7 +5521,7 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
|
|
|
|
|
checkBootDexJarPath(t, ctx, "libbar", "out/soong/.intermediates/my-bootclasspath-fragment/android_common_myapex/hiddenapi-modular/encoded/libbar.jar")
|
|
|
|
|
|
|
|
|
|
// Verify the correct module jars contribute to the hiddenapi index file.
|
|
|
|
|
checkHiddenAPIIndexFromClassesInputs(t, ctx, ``)
|
|
|
|
|
checkHiddenAPIIndexFromClassesInputs(t, ctx, `out/soong/.intermediates/platform/foo/android_common/javac/foo.jar`)
|
|
|
|
|
checkHiddenAPIIndexFromFlagsInputs(t, ctx, `
|
|
|
|
|
out/soong/.intermediates/frameworks/base/boot/platform-bootclasspath/android_common/hiddenapi-monolithic/index-from-classes.csv
|
|
|
|
|
out/soong/.intermediates/my-bootclasspath-fragment/android_common_myapex/modular-hiddenapi/index.csv
|
|
|
|
@@ -5620,7 +5634,7 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
|
|
|
|
|
checkBootDexJarPath(t, ctx, "libbar", "out/soong/.intermediates/prebuilt_myapex.deapexer/android_common/deapexer/javalib/libbar.jar")
|
|
|
|
|
|
|
|
|
|
// Verify the correct module jars contribute to the hiddenapi index file.
|
|
|
|
|
checkHiddenAPIIndexFromClassesInputs(t, ctx, ``)
|
|
|
|
|
checkHiddenAPIIndexFromClassesInputs(t, ctx, `out/soong/.intermediates/platform/foo/android_common/javac/foo.jar`)
|
|
|
|
|
checkHiddenAPIIndexFromFlagsInputs(t, ctx, `
|
|
|
|
|
my-bootclasspath-fragment/index.csv
|
|
|
|
|
out/soong/.intermediates/frameworks/base/boot/platform-bootclasspath/android_common/hiddenapi-monolithic/index-from-classes.csv
|
|
|
|
@@ -11238,6 +11252,20 @@ func TestBootDexJarsMultipleApexPrebuilts(t *testing.T) {
|
|
|
|
|
android.FixtureMergeMockFs(map[string][]byte{
|
|
|
|
|
"system/sepolicy/apex/com.android.foo-file_contexts": nil,
|
|
|
|
|
}),
|
|
|
|
|
// Make sure that we have atleast one platform library so that we can check the monolithic hiddenapi
|
|
|
|
|
// file creation.
|
|
|
|
|
java.FixtureConfigureBootJars("platform:foo"),
|
|
|
|
|
android.FixtureModifyMockFS(func(fs android.MockFS) {
|
|
|
|
|
fs["platform/Android.bp"] = []byte(`
|
|
|
|
|
java_library {
|
|
|
|
|
name: "foo",
|
|
|
|
|
srcs: ["Test.java"],
|
|
|
|
|
compile_dex: true,
|
|
|
|
|
}
|
|
|
|
|
`)
|
|
|
|
|
fs["platform/Test.java"] = nil
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
|
|
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
|
|
|
|
variables.BuildFlags = map[string]string{
|
|
|
|
|
"RELEASE_APEX_CONTRIBUTIONS_ADSERVICES": tc.selectedApexContributions,
|
|
|
|
|