Merge changes I343712d7,Ic076ea85 am: 9c01fc686d
am: 93ece5b8e2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1772627 Change-Id: Id0587dc7c2a4e1019f3699aa3b3b7e5015e5e2e5
This commit is contained in:
@@ -4740,7 +4740,7 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
checkHiddenAPIIndexInputs := func(t *testing.T, ctx *android.TestContext, expectedIntermediateInputs string) {
|
||||
checkHiddenAPIIndexFromClassesInputs := func(t *testing.T, ctx *android.TestContext, expectedIntermediateInputs string) {
|
||||
t.Helper()
|
||||
platformBootclasspath := ctx.ModuleForTests("platform-bootclasspath", "android_common")
|
||||
var rule android.TestingBuildParams
|
||||
@@ -4749,6 +4749,15 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
|
||||
java.CheckHiddenAPIRuleInputs(t, "intermediate index", expectedIntermediateInputs, rule)
|
||||
}
|
||||
|
||||
checkHiddenAPIIndexFromFlagsInputs := func(t *testing.T, ctx *android.TestContext, expectedIntermediateInputs string) {
|
||||
t.Helper()
|
||||
platformBootclasspath := ctx.ModuleForTests("platform-bootclasspath", "android_common")
|
||||
var rule android.TestingBuildParams
|
||||
|
||||
rule = platformBootclasspath.Output("hiddenapi-index.csv")
|
||||
java.CheckHiddenAPIRuleInputs(t, "monolithic index", expectedIntermediateInputs, rule)
|
||||
}
|
||||
|
||||
fragment := java.ApexVariantReference{
|
||||
Apex: proptools.StringPtr("myapex"),
|
||||
Module: proptools.StringPtr("my-bootclasspath-fragment"),
|
||||
@@ -4796,10 +4805,13 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
|
||||
checkBootDexJarPath(t, ctx, "libbar", "out/soong/.intermediates/myapex.deapexer/android_common/deapexer/javalib/libbar.jar")
|
||||
|
||||
// Verify the correct module jars contribute to the hiddenapi index file.
|
||||
checkHiddenAPIIndexInputs(t, ctx, `
|
||||
checkHiddenAPIIndexFromClassesInputs(t, ctx, `
|
||||
out/soong/.intermediates/libbar.stubs/android_common/combined/libbar.stubs.jar
|
||||
out/soong/.intermediates/libfoo/android_common_myapex/combined/libfoo.jar
|
||||
`)
|
||||
checkHiddenAPIIndexFromFlagsInputs(t, ctx, `
|
||||
out/soong/.intermediates/frameworks/base/boot/platform-bootclasspath/android_common/hiddenapi-monolithic/index-from-classes.csv
|
||||
`)
|
||||
})
|
||||
|
||||
t.Run("apex_set only", func(t *testing.T) {
|
||||
@@ -4837,10 +4849,13 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
|
||||
checkBootDexJarPath(t, ctx, "libbar", "out/soong/.intermediates/myapex.deapexer/android_common/deapexer/javalib/libbar.jar")
|
||||
|
||||
// Verify the correct module jars contribute to the hiddenapi index file.
|
||||
checkHiddenAPIIndexInputs(t, ctx, `
|
||||
checkHiddenAPIIndexFromClassesInputs(t, ctx, `
|
||||
out/soong/.intermediates/libbar.stubs/android_common/combined/libbar.stubs.jar
|
||||
out/soong/.intermediates/libfoo/android_common_myapex/combined/libfoo.jar
|
||||
`)
|
||||
checkHiddenAPIIndexFromFlagsInputs(t, ctx, `
|
||||
out/soong/.intermediates/frameworks/base/boot/platform-bootclasspath/android_common/hiddenapi-monolithic/index-from-classes.csv
|
||||
`)
|
||||
})
|
||||
|
||||
t.Run("prebuilt with source library preferred", func(t *testing.T) {
|
||||
@@ -4958,10 +4973,13 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
|
||||
checkBootDexJarPath(t, ctx, "libbar", "out/soong/.intermediates/myapex.deapexer/android_common/deapexer/javalib/libbar.jar")
|
||||
|
||||
// Verify the correct module jars contribute to the hiddenapi index file.
|
||||
checkHiddenAPIIndexInputs(t, ctx, `
|
||||
checkHiddenAPIIndexFromClassesInputs(t, ctx, `
|
||||
out/soong/.intermediates/prebuilt_libbar.stubs/android_common/combined/libbar.stubs.jar
|
||||
out/soong/.intermediates/prebuilt_libfoo/android_common_myapex/combined/libfoo.jar
|
||||
`)
|
||||
checkHiddenAPIIndexFromFlagsInputs(t, ctx, `
|
||||
out/soong/.intermediates/frameworks/base/boot/platform-bootclasspath/android_common/hiddenapi-monolithic/index-from-classes.csv
|
||||
`)
|
||||
})
|
||||
|
||||
t.Run("prebuilt with source apex preferred", func(t *testing.T) {
|
||||
@@ -5032,10 +5050,13 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
|
||||
checkBootDexJarPath(t, ctx, "libbar", "out/soong/.intermediates/libbar/android_common_myapex/hiddenapi/libbar.jar")
|
||||
|
||||
// Verify the correct module jars contribute to the hiddenapi index file.
|
||||
checkHiddenAPIIndexInputs(t, ctx, `
|
||||
checkHiddenAPIIndexFromClassesInputs(t, ctx, `
|
||||
out/soong/.intermediates/libbar/android_common_myapex/javac/libbar.jar
|
||||
out/soong/.intermediates/libfoo/android_common_apex10000/javac/libfoo.jar
|
||||
`)
|
||||
checkHiddenAPIIndexFromFlagsInputs(t, ctx, `
|
||||
out/soong/.intermediates/frameworks/base/boot/platform-bootclasspath/android_common/hiddenapi-monolithic/index-from-classes.csv
|
||||
`)
|
||||
})
|
||||
|
||||
t.Run("prebuilt preferred with source apex disabled", func(t *testing.T) {
|
||||
@@ -5108,10 +5129,13 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
|
||||
checkBootDexJarPath(t, ctx, "libbar", "out/soong/.intermediates/myapex.deapexer/android_common/deapexer/javalib/libbar.jar")
|
||||
|
||||
// Verify the correct module jars contribute to the hiddenapi index file.
|
||||
checkHiddenAPIIndexInputs(t, ctx, `
|
||||
checkHiddenAPIIndexFromClassesInputs(t, ctx, `
|
||||
out/soong/.intermediates/prebuilt_libbar.stubs/android_common/combined/libbar.stubs.jar
|
||||
out/soong/.intermediates/prebuilt_libfoo/android_common_myapex/combined/libfoo.jar
|
||||
`)
|
||||
checkHiddenAPIIndexFromFlagsInputs(t, ctx, `
|
||||
out/soong/.intermediates/frameworks/base/boot/platform-bootclasspath/android_common/hiddenapi-monolithic/index-from-classes.csv
|
||||
`)
|
||||
})
|
||||
}
|
||||
|
||||
|
@@ -48,6 +48,27 @@ python_binary_host {
|
||||
},
|
||||
}
|
||||
|
||||
python_test_host {
|
||||
name: "generate_hiddenapi_lists_test",
|
||||
main: "generate_hiddenapi_lists_test.py",
|
||||
srcs: [
|
||||
"generate_hiddenapi_lists.py",
|
||||
"generate_hiddenapi_lists_test.py",
|
||||
],
|
||||
version: {
|
||||
py2: {
|
||||
enabled: false,
|
||||
},
|
||||
py3: {
|
||||
enabled: true,
|
||||
embedded_launcher: true,
|
||||
},
|
||||
},
|
||||
test_options: {
|
||||
unit_test: true,
|
||||
},
|
||||
}
|
||||
|
||||
python_binary_host {
|
||||
name: "verify_overlaps",
|
||||
main: "verify_overlaps.py",
|
||||
|
@@ -101,4 +101,4 @@ class TestHiddenapiListGeneration(unittest.TestCase):
|
||||
self.assertEqual(extract_package(signature), expected_package)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
unittest.main(verbosity=2)
|
||||
|
Reference in New Issue
Block a user