Loading java/sdk_library.go +1 −0 Original line number Diff line number Diff line Loading @@ -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 Loading java/sdk_library_test.go +26 −0 Original line number Diff line number Diff line Loading @@ -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
java/sdk_library.go +1 −0 Original line number Diff line number Diff line Loading @@ -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 Loading
java/sdk_library_test.go +26 −0 Original line number Diff line number Diff line Loading @@ -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") }