Merge "Make CheckHiddenAPIRuleInputs more reusable" am: 07cdd37ae5 am: f250ea10e4

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

Change-Id: Ie1bb89d1b2aaf55ce0ee4ad9891cd891bc464096
This commit is contained in:
Paul Duffin
2021-06-21 20:17:21 +00:00
committed by Automerger Merge Worker
3 changed files with 34 additions and 26 deletions

View File

@@ -4493,7 +4493,7 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
t.Helper()
platformBootclasspath := ctx.ModuleForTests("platform-bootclasspath", "android_common")
indexRule := platformBootclasspath.Rule("monolithic_hidden_API_index")
java.CheckHiddenAPIRuleInputs(t, expectedInputs, indexRule)
java.CheckHiddenAPIRuleInputs(t, "index", expectedInputs, indexRule)
}
fragment := java.ApexVariantReference{
@@ -4544,9 +4544,9 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
// Verify the correct module jars contribute to the hiddenapi index file.
checkHiddenAPIIndexInputs(t, ctx, `
.intermediates/libbar.stubs/android_common/combined/libbar.stubs.jar
.intermediates/libfoo/android_common_myapex/combined/libfoo.jar
`)
out/soong/.intermediates/libbar.stubs/android_common/combined/libbar.stubs.jar
out/soong/.intermediates/libfoo/android_common_myapex/combined/libfoo.jar
`)
})
t.Run("apex_set only", func(t *testing.T) {
@@ -4585,9 +4585,9 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
// Verify the correct module jars contribute to the hiddenapi index file.
checkHiddenAPIIndexInputs(t, ctx, `
.intermediates/libbar.stubs/android_common/combined/libbar.stubs.jar
.intermediates/libfoo/android_common_myapex/combined/libfoo.jar
`)
out/soong/.intermediates/libbar.stubs/android_common/combined/libbar.stubs.jar
out/soong/.intermediates/libfoo/android_common_myapex/combined/libfoo.jar
`)
})
t.Run("prebuilt with source library preferred", func(t *testing.T) {
@@ -4706,9 +4706,9 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
// Verify the correct module jars contribute to the hiddenapi index file.
checkHiddenAPIIndexInputs(t, ctx, `
.intermediates/prebuilt_libbar.stubs/android_common/combined/libbar.stubs.jar
.intermediates/prebuilt_libfoo/android_common_myapex/combined/libfoo.jar
`)
out/soong/.intermediates/prebuilt_libbar.stubs/android_common/combined/libbar.stubs.jar
out/soong/.intermediates/prebuilt_libfoo/android_common_myapex/combined/libfoo.jar
`)
})
t.Run("prebuilt with source apex preferred", func(t *testing.T) {
@@ -4780,9 +4780,9 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
// Verify the correct module jars contribute to the hiddenapi index file.
checkHiddenAPIIndexInputs(t, ctx, `
.intermediates/libbar/android_common_myapex/javac/libbar.jar
.intermediates/libfoo/android_common_apex10000/javac/libfoo.jar
`)
out/soong/.intermediates/libbar/android_common_myapex/javac/libbar.jar
out/soong/.intermediates/libfoo/android_common_apex10000/javac/libfoo.jar
`)
})
t.Run("prebuilt preferred with source apex disabled", func(t *testing.T) {
@@ -4856,9 +4856,9 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
// Verify the correct module jars contribute to the hiddenapi index file.
checkHiddenAPIIndexInputs(t, ctx, `
.intermediates/prebuilt_libbar.stubs/android_common/combined/libbar.stubs.jar
.intermediates/prebuilt_libfoo/android_common_myapex/combined/libfoo.jar
`)
out/soong/.intermediates/prebuilt_libbar.stubs/android_common/combined/libbar.stubs.jar
out/soong/.intermediates/prebuilt_libfoo/android_common_myapex/combined/libfoo.jar
`)
})
}