Loading android/mutator.go +12 −0 Original line number Diff line number Diff line Loading @@ -117,6 +117,8 @@ type TopDownMutator func(TopDownMutatorContext) type TopDownMutatorContext interface { BaseModuleContext MutatorName() string Rename(name string) CreateModule(blueprint.ModuleFactory, ...interface{}) Loading @@ -132,6 +134,8 @@ type BottomUpMutator func(BottomUpMutatorContext) type BottomUpMutatorContext interface { BaseModuleContext MutatorName() string Rename(name string) AddDependency(module blueprint.Module, tag blueprint.DependencyTag, name ...string) Loading Loading @@ -229,6 +233,10 @@ func (t *topDownMutatorContext) PrependProperties(props ...interface{}) { // non-overridden method has to be forwarded. There are fewer non-overridden methods, so use the latter. The following // methods forward to the identical blueprint versions for topDownMutatorContext and bottomUpMutatorContext. func (t *topDownMutatorContext) MutatorName() string { return t.bp.MutatorName() } func (t *topDownMutatorContext) Rename(name string) { t.bp.Rename(name) } Loading @@ -237,6 +245,10 @@ func (t *topDownMutatorContext) CreateModule(factory blueprint.ModuleFactory, pr t.bp.CreateModule(factory, props...) } func (b *bottomUpMutatorContext) MutatorName() string { return b.bp.MutatorName() } func (b *bottomUpMutatorContext) Rename(name string) { b.bp.Rename(name) } Loading android/mutator_test.go +0 −8 Original line number Diff line number Diff line Loading @@ -15,8 +15,6 @@ package android import ( "io/ioutil" "os" "reflect" "testing" Loading Loading @@ -56,12 +54,6 @@ func addMissingDependenciesMutator(ctx TopDownMutatorContext) { } func TestMutatorAddMissingDependencies(t *testing.T) { buildDir, err := ioutil.TempDir("", "soong_mutator_test") if err != nil { t.Fatal(err) } defer os.RemoveAll(buildDir) config := TestConfig(buildDir, nil) config.TestProductVariables.Allow_missing_dependencies = proptools.BoolPtr(true) Loading android/package_test.go +2 −10 Original line number Diff line number Diff line package android import ( "io/ioutil" "os" "testing" ) Loading Loading @@ -58,15 +56,9 @@ var packageTests = []struct { } func TestPackage(t *testing.T) { buildDir, err := ioutil.TempDir("", "soong_package_test") if err != nil { t.Fatal(err) } defer os.RemoveAll(buildDir) for _, test := range packageTests { t.Run(test.name, func(t *testing.T) { _, errs := testPackage(buildDir, test.fs) _, errs := testPackage(test.fs) expectedErrors := test.expectedErrors if expectedErrors == nil { Loading @@ -89,7 +81,7 @@ func TestPackage(t *testing.T) { } } func testPackage(buildDir string, fs map[string][]byte) (*TestContext, []error) { func testPackage(fs map[string][]byte) (*TestContext, []error) { // Create a new config per test as visibility information is stored in the config. config := TestArchConfig(buildDir, nil) Loading android/path_properties_test.go +0 −8 Original line number Diff line number Diff line Loading @@ -15,8 +15,6 @@ package android import ( "io/ioutil" "os" "reflect" "testing" ) Loading Loading @@ -85,12 +83,6 @@ func TestPathDepsMutator(t *testing.T) { }, } buildDir, err := ioutil.TempDir("", "soong_path_properties_test") if err != nil { t.Fatal(err) } defer os.RemoveAll(buildDir) for _, test := range tests { t.Run(test.name, func(t *testing.T) { config := TestArchConfig(buildDir, nil) Loading Loading
android/mutator.go +12 −0 Original line number Diff line number Diff line Loading @@ -117,6 +117,8 @@ type TopDownMutator func(TopDownMutatorContext) type TopDownMutatorContext interface { BaseModuleContext MutatorName() string Rename(name string) CreateModule(blueprint.ModuleFactory, ...interface{}) Loading @@ -132,6 +134,8 @@ type BottomUpMutator func(BottomUpMutatorContext) type BottomUpMutatorContext interface { BaseModuleContext MutatorName() string Rename(name string) AddDependency(module blueprint.Module, tag blueprint.DependencyTag, name ...string) Loading Loading @@ -229,6 +233,10 @@ func (t *topDownMutatorContext) PrependProperties(props ...interface{}) { // non-overridden method has to be forwarded. There are fewer non-overridden methods, so use the latter. The following // methods forward to the identical blueprint versions for topDownMutatorContext and bottomUpMutatorContext. func (t *topDownMutatorContext) MutatorName() string { return t.bp.MutatorName() } func (t *topDownMutatorContext) Rename(name string) { t.bp.Rename(name) } Loading @@ -237,6 +245,10 @@ func (t *topDownMutatorContext) CreateModule(factory blueprint.ModuleFactory, pr t.bp.CreateModule(factory, props...) } func (b *bottomUpMutatorContext) MutatorName() string { return b.bp.MutatorName() } func (b *bottomUpMutatorContext) Rename(name string) { b.bp.Rename(name) } Loading
android/mutator_test.go +0 −8 Original line number Diff line number Diff line Loading @@ -15,8 +15,6 @@ package android import ( "io/ioutil" "os" "reflect" "testing" Loading Loading @@ -56,12 +54,6 @@ func addMissingDependenciesMutator(ctx TopDownMutatorContext) { } func TestMutatorAddMissingDependencies(t *testing.T) { buildDir, err := ioutil.TempDir("", "soong_mutator_test") if err != nil { t.Fatal(err) } defer os.RemoveAll(buildDir) config := TestConfig(buildDir, nil) config.TestProductVariables.Allow_missing_dependencies = proptools.BoolPtr(true) Loading
android/package_test.go +2 −10 Original line number Diff line number Diff line package android import ( "io/ioutil" "os" "testing" ) Loading Loading @@ -58,15 +56,9 @@ var packageTests = []struct { } func TestPackage(t *testing.T) { buildDir, err := ioutil.TempDir("", "soong_package_test") if err != nil { t.Fatal(err) } defer os.RemoveAll(buildDir) for _, test := range packageTests { t.Run(test.name, func(t *testing.T) { _, errs := testPackage(buildDir, test.fs) _, errs := testPackage(test.fs) expectedErrors := test.expectedErrors if expectedErrors == nil { Loading @@ -89,7 +81,7 @@ func TestPackage(t *testing.T) { } } func testPackage(buildDir string, fs map[string][]byte) (*TestContext, []error) { func testPackage(fs map[string][]byte) (*TestContext, []error) { // Create a new config per test as visibility information is stored in the config. config := TestArchConfig(buildDir, nil) Loading
android/path_properties_test.go +0 −8 Original line number Diff line number Diff line Loading @@ -15,8 +15,6 @@ package android import ( "io/ioutil" "os" "reflect" "testing" ) Loading Loading @@ -85,12 +83,6 @@ func TestPathDepsMutator(t *testing.T) { }, } buildDir, err := ioutil.TempDir("", "soong_path_properties_test") if err != nil { t.Fatal(err) } defer os.RemoveAll(buildDir) for _, test := range tests { t.Run(test.name, func(t *testing.T) { config := TestArchConfig(buildDir, nil) Loading