Loading java/app_test.go +3 −0 Original line number Diff line number Diff line Loading @@ -399,18 +399,21 @@ func TestAndroidResources(t *testing.T) { android_library { name: "lib", sdk_version: "current", resource_dirs: ["lib/res"], static_libs: ["lib2"], } android_library { name: "lib2", sdk_version: "current", resource_dirs: ["lib2/res"], } // This library has the same resources as lib (should not lead to dupe RROs) android_library { name: "lib3", sdk_version: "current", resource_dirs: ["lib/res"] } ` Loading java/java.go +17 −9 Original line number Diff line number Diff line Loading @@ -689,7 +689,12 @@ const ( javaPlatform ) func getLinkType(m *Module, name string) (ret linkType, stubs bool) { type linkTypeContext interface { android.Module getLinkType(name string) (ret linkType, stubs bool) } func (m *Module) getLinkType(name string) (ret linkType, stubs bool) { ver := m.sdkVersion() switch { case name == "core.current.stubs" || name == "core.platform.api.stubs" || Loading Loading @@ -720,16 +725,16 @@ func getLinkType(m *Module, name string) (ret linkType, stubs bool) { } } func checkLinkType(ctx android.ModuleContext, from *Module, to *Library, tag dependencyTag) { func checkLinkType(ctx android.ModuleContext, from *Module, to linkTypeContext, tag dependencyTag) { if ctx.Host() { return } myLinkType, stubs := getLinkType(from, ctx.ModuleName()) myLinkType, stubs := from.getLinkType(ctx.ModuleName()) if stubs { return } otherLinkType, _ := getLinkType(&to.Module, ctx.OtherModuleName(to)) otherLinkType, _ := to.getLinkType(ctx.OtherModuleName(to)) commonMessage := "Adjust sdk_version: property of the source or target module so that target module is built with the same or smaller API set than the source." switch myLinkType { Loading Loading @@ -786,13 +791,16 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps { // Handled by AndroidApp.collectAppDeps return } if to, ok := module.(*Library); ok { switch module.(type) { case *Library: case *AndroidLibrary: if to, ok := module.(linkTypeContext); ok { switch tag { case bootClasspathTag, libTag, staticLibTag: checkLinkType(ctx, j, to, tag.(dependencyTag)) } } } switch dep := module.(type) { case SdkLibraryDependency: switch tag { Loading Loading
java/app_test.go +3 −0 Original line number Diff line number Diff line Loading @@ -399,18 +399,21 @@ func TestAndroidResources(t *testing.T) { android_library { name: "lib", sdk_version: "current", resource_dirs: ["lib/res"], static_libs: ["lib2"], } android_library { name: "lib2", sdk_version: "current", resource_dirs: ["lib2/res"], } // This library has the same resources as lib (should not lead to dupe RROs) android_library { name: "lib3", sdk_version: "current", resource_dirs: ["lib/res"] } ` Loading
java/java.go +17 −9 Original line number Diff line number Diff line Loading @@ -689,7 +689,12 @@ const ( javaPlatform ) func getLinkType(m *Module, name string) (ret linkType, stubs bool) { type linkTypeContext interface { android.Module getLinkType(name string) (ret linkType, stubs bool) } func (m *Module) getLinkType(name string) (ret linkType, stubs bool) { ver := m.sdkVersion() switch { case name == "core.current.stubs" || name == "core.platform.api.stubs" || Loading Loading @@ -720,16 +725,16 @@ func getLinkType(m *Module, name string) (ret linkType, stubs bool) { } } func checkLinkType(ctx android.ModuleContext, from *Module, to *Library, tag dependencyTag) { func checkLinkType(ctx android.ModuleContext, from *Module, to linkTypeContext, tag dependencyTag) { if ctx.Host() { return } myLinkType, stubs := getLinkType(from, ctx.ModuleName()) myLinkType, stubs := from.getLinkType(ctx.ModuleName()) if stubs { return } otherLinkType, _ := getLinkType(&to.Module, ctx.OtherModuleName(to)) otherLinkType, _ := to.getLinkType(ctx.OtherModuleName(to)) commonMessage := "Adjust sdk_version: property of the source or target module so that target module is built with the same or smaller API set than the source." switch myLinkType { Loading Loading @@ -786,13 +791,16 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps { // Handled by AndroidApp.collectAppDeps return } if to, ok := module.(*Library); ok { switch module.(type) { case *Library: case *AndroidLibrary: if to, ok := module.(linkTypeContext); ok { switch tag { case bootClasspathTag, libTag, staticLibTag: checkLinkType(ctx, j, to, tag.(dependencyTag)) } } } switch dep := module.(type) { case SdkLibraryDependency: switch tag { Loading