Merge "Propagate stub_only_libs to the invocation generating stub sources" am: 663e060c64
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2309271 Change-Id: Ia739ae43736eb5ceffd53bf7dcf36c87b4c48567 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
d497e25c63
2 changed files with 27 additions and 0 deletions
|
@ -1648,6 +1648,7 @@ func (module *SdkLibrary) createStubsSourcesAndApi(mctx android.DefaultableHookC
|
|||
// shared libs and static libs. So we need to add both of these libs to Libs property.
|
||||
props.Libs = module.properties.Libs
|
||||
props.Libs = append(props.Libs, module.properties.Static_libs...)
|
||||
props.Libs = append(props.Libs, module.sdkLibraryProperties.Stub_only_libs...)
|
||||
props.Aidl.Include_dirs = module.deviceProperties.Aidl.Include_dirs
|
||||
props.Aidl.Local_include_dirs = module.deviceProperties.Aidl.Local_include_dirs
|
||||
props.Java_version = module.properties.Java_version
|
||||
|
|
|
@ -1385,3 +1385,29 @@ func TestSdkLibrary_CheckMinSdkVersion(t *testing.T) {
|
|||
}
|
||||
`)
|
||||
}
|
||||
|
||||
func TestJavaSdkLibrary_StubOnlyLibs_PassedToDroidstubs(t *testing.T) {
|
||||
result := android.GroupFixturePreparers(
|
||||
prepareForJavaTest,
|
||||
PrepareForTestWithJavaSdkLibraryFiles,
|
||||
FixtureWithLastReleaseApis("foo"),
|
||||
).RunTestWithBp(t, `
|
||||
java_sdk_library {
|
||||
name: "foo",
|
||||
srcs: ["a.java"],
|
||||
public: {
|
||||
enabled: true,
|
||||
},
|
||||
stub_only_libs: ["bar-lib"],
|
||||
}
|
||||
|
||||
java_library {
|
||||
name: "bar-lib",
|
||||
srcs: ["b.java"],
|
||||
}
|
||||
`)
|
||||
|
||||
// The foo.stubs.source should depend on bar-lib
|
||||
fooStubsSources := result.ModuleForTests("foo.stubs.source", "android_common").Module().(*Droidstubs)
|
||||
android.AssertStringListContains(t, "foo stubs should depend on bar-lib", fooStubsSources.Javadoc.properties.Libs, "bar-lib")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue