Loading android/path_properties.go +8 −7 Original line number Diff line number Diff line Loading @@ -35,8 +35,11 @@ func pathDepsMutator(ctx BottomUpMutatorContext) { props := m.base().generalProperties var pathProperties []string for _, ps := range props { pathProperties := pathPropertiesForPropertyStruct(ctx, ps) pathProperties = append(pathProperties, pathPropertiesForPropertyStruct(ctx, ps)...) } pathProperties = FirstUniqueStrings(pathProperties) for _, s := range pathProperties { Loading @@ -44,8 +47,6 @@ func pathDepsMutator(ctx BottomUpMutatorContext) { ctx.AddDependency(ctx.Module(), sourceOrOutputDepTag(t), m) } } } } // pathPropertiesForPropertyStruct uses the indexes of properties that are tagged with android:"path" to extract Loading android/path_properties_test.go +13 −1 Original line number Diff line number Diff line Loading @@ -28,12 +28,17 @@ type pathDepsMutatorTestModule struct { Qux string } // A second property struct with a duplicate property name props2 struct { Foo string `android:"path"` } sourceDeps []string } func pathDepsMutatorTestModuleFactory() Module { module := &pathDepsMutatorTestModule{} module.AddProperties(&module.props) module.AddProperties(&module.props, &module.props2) InitAndroidArchModule(module, DeviceSupported, MultilibBoth) return module } Loading @@ -44,6 +49,13 @@ func (p *pathDepsMutatorTestModule) GenerateAndroidBuildActions(ctx ModuleContex p.sourceDeps = append(p.sourceDeps, ctx.OtherModuleName(dep)) } }) if p.props.Foo != "" { // Make sure there is only one dependency on a module listed in a property present in multiple property structs if ctx.GetDirectDepWithTag(SrcIsModule(p.props.Foo), sourceOrOutputDepTag("")) == nil { ctx.ModuleErrorf("GetDirectDepWithTag failed") } } } func TestPathDepsMutator(t *testing.T) { Loading java/java.go +1 −5 Original line number Diff line number Diff line Loading @@ -2040,7 +2040,7 @@ func ImportFactoryHost() android.Module { // dex_import module type DexImportProperties struct { Jars []string Jars []string `android:"path"` } type DexImport struct { Loading Loading @@ -2068,10 +2068,6 @@ func (j *DexImport) Name() string { return j.prebuilt.Name(j.ModuleBase.Name()) } func (j *DexImport) DepsMutator(ctx android.BottomUpMutatorContext) { android.ExtractSourcesDeps(ctx, j.properties.Jars) } func (j *DexImport) GenerateAndroidBuildActions(ctx android.ModuleContext) { if len(j.properties.Jars) != 1 { ctx.PropertyErrorf("jars", "exactly one jar must be provided") Loading Loading
android/path_properties.go +8 −7 Original line number Diff line number Diff line Loading @@ -35,8 +35,11 @@ func pathDepsMutator(ctx BottomUpMutatorContext) { props := m.base().generalProperties var pathProperties []string for _, ps := range props { pathProperties := pathPropertiesForPropertyStruct(ctx, ps) pathProperties = append(pathProperties, pathPropertiesForPropertyStruct(ctx, ps)...) } pathProperties = FirstUniqueStrings(pathProperties) for _, s := range pathProperties { Loading @@ -44,8 +47,6 @@ func pathDepsMutator(ctx BottomUpMutatorContext) { ctx.AddDependency(ctx.Module(), sourceOrOutputDepTag(t), m) } } } } // pathPropertiesForPropertyStruct uses the indexes of properties that are tagged with android:"path" to extract Loading
android/path_properties_test.go +13 −1 Original line number Diff line number Diff line Loading @@ -28,12 +28,17 @@ type pathDepsMutatorTestModule struct { Qux string } // A second property struct with a duplicate property name props2 struct { Foo string `android:"path"` } sourceDeps []string } func pathDepsMutatorTestModuleFactory() Module { module := &pathDepsMutatorTestModule{} module.AddProperties(&module.props) module.AddProperties(&module.props, &module.props2) InitAndroidArchModule(module, DeviceSupported, MultilibBoth) return module } Loading @@ -44,6 +49,13 @@ func (p *pathDepsMutatorTestModule) GenerateAndroidBuildActions(ctx ModuleContex p.sourceDeps = append(p.sourceDeps, ctx.OtherModuleName(dep)) } }) if p.props.Foo != "" { // Make sure there is only one dependency on a module listed in a property present in multiple property structs if ctx.GetDirectDepWithTag(SrcIsModule(p.props.Foo), sourceOrOutputDepTag("")) == nil { ctx.ModuleErrorf("GetDirectDepWithTag failed") } } } func TestPathDepsMutator(t *testing.T) { Loading
java/java.go +1 −5 Original line number Diff line number Diff line Loading @@ -2040,7 +2040,7 @@ func ImportFactoryHost() android.Module { // dex_import module type DexImportProperties struct { Jars []string Jars []string `android:"path"` } type DexImport struct { Loading Loading @@ -2068,10 +2068,6 @@ func (j *DexImport) Name() string { return j.prebuilt.Name(j.ModuleBase.Name()) } func (j *DexImport) DepsMutator(ctx android.BottomUpMutatorContext) { android.ExtractSourcesDeps(ctx, j.properties.Jars) } func (j *DexImport) GenerateAndroidBuildActions(ctx android.ModuleContext) { if len(j.properties.Jars) != 1 { ctx.PropertyErrorf("jars", "exactly one jar must be provided") Loading