Merge changes from topic "ctx_in_ideinfo" into main
* changes: Add ctx argument to IDEInfo() Add configurable property support to neverallow
This commit is contained in:
@@ -1946,7 +1946,7 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext)
|
|||||||
|
|
||||||
if x, ok := m.module.(IDEInfo); ok {
|
if x, ok := m.module.(IDEInfo); ok {
|
||||||
var result IdeInfo
|
var result IdeInfo
|
||||||
x.IDEInfo(&result)
|
x.IDEInfo(ctx, &result)
|
||||||
result.BaseModuleName = x.BaseModuleName()
|
result.BaseModuleName = x.BaseModuleName()
|
||||||
SetProvider(ctx, IdeInfoProviderKey, result)
|
SetProvider(ctx, IdeInfoProviderKey, result)
|
||||||
}
|
}
|
||||||
@@ -2735,7 +2735,7 @@ func (c *buildTargetSingleton) GenerateBuildActions(ctx SingletonContext) {
|
|||||||
|
|
||||||
// Collect information for opening IDE project files in java/jdeps.go.
|
// Collect information for opening IDE project files in java/jdeps.go.
|
||||||
type IDEInfo interface {
|
type IDEInfo interface {
|
||||||
IDEInfo(ideInfo *IdeInfo)
|
IDEInfo(ctx BaseModuleContext, ideInfo *IdeInfo)
|
||||||
BaseModuleName() string
|
BaseModuleName() string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -287,7 +287,7 @@ func neverallowMutator(ctx BottomUpMutatorContext) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if !n.appliesToProperties(properties) {
|
if !n.appliesToProperties(ctx, properties) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -604,9 +604,9 @@ func (r *rule) appliesToModuleType(moduleType string) bool {
|
|||||||
return (len(r.moduleTypes) == 0 || InList(moduleType, r.moduleTypes)) && !InList(moduleType, r.unlessModuleTypes)
|
return (len(r.moduleTypes) == 0 || InList(moduleType, r.moduleTypes)) && !InList(moduleType, r.unlessModuleTypes)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *rule) appliesToProperties(properties []interface{}) bool {
|
func (r *rule) appliesToProperties(ctx BottomUpMutatorContext, properties []interface{}) bool {
|
||||||
includeProps := hasAllProperties(properties, r.props)
|
includeProps := hasAllProperties(ctx, properties, r.props)
|
||||||
excludeProps := hasAnyProperty(properties, r.unlessProps)
|
excludeProps := hasAnyProperty(ctx, properties, r.unlessProps)
|
||||||
return includeProps && !excludeProps
|
return includeProps && !excludeProps
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -644,25 +644,25 @@ func fieldNamesForProperties(propertyNames string) []string {
|
|||||||
return names
|
return names
|
||||||
}
|
}
|
||||||
|
|
||||||
func hasAnyProperty(properties []interface{}, props []ruleProperty) bool {
|
func hasAnyProperty(ctx BottomUpMutatorContext, properties []interface{}, props []ruleProperty) bool {
|
||||||
for _, v := range props {
|
for _, v := range props {
|
||||||
if hasProperty(properties, v) {
|
if hasProperty(ctx, properties, v) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func hasAllProperties(properties []interface{}, props []ruleProperty) bool {
|
func hasAllProperties(ctx BottomUpMutatorContext, properties []interface{}, props []ruleProperty) bool {
|
||||||
for _, v := range props {
|
for _, v := range props {
|
||||||
if !hasProperty(properties, v) {
|
if !hasProperty(ctx, properties, v) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func hasProperty(properties []interface{}, prop ruleProperty) bool {
|
func hasProperty(ctx BottomUpMutatorContext, properties []interface{}, prop ruleProperty) bool {
|
||||||
for _, propertyStruct := range properties {
|
for _, propertyStruct := range properties {
|
||||||
propertiesValue := reflect.ValueOf(propertyStruct).Elem()
|
propertiesValue := reflect.ValueOf(propertyStruct).Elem()
|
||||||
for _, v := range prop.fields {
|
for _, v := range prop.fields {
|
||||||
@@ -679,14 +679,14 @@ func hasProperty(properties []interface{}, prop ruleProperty) bool {
|
|||||||
return prop.matcher.Test(value)
|
return prop.matcher.Test(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
if matchValue(propertiesValue, check) {
|
if matchValue(ctx, propertiesValue, check) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func matchValue(value reflect.Value, check func(string) bool) bool {
|
func matchValue(ctx BottomUpMutatorContext, value reflect.Value, check func(string) bool) bool {
|
||||||
if !value.IsValid() {
|
if !value.IsValid() {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@@ -698,19 +698,26 @@ func matchValue(value reflect.Value, check func(string) bool) bool {
|
|||||||
value = value.Elem()
|
value = value.Elem()
|
||||||
}
|
}
|
||||||
|
|
||||||
switch value.Kind() {
|
switch v := value.Interface().(type) {
|
||||||
case reflect.String:
|
case string:
|
||||||
return check(value.String())
|
return check(v)
|
||||||
case reflect.Bool:
|
case bool:
|
||||||
return check(strconv.FormatBool(value.Bool()))
|
return check(strconv.FormatBool(v))
|
||||||
case reflect.Int:
|
case int:
|
||||||
return check(strconv.FormatInt(value.Int(), 10))
|
return check(strconv.FormatInt((int64)(v), 10))
|
||||||
case reflect.Slice:
|
case []string:
|
||||||
slice, ok := value.Interface().([]string)
|
for _, v := range v {
|
||||||
if !ok {
|
if check(v) {
|
||||||
panic("Can only handle slice of string")
|
return true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for _, v := range slice {
|
return false
|
||||||
|
case proptools.Configurable[string]:
|
||||||
|
return check(v.GetOrDefault(ctx, ""))
|
||||||
|
case proptools.Configurable[bool]:
|
||||||
|
return check(strconv.FormatBool(v.GetOrDefault(ctx, false)))
|
||||||
|
case proptools.Configurable[[]string]:
|
||||||
|
for _, v := range v.GetOrDefault(ctx, nil) {
|
||||||
if check(v) {
|
if check(v) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
@@ -2873,7 +2873,7 @@ func isStaticExecutableAllowed(apex string, exec string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Collect information for opening IDE project files in java/jdeps.go.
|
// Collect information for opening IDE project files in java/jdeps.go.
|
||||||
func (a *apexBundle) IDEInfo(dpInfo *android.IdeInfo) {
|
func (a *apexBundle) IDEInfo(ctx android.BaseModuleContext, dpInfo *android.IdeInfo) {
|
||||||
dpInfo.Deps = append(dpInfo.Deps, a.properties.Java_libs...)
|
dpInfo.Deps = append(dpInfo.Deps, a.properties.Java_libs...)
|
||||||
dpInfo.Deps = append(dpInfo.Deps, a.properties.Bootclasspath_fragments...)
|
dpInfo.Deps = append(dpInfo.Deps, a.properties.Bootclasspath_fragments...)
|
||||||
dpInfo.Deps = append(dpInfo.Deps, a.properties.ResolvedSystemserverclasspathFragments...)
|
dpInfo.Deps = append(dpInfo.Deps, a.properties.ResolvedSystemserverclasspathFragments...)
|
||||||
|
@@ -625,7 +625,7 @@ func (g *Module) setOutputFiles(ctx android.ModuleContext) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Collect information for opening IDE project files in java/jdeps.go.
|
// Collect information for opening IDE project files in java/jdeps.go.
|
||||||
func (g *Module) IDEInfo(dpInfo *android.IdeInfo) {
|
func (g *Module) IDEInfo(ctx android.BaseModuleContext, dpInfo *android.IdeInfo) {
|
||||||
dpInfo.Srcs = append(dpInfo.Srcs, g.Srcs().Strings()...)
|
dpInfo.Srcs = append(dpInfo.Srcs, g.Srcs().Strings()...)
|
||||||
for _, src := range g.properties.ResolvedSrcs {
|
for _, src := range g.properties.ResolvedSrcs {
|
||||||
if strings.HasPrefix(src, ":") {
|
if strings.HasPrefix(src, ":") {
|
||||||
|
10
java/aar.go
10
java/aar.go
@@ -914,12 +914,12 @@ func (a *AndroidLibrary) setOutputFiles(ctx android.ModuleContext) {
|
|||||||
setOutputFiles(ctx, a.Library.Module)
|
setOutputFiles(ctx, a.Library.Module)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *AndroidLibrary) IDEInfo(dpInfo *android.IdeInfo) {
|
func (a *AndroidLibrary) IDEInfo(ctx android.BaseModuleContext, dpInfo *android.IdeInfo) {
|
||||||
a.Library.IDEInfo(dpInfo)
|
a.Library.IDEInfo(ctx, dpInfo)
|
||||||
a.aapt.IDEInfo(dpInfo)
|
a.aapt.IDEInfo(ctx, dpInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *aapt) IDEInfo(dpInfo *android.IdeInfo) {
|
func (a *aapt) IDEInfo(ctx android.BaseModuleContext, dpInfo *android.IdeInfo) {
|
||||||
if a.rJar != nil {
|
if a.rJar != nil {
|
||||||
dpInfo.Jars = append(dpInfo.Jars, a.rJar.String())
|
dpInfo.Jars = append(dpInfo.Jars, a.rJar.String())
|
||||||
}
|
}
|
||||||
@@ -1451,6 +1451,6 @@ func AARImportFactory() android.Module {
|
|||||||
return module
|
return module
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *AARImport) IDEInfo(dpInfo *android.IdeInfo) {
|
func (a *AARImport) IDEInfo(ctx android.BaseModuleContext, dpInfo *android.IdeInfo) {
|
||||||
dpInfo.Jars = append(dpInfo.Jars, a.headerJarFile.String(), a.rJar.String())
|
dpInfo.Jars = append(dpInfo.Jars, a.headerJarFile.String(), a.rJar.String())
|
||||||
}
|
}
|
||||||
|
@@ -1243,9 +1243,9 @@ func (a *AndroidApp) EnableCoverageIfNeeded() {}
|
|||||||
|
|
||||||
var _ cc.Coverage = (*AndroidApp)(nil)
|
var _ cc.Coverage = (*AndroidApp)(nil)
|
||||||
|
|
||||||
func (a *AndroidApp) IDEInfo(dpInfo *android.IdeInfo) {
|
func (a *AndroidApp) IDEInfo(ctx android.BaseModuleContext, dpInfo *android.IdeInfo) {
|
||||||
a.Library.IDEInfo(dpInfo)
|
a.Library.IDEInfo(ctx, dpInfo)
|
||||||
a.aapt.IDEInfo(dpInfo)
|
a.aapt.IDEInfo(ctx, dpInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *AndroidApp) productCharacteristicsRROPackageName() string {
|
func (a *AndroidApp) productCharacteristicsRROPackageName() string {
|
||||||
|
@@ -2049,7 +2049,7 @@ func (j *Module) ClassLoaderContexts() dexpreopt.ClassLoaderContextMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Collect information for opening IDE project files in java/jdeps.go.
|
// Collect information for opening IDE project files in java/jdeps.go.
|
||||||
func (j *Module) IDEInfo(dpInfo *android.IdeInfo) {
|
func (j *Module) IDEInfo(ctx android.BaseModuleContext, dpInfo *android.IdeInfo) {
|
||||||
// jarjar rules will repackage the sources. To prevent misleading results, IdeInfo should contain the
|
// jarjar rules will repackage the sources. To prevent misleading results, IdeInfo should contain the
|
||||||
// repackaged jar instead of the input sources.
|
// repackaged jar instead of the input sources.
|
||||||
if j.expandJarjarRules != nil {
|
if j.expandJarjarRules != nil {
|
||||||
|
@@ -836,7 +836,7 @@ func (b *BootclasspathFragmentModule) getProfilePath() android.Path {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Collect information for opening IDE project files in java/jdeps.go.
|
// Collect information for opening IDE project files in java/jdeps.go.
|
||||||
func (b *BootclasspathFragmentModule) IDEInfo(dpInfo *android.IdeInfo) {
|
func (b *BootclasspathFragmentModule) IDEInfo(ctx android.BaseModuleContext, dpInfo *android.IdeInfo) {
|
||||||
dpInfo.Deps = append(dpInfo.Deps, b.properties.Contents...)
|
dpInfo.Deps = append(dpInfo.Deps, b.properties.Contents...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -192,7 +192,7 @@ func (d *DeviceHostConverter) AndroidMk() android.AndroidMkData {
|
|||||||
// implement the following interface for IDE completion.
|
// implement the following interface for IDE completion.
|
||||||
var _ android.IDEInfo = (*DeviceHostConverter)(nil)
|
var _ android.IDEInfo = (*DeviceHostConverter)(nil)
|
||||||
|
|
||||||
func (d *DeviceHostConverter) IDEInfo(ideInfo *android.IdeInfo) {
|
func (d *DeviceHostConverter) IDEInfo(ctx android.BaseModuleContext, ideInfo *android.IdeInfo) {
|
||||||
ideInfo.Deps = append(ideInfo.Deps, d.properties.Libs...)
|
ideInfo.Deps = append(ideInfo.Deps, d.properties.Libs...)
|
||||||
ideInfo.Libs = append(ideInfo.Libs, d.properties.Libs...)
|
ideInfo.Libs = append(ideInfo.Libs, d.properties.Libs...)
|
||||||
}
|
}
|
||||||
|
@@ -2404,15 +2404,15 @@ func (al *ApiLibrary) TargetSdkVersion(ctx android.EarlyModuleContext) android.A
|
|||||||
return al.SdkVersion(ctx).ApiLevel
|
return al.SdkVersion(ctx).ApiLevel
|
||||||
}
|
}
|
||||||
|
|
||||||
func (al *ApiLibrary) IDEInfo(i *android.IdeInfo) {
|
func (al *ApiLibrary) IDEInfo(ctx android.BaseModuleContext, i *android.IdeInfo) {
|
||||||
i.Deps = append(i.Deps, al.ideDeps()...)
|
i.Deps = append(i.Deps, al.ideDeps(ctx)...)
|
||||||
i.Libs = append(i.Libs, al.properties.Libs...)
|
i.Libs = append(i.Libs, al.properties.Libs...)
|
||||||
i.Static_libs = append(i.Static_libs, al.properties.Static_libs...)
|
i.Static_libs = append(i.Static_libs, al.properties.Static_libs...)
|
||||||
i.SrcJars = append(i.SrcJars, al.stubsSrcJar.String())
|
i.SrcJars = append(i.SrcJars, al.stubsSrcJar.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
// deps of java_api_library for module_bp_java_deps.json
|
// deps of java_api_library for module_bp_java_deps.json
|
||||||
func (al *ApiLibrary) ideDeps() []string {
|
func (al *ApiLibrary) ideDeps(ctx android.BaseModuleContext) []string {
|
||||||
ret := []string{}
|
ret := []string{}
|
||||||
ret = append(ret, al.properties.Libs...)
|
ret = append(ret, al.properties.Libs...)
|
||||||
ret = append(ret, al.properties.Static_libs...)
|
ret = append(ret, al.properties.Static_libs...)
|
||||||
@@ -2933,7 +2933,7 @@ var _ android.IDECustomizedModuleName = (*Import)(nil)
|
|||||||
|
|
||||||
// Collect information for opening IDE project files in java/jdeps.go.
|
// Collect information for opening IDE project files in java/jdeps.go.
|
||||||
|
|
||||||
func (j *Import) IDEInfo(dpInfo *android.IdeInfo) {
|
func (j *Import) IDEInfo(ctx android.BaseModuleContext, dpInfo *android.IdeInfo) {
|
||||||
dpInfo.Jars = append(dpInfo.Jars, j.combinedHeaderFile.String())
|
dpInfo.Jars = append(dpInfo.Jars, j.combinedHeaderFile.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -32,9 +32,7 @@ func TestCollectJavaLibraryPropertiesAddLibsDeps(t *testing.T) {
|
|||||||
}
|
}
|
||||||
`)
|
`)
|
||||||
module := ctx.ModuleForTests("javalib", "android_common").Module().(*Library)
|
module := ctx.ModuleForTests("javalib", "android_common").Module().(*Library)
|
||||||
dpInfo := &android.IdeInfo{}
|
dpInfo, _ := android.OtherModuleProvider(ctx, module, android.IdeInfoProviderKey)
|
||||||
|
|
||||||
module.IDEInfo(dpInfo)
|
|
||||||
|
|
||||||
for _, expected := range []string{"Foo", "Bar"} {
|
for _, expected := range []string{"Foo", "Bar"} {
|
||||||
if !android.InList(expected, dpInfo.Deps) {
|
if !android.InList(expected, dpInfo.Deps) {
|
||||||
@@ -54,9 +52,7 @@ func TestCollectJavaLibraryPropertiesAddStaticLibsDeps(t *testing.T) {
|
|||||||
}
|
}
|
||||||
`)
|
`)
|
||||||
module := ctx.ModuleForTests("javalib", "android_common").Module().(*Library)
|
module := ctx.ModuleForTests("javalib", "android_common").Module().(*Library)
|
||||||
dpInfo := &android.IdeInfo{}
|
dpInfo, _ := android.OtherModuleProvider(ctx, module, android.IdeInfoProviderKey)
|
||||||
|
|
||||||
module.IDEInfo(dpInfo)
|
|
||||||
|
|
||||||
for _, expected := range []string{"Foo", "Bar"} {
|
for _, expected := range []string{"Foo", "Bar"} {
|
||||||
if !android.InList(expected, dpInfo.Deps) {
|
if !android.InList(expected, dpInfo.Deps) {
|
||||||
@@ -66,26 +62,36 @@ func TestCollectJavaLibraryPropertiesAddStaticLibsDeps(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestCollectJavaLibraryPropertiesAddScrs(t *testing.T) {
|
func TestCollectJavaLibraryPropertiesAddScrs(t *testing.T) {
|
||||||
expected := []string{"Foo", "Bar"}
|
ctx, _ := testJava(t,
|
||||||
module := LibraryFactory().(*Library)
|
`
|
||||||
module.expandIDEInfoCompiledSrcs = append(module.expandIDEInfoCompiledSrcs, expected...)
|
java_library {
|
||||||
dpInfo := &android.IdeInfo{}
|
name: "javalib",
|
||||||
|
srcs: ["Foo.java", "Bar.java"],
|
||||||
module.IDEInfo(dpInfo)
|
}
|
||||||
|
`)
|
||||||
|
module := ctx.ModuleForTests("javalib", "android_common").Module().(*Library)
|
||||||
|
dpInfo, _ := android.OtherModuleProvider(ctx, module, android.IdeInfoProviderKey)
|
||||||
|
|
||||||
|
expected := []string{"Foo.java", "Bar.java"}
|
||||||
if !reflect.DeepEqual(dpInfo.Srcs, expected) {
|
if !reflect.DeepEqual(dpInfo.Srcs, expected) {
|
||||||
t.Errorf("Library.IDEInfo() Srcs = %v, want %v", dpInfo.Srcs, expected)
|
t.Errorf("Library.IDEInfo() Srcs = %v, want %v", dpInfo.Srcs, expected)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestCollectJavaLibraryPropertiesAddAidlIncludeDirs(t *testing.T) {
|
func TestCollectJavaLibraryPropertiesAddAidlIncludeDirs(t *testing.T) {
|
||||||
|
ctx, _ := testJava(t,
|
||||||
|
`
|
||||||
|
java_library {
|
||||||
|
name: "javalib",
|
||||||
|
aidl: {
|
||||||
|
include_dirs: ["Foo", "Bar"],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
`)
|
||||||
|
module := ctx.ModuleForTests("javalib", "android_common").Module().(*Library)
|
||||||
|
dpInfo, _ := android.OtherModuleProvider(ctx, module, android.IdeInfoProviderKey)
|
||||||
|
|
||||||
expected := []string{"Foo", "Bar"}
|
expected := []string{"Foo", "Bar"}
|
||||||
module := LibraryFactory().(*Library)
|
|
||||||
module.deviceProperties.Aidl.Include_dirs = append(module.deviceProperties.Aidl.Include_dirs, expected...)
|
|
||||||
dpInfo := &android.IdeInfo{}
|
|
||||||
|
|
||||||
module.IDEInfo(dpInfo)
|
|
||||||
|
|
||||||
if !reflect.DeepEqual(dpInfo.Aidl_include_dirs, expected) {
|
if !reflect.DeepEqual(dpInfo.Aidl_include_dirs, expected) {
|
||||||
t.Errorf("Library.IDEInfo() Aidl_include_dirs = %v, want %v", dpInfo.Aidl_include_dirs, expected)
|
t.Errorf("Library.IDEInfo() Aidl_include_dirs = %v, want %v", dpInfo.Aidl_include_dirs, expected)
|
||||||
}
|
}
|
||||||
@@ -101,9 +107,8 @@ func TestCollectJavaLibraryWithJarJarRules(t *testing.T) {
|
|||||||
}
|
}
|
||||||
`)
|
`)
|
||||||
module := ctx.ModuleForTests("javalib", "android_common").Module().(*Library)
|
module := ctx.ModuleForTests("javalib", "android_common").Module().(*Library)
|
||||||
dpInfo := &android.IdeInfo{}
|
dpInfo, _ := android.OtherModuleProvider(ctx, module, android.IdeInfoProviderKey)
|
||||||
|
|
||||||
module.IDEInfo(dpInfo)
|
|
||||||
android.AssertBoolEquals(t, "IdeInfo.Srcs of repackaged library should be empty", true, len(dpInfo.Srcs) == 0)
|
android.AssertBoolEquals(t, "IdeInfo.Srcs of repackaged library should be empty", true, len(dpInfo.Srcs) == 0)
|
||||||
android.AssertStringEquals(t, "IdeInfo.Jar_rules of repackaged library should not be empty", "jarjar_rules.txt", dpInfo.Jarjar_rules[0])
|
android.AssertStringEquals(t, "IdeInfo.Jar_rules of repackaged library should not be empty", "jarjar_rules.txt", dpInfo.Jarjar_rules[0])
|
||||||
if !android.SubstringInList(dpInfo.Jars, "soong/.intermediates/javalib/android_common/jarjar/turbine/javalib.jar") {
|
if !android.SubstringInList(dpInfo.Jars, "soong/.intermediates/javalib/android_common/jarjar/turbine/javalib.jar") {
|
||||||
@@ -125,8 +130,7 @@ func TestCollectJavaLibraryLinkingAgainstVersionedSdk(t *testing.T) {
|
|||||||
}
|
}
|
||||||
`)
|
`)
|
||||||
module := ctx.ModuleForTests("javalib", "android_common").Module().(*Library)
|
module := ctx.ModuleForTests("javalib", "android_common").Module().(*Library)
|
||||||
dpInfo := &android.IdeInfo{}
|
dpInfo, _ := android.OtherModuleProvider(ctx, module, android.IdeInfoProviderKey)
|
||||||
|
|
||||||
module.IDEInfo(dpInfo)
|
|
||||||
android.AssertStringListContains(t, "IdeInfo.Deps should contain versioned sdk module", dpInfo.Deps, "sdk_public_29_android")
|
android.AssertStringListContains(t, "IdeInfo.Deps should contain versioned sdk module", dpInfo.Deps, "sdk_public_29_android")
|
||||||
}
|
}
|
||||||
|
@@ -3599,8 +3599,8 @@ func (s *sdkLibrarySdkMemberProperties) AddToPropertySet(ctx android.SdkMemberCo
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO(b/358613520): This can be removed when modules are no longer allowed to depend on the top-level library.
|
// TODO(b/358613520): This can be removed when modules are no longer allowed to depend on the top-level library.
|
||||||
func (s *SdkLibrary) IDEInfo(dpInfo *android.IdeInfo) {
|
func (s *SdkLibrary) IDEInfo(ctx android.BaseModuleContext, dpInfo *android.IdeInfo) {
|
||||||
s.Library.IDEInfo(dpInfo)
|
s.Library.IDEInfo(ctx, dpInfo)
|
||||||
if s.implLibraryModule != nil {
|
if s.implLibraryModule != nil {
|
||||||
dpInfo.Deps = append(dpInfo.Deps, s.implLibraryModule.Name())
|
dpInfo.Deps = append(dpInfo.Deps, s.implLibraryModule.Name())
|
||||||
} else {
|
} else {
|
||||||
|
@@ -307,7 +307,7 @@ func (p *systemModulesInfoProperties) AddToPropertySet(ctx android.SdkMemberCont
|
|||||||
// implement the following interface for IDE completion.
|
// implement the following interface for IDE completion.
|
||||||
var _ android.IDEInfo = (*SystemModules)(nil)
|
var _ android.IDEInfo = (*SystemModules)(nil)
|
||||||
|
|
||||||
func (s *SystemModules) IDEInfo(ideInfo *android.IdeInfo) {
|
func (s *SystemModules) IDEInfo(ctx android.BaseModuleContext, ideInfo *android.IdeInfo) {
|
||||||
ideInfo.Deps = append(ideInfo.Deps, s.properties.Libs...)
|
ideInfo.Deps = append(ideInfo.Deps, s.properties.Libs...)
|
||||||
ideInfo.Libs = append(ideInfo.Libs, s.properties.Libs...)
|
ideInfo.Libs = append(ideInfo.Libs, s.properties.Libs...)
|
||||||
}
|
}
|
||||||
|
@@ -239,7 +239,7 @@ func (s *SystemServerClasspathModule) ComponentDepsMutator(ctx android.BottomUpM
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Collect information for opening IDE project files in java/jdeps.go.
|
// Collect information for opening IDE project files in java/jdeps.go.
|
||||||
func (s *SystemServerClasspathModule) IDEInfo(dpInfo *android.IdeInfo) {
|
func (s *SystemServerClasspathModule) IDEInfo(ctx android.BaseModuleContext, dpInfo *android.IdeInfo) {
|
||||||
dpInfo.Deps = append(dpInfo.Deps, s.properties.Contents...)
|
dpInfo.Deps = append(dpInfo.Deps, s.properties.Contents...)
|
||||||
dpInfo.Deps = append(dpInfo.Deps, s.properties.Standalone_contents...)
|
dpInfo.Deps = append(dpInfo.Deps, s.properties.Standalone_contents...)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user