Loading android/module.go +2 −2 Original line number Diff line number Diff line Loading @@ -1946,7 +1946,7 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext) if x, ok := m.module.(IDEInfo); ok { var result IdeInfo x.IDEInfo(&result) x.IDEInfo(ctx, &result) result.BaseModuleName = x.BaseModuleName() SetProvider(ctx, IdeInfoProviderKey, result) } Loading Loading @@ -2735,7 +2735,7 @@ func (c *buildTargetSingleton) GenerateBuildActions(ctx SingletonContext) { // Collect information for opening IDE project files in java/jdeps.go. type IDEInfo interface { IDEInfo(ideInfo *IdeInfo) IDEInfo(ctx BaseModuleContext, ideInfo *IdeInfo) BaseModuleName() string } Loading android/neverallow.go +30 −23 Original line number Diff line number Diff line Loading @@ -287,7 +287,7 @@ func neverallowMutator(ctx BottomUpMutatorContext) { continue } if !n.appliesToProperties(properties) { if !n.appliesToProperties(ctx, properties) { continue } Loading Loading @@ -604,9 +604,9 @@ func (r *rule) appliesToModuleType(moduleType string) bool { return (len(r.moduleTypes) == 0 || InList(moduleType, r.moduleTypes)) && !InList(moduleType, r.unlessModuleTypes) } func (r *rule) appliesToProperties(properties []interface{}) bool { includeProps := hasAllProperties(properties, r.props) excludeProps := hasAnyProperty(properties, r.unlessProps) func (r *rule) appliesToProperties(ctx BottomUpMutatorContext, properties []interface{}) bool { includeProps := hasAllProperties(ctx, properties, r.props) excludeProps := hasAnyProperty(ctx, properties, r.unlessProps) return includeProps && !excludeProps } Loading Loading @@ -644,25 +644,25 @@ func fieldNamesForProperties(propertyNames string) []string { return names } func hasAnyProperty(properties []interface{}, props []ruleProperty) bool { func hasAnyProperty(ctx BottomUpMutatorContext, properties []interface{}, props []ruleProperty) bool { for _, v := range props { if hasProperty(properties, v) { if hasProperty(ctx, properties, v) { return true } } return false } func hasAllProperties(properties []interface{}, props []ruleProperty) bool { func hasAllProperties(ctx BottomUpMutatorContext, properties []interface{}, props []ruleProperty) bool { for _, v := range props { if !hasProperty(properties, v) { if !hasProperty(ctx, properties, v) { return false } } return true } func hasProperty(properties []interface{}, prop ruleProperty) bool { func hasProperty(ctx BottomUpMutatorContext, properties []interface{}, prop ruleProperty) bool { for _, propertyStruct := range properties { propertiesValue := reflect.ValueOf(propertyStruct).Elem() for _, v := range prop.fields { Loading @@ -679,14 +679,14 @@ func hasProperty(properties []interface{}, prop ruleProperty) bool { return prop.matcher.Test(value) } if matchValue(propertiesValue, check) { if matchValue(ctx, propertiesValue, check) { return true } } 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() { return false } Loading @@ -698,19 +698,26 @@ func matchValue(value reflect.Value, check func(string) bool) bool { value = value.Elem() } switch value.Kind() { case reflect.String: return check(value.String()) case reflect.Bool: return check(strconv.FormatBool(value.Bool())) case reflect.Int: return check(strconv.FormatInt(value.Int(), 10)) case reflect.Slice: slice, ok := value.Interface().([]string) if !ok { panic("Can only handle slice of string") switch v := value.Interface().(type) { case string: return check(v) case bool: return check(strconv.FormatBool(v)) case int: return check(strconv.FormatInt((int64)(v), 10)) case []string: for _, v := range v { if check(v) { 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) { return true } Loading apex/apex.go +1 −1 Original line number Diff line number Diff line Loading @@ -2873,7 +2873,7 @@ func isStaticExecutableAllowed(apex string, exec string) bool { } // 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.Bootclasspath_fragments...) dpInfo.Deps = append(dpInfo.Deps, a.properties.ResolvedSystemserverclasspathFragments...) Loading genrule/genrule.go +1 −1 Original line number Diff line number Diff line Loading @@ -625,7 +625,7 @@ func (g *Module) setOutputFiles(ctx android.ModuleContext) { } // 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()...) for _, src := range g.properties.ResolvedSrcs { if strings.HasPrefix(src, ":") { Loading java/aar.go +5 −5 Original line number Diff line number Diff line Loading @@ -914,12 +914,12 @@ func (a *AndroidLibrary) setOutputFiles(ctx android.ModuleContext) { setOutputFiles(ctx, a.Library.Module) } func (a *AndroidLibrary) IDEInfo(dpInfo *android.IdeInfo) { a.Library.IDEInfo(dpInfo) a.aapt.IDEInfo(dpInfo) func (a *AndroidLibrary) IDEInfo(ctx android.BaseModuleContext, dpInfo *android.IdeInfo) { a.Library.IDEInfo(ctx, 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 { dpInfo.Jars = append(dpInfo.Jars, a.rJar.String()) } Loading Loading @@ -1451,6 +1451,6 @@ func AARImportFactory() android.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()) } Loading
android/module.go +2 −2 Original line number Diff line number Diff line Loading @@ -1946,7 +1946,7 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext) if x, ok := m.module.(IDEInfo); ok { var result IdeInfo x.IDEInfo(&result) x.IDEInfo(ctx, &result) result.BaseModuleName = x.BaseModuleName() SetProvider(ctx, IdeInfoProviderKey, result) } Loading Loading @@ -2735,7 +2735,7 @@ func (c *buildTargetSingleton) GenerateBuildActions(ctx SingletonContext) { // Collect information for opening IDE project files in java/jdeps.go. type IDEInfo interface { IDEInfo(ideInfo *IdeInfo) IDEInfo(ctx BaseModuleContext, ideInfo *IdeInfo) BaseModuleName() string } Loading
android/neverallow.go +30 −23 Original line number Diff line number Diff line Loading @@ -287,7 +287,7 @@ func neverallowMutator(ctx BottomUpMutatorContext) { continue } if !n.appliesToProperties(properties) { if !n.appliesToProperties(ctx, properties) { continue } Loading Loading @@ -604,9 +604,9 @@ func (r *rule) appliesToModuleType(moduleType string) bool { return (len(r.moduleTypes) == 0 || InList(moduleType, r.moduleTypes)) && !InList(moduleType, r.unlessModuleTypes) } func (r *rule) appliesToProperties(properties []interface{}) bool { includeProps := hasAllProperties(properties, r.props) excludeProps := hasAnyProperty(properties, r.unlessProps) func (r *rule) appliesToProperties(ctx BottomUpMutatorContext, properties []interface{}) bool { includeProps := hasAllProperties(ctx, properties, r.props) excludeProps := hasAnyProperty(ctx, properties, r.unlessProps) return includeProps && !excludeProps } Loading Loading @@ -644,25 +644,25 @@ func fieldNamesForProperties(propertyNames string) []string { return names } func hasAnyProperty(properties []interface{}, props []ruleProperty) bool { func hasAnyProperty(ctx BottomUpMutatorContext, properties []interface{}, props []ruleProperty) bool { for _, v := range props { if hasProperty(properties, v) { if hasProperty(ctx, properties, v) { return true } } return false } func hasAllProperties(properties []interface{}, props []ruleProperty) bool { func hasAllProperties(ctx BottomUpMutatorContext, properties []interface{}, props []ruleProperty) bool { for _, v := range props { if !hasProperty(properties, v) { if !hasProperty(ctx, properties, v) { return false } } return true } func hasProperty(properties []interface{}, prop ruleProperty) bool { func hasProperty(ctx BottomUpMutatorContext, properties []interface{}, prop ruleProperty) bool { for _, propertyStruct := range properties { propertiesValue := reflect.ValueOf(propertyStruct).Elem() for _, v := range prop.fields { Loading @@ -679,14 +679,14 @@ func hasProperty(properties []interface{}, prop ruleProperty) bool { return prop.matcher.Test(value) } if matchValue(propertiesValue, check) { if matchValue(ctx, propertiesValue, check) { return true } } 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() { return false } Loading @@ -698,19 +698,26 @@ func matchValue(value reflect.Value, check func(string) bool) bool { value = value.Elem() } switch value.Kind() { case reflect.String: return check(value.String()) case reflect.Bool: return check(strconv.FormatBool(value.Bool())) case reflect.Int: return check(strconv.FormatInt(value.Int(), 10)) case reflect.Slice: slice, ok := value.Interface().([]string) if !ok { panic("Can only handle slice of string") switch v := value.Interface().(type) { case string: return check(v) case bool: return check(strconv.FormatBool(v)) case int: return check(strconv.FormatInt((int64)(v), 10)) case []string: for _, v := range v { if check(v) { 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) { return true } Loading
apex/apex.go +1 −1 Original line number Diff line number Diff line Loading @@ -2873,7 +2873,7 @@ func isStaticExecutableAllowed(apex string, exec string) bool { } // 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.Bootclasspath_fragments...) dpInfo.Deps = append(dpInfo.Deps, a.properties.ResolvedSystemserverclasspathFragments...) Loading
genrule/genrule.go +1 −1 Original line number Diff line number Diff line Loading @@ -625,7 +625,7 @@ func (g *Module) setOutputFiles(ctx android.ModuleContext) { } // 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()...) for _, src := range g.properties.ResolvedSrcs { if strings.HasPrefix(src, ":") { Loading
java/aar.go +5 −5 Original line number Diff line number Diff line Loading @@ -914,12 +914,12 @@ func (a *AndroidLibrary) setOutputFiles(ctx android.ModuleContext) { setOutputFiles(ctx, a.Library.Module) } func (a *AndroidLibrary) IDEInfo(dpInfo *android.IdeInfo) { a.Library.IDEInfo(dpInfo) a.aapt.IDEInfo(dpInfo) func (a *AndroidLibrary) IDEInfo(ctx android.BaseModuleContext, dpInfo *android.IdeInfo) { a.Library.IDEInfo(ctx, 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 { dpInfo.Jars = append(dpInfo.Jars, a.rJar.String()) } Loading Loading @@ -1451,6 +1451,6 @@ func AARImportFactory() android.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()) }