Loading java/base.go +5 −0 Original line number Diff line number Diff line Loading @@ -2229,6 +2229,11 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps { deps.classpath = append(deps.classpath, sdkDep.jars...) deps.dexClasspath = append(deps.dexClasspath, sdkDep.jars...) deps.aidlPreprocess = sdkDep.aidl // Add the sdk module dependency to `compileDepNames`. // This ensures that the dependency is reported in `module_bp_java_deps.json` // TODO (b/358608607): Move this to decodeSdkDep sdkSpec := android.SdkContext(j).SdkVersion(ctx) j.compileDepNames = append(j.compileDepNames, fmt.Sprintf("sdk_%s_%s_android", sdkSpec.Kind.String(), sdkSpec.ApiLevel.String())) } else { deps.aidlPreprocess = sdkDep.aidl } Loading java/device_host_converter.go +8 −0 Original line number Diff line number Diff line Loading @@ -188,3 +188,11 @@ func (d *DeviceHostConverter) AndroidMk() android.AndroidMkData { }, } } // implement the following interface for IDE completion. var _ android.IDEInfo = (*DeviceHostConverter)(nil) func (d *DeviceHostConverter) IDEInfo(ideInfo *android.IdeInfo) { ideInfo.Deps = append(ideInfo.Deps, d.properties.Libs...) ideInfo.Libs = append(ideInfo.Libs, d.properties.Libs...) } java/jdeps_test.go +20 −0 Original line number Diff line number Diff line Loading @@ -103,3 +103,23 @@ func TestCollectJavaLibraryPropertiesAddJarjarRules(t *testing.T) { t.Errorf("Library.IDEInfo() Jarjar_rules = %v, want %v", dpInfo.Jarjar_rules[0], expected) } } func TestCollectJavaLibraryLinkingAgainstVersionedSdk(t *testing.T) { ctx := android.GroupFixturePreparers( prepareForJavaTest, FixtureWithPrebuiltApis(map[string][]string{ "29": {}, })).RunTestWithBp(t, ` java_library { name: "javalib", srcs: ["foo.java"], sdk_version: "29", } `) module := ctx.ModuleForTests("javalib", "android_common").Module().(*Library) dpInfo := &android.IdeInfo{} module.IDEInfo(dpInfo) android.AssertStringListContains(t, "IdeInfo.Deps should contain versioned sdk module", dpInfo.Deps, "sdk_public_29_android") } java/system_modules.go +8 −0 Original line number Diff line number Diff line Loading @@ -311,3 +311,11 @@ func (p *systemModulesInfoProperties) AddToPropertySet(ctx android.SdkMemberCont propertySet.AddPropertyWithTag("libs", p.Libs, ctx.SnapshotBuilder().SdkMemberReferencePropertyTag(true)) } } // implement the following interface for IDE completion. var _ android.IDEInfo = (*SystemModules)(nil) func (s *SystemModules) IDEInfo(ideInfo *android.IdeInfo) { ideInfo.Deps = append(ideInfo.Deps, s.properties.Libs...) ideInfo.Libs = append(ideInfo.Libs, s.properties.Libs...) } Loading
java/base.go +5 −0 Original line number Diff line number Diff line Loading @@ -2229,6 +2229,11 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps { deps.classpath = append(deps.classpath, sdkDep.jars...) deps.dexClasspath = append(deps.dexClasspath, sdkDep.jars...) deps.aidlPreprocess = sdkDep.aidl // Add the sdk module dependency to `compileDepNames`. // This ensures that the dependency is reported in `module_bp_java_deps.json` // TODO (b/358608607): Move this to decodeSdkDep sdkSpec := android.SdkContext(j).SdkVersion(ctx) j.compileDepNames = append(j.compileDepNames, fmt.Sprintf("sdk_%s_%s_android", sdkSpec.Kind.String(), sdkSpec.ApiLevel.String())) } else { deps.aidlPreprocess = sdkDep.aidl } Loading
java/device_host_converter.go +8 −0 Original line number Diff line number Diff line Loading @@ -188,3 +188,11 @@ func (d *DeviceHostConverter) AndroidMk() android.AndroidMkData { }, } } // implement the following interface for IDE completion. var _ android.IDEInfo = (*DeviceHostConverter)(nil) func (d *DeviceHostConverter) IDEInfo(ideInfo *android.IdeInfo) { ideInfo.Deps = append(ideInfo.Deps, d.properties.Libs...) ideInfo.Libs = append(ideInfo.Libs, d.properties.Libs...) }
java/jdeps_test.go +20 −0 Original line number Diff line number Diff line Loading @@ -103,3 +103,23 @@ func TestCollectJavaLibraryPropertiesAddJarjarRules(t *testing.T) { t.Errorf("Library.IDEInfo() Jarjar_rules = %v, want %v", dpInfo.Jarjar_rules[0], expected) } } func TestCollectJavaLibraryLinkingAgainstVersionedSdk(t *testing.T) { ctx := android.GroupFixturePreparers( prepareForJavaTest, FixtureWithPrebuiltApis(map[string][]string{ "29": {}, })).RunTestWithBp(t, ` java_library { name: "javalib", srcs: ["foo.java"], sdk_version: "29", } `) module := ctx.ModuleForTests("javalib", "android_common").Module().(*Library) dpInfo := &android.IdeInfo{} module.IDEInfo(dpInfo) android.AssertStringListContains(t, "IdeInfo.Deps should contain versioned sdk module", dpInfo.Deps, "sdk_public_29_android") }
java/system_modules.go +8 −0 Original line number Diff line number Diff line Loading @@ -311,3 +311,11 @@ func (p *systemModulesInfoProperties) AddToPropertySet(ctx android.SdkMemberCont propertySet.AddPropertyWithTag("libs", p.Libs, ctx.SnapshotBuilder().SdkMemberReferencePropertyTag(true)) } } // implement the following interface for IDE completion. var _ android.IDEInfo = (*SystemModules)(nil) func (s *SystemModules) IDEInfo(ideInfo *android.IdeInfo) { ideInfo.Deps = append(ideInfo.Deps, s.properties.Libs...) ideInfo.Libs = append(ideInfo.Libs, s.properties.Libs...) }