Merge "Modify static lib stub library visiblity" into main am: 968c735108
am: f7fc893c2a
am: 86633be948
am: 613e513864
am: 444346dce5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2744913 Change-Id: Icf9d977da869285d2dce8479a0e11a8677424fe7 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -1500,3 +1500,32 @@ func TestJavaSdkLibrary_ApiLibrary(t *testing.T) {
|
||||
android.AssertStringEquals(t, "Module expected to contain full api surface api library", c.fullApiSurfaceStub, *m.properties.Full_api_surface_stub)
|
||||
}
|
||||
}
|
||||
|
||||
func TestStaticDepStubLibrariesVisibility(t *testing.T) {
|
||||
android.GroupFixturePreparers(
|
||||
prepareForJavaTest,
|
||||
PrepareForTestWithJavaSdkLibraryFiles,
|
||||
FixtureWithLastReleaseApis("foo"),
|
||||
android.FixtureMergeMockFs(
|
||||
map[string][]byte{
|
||||
"A.java": nil,
|
||||
"dir/Android.bp": []byte(
|
||||
`
|
||||
java_library {
|
||||
name: "bar",
|
||||
srcs: ["A.java"],
|
||||
libs: ["foo.stubs.from-source"],
|
||||
}
|
||||
`),
|
||||
"dir/A.java": nil,
|
||||
},
|
||||
).ExtendWithErrorHandler(
|
||||
android.FixtureExpectsAtLeastOneErrorMatchingPattern(
|
||||
`module "bar" variant "android_common": depends on //.:foo.stubs.from-source which is not visible to this module`)),
|
||||
).RunTestWithBp(t, `
|
||||
java_sdk_library {
|
||||
name: "foo",
|
||||
srcs: ["A.java"],
|
||||
}
|
||||
`)
|
||||
}
|
||||
|
Reference in New Issue
Block a user