Remove empty DepsMutator methods

Add an empty DepsMutator to ModuleBase so it doesn't have to be
implemented on every module that doesn't need it.

Test: all soong tests
Change-Id: I545a832a0dbf27386d3080377a75ea482cd9ce59
This commit is contained in:
Colin Cross 2019-02-01 16:53:07 -08:00
parent a74ca046da
commit 5f692ec219
15 changed files with 3 additions and 51 deletions

View file

@ -481,6 +481,8 @@ type ModuleBase struct {
prefer32 func(ctx BaseModuleContext, base *ModuleBase, class OsClass) bool
}
func (a *ModuleBase) DepsMutator(BottomUpMutatorContext) {}
func (a *ModuleBase) AddProperties(props ...interface{}) {
a.registerProps = append(a.registerProps, props...)
}

View file

@ -366,9 +366,6 @@ type NamespaceModule struct {
}
}
func (n *NamespaceModule) DepsMutator(context BottomUpMutatorContext) {
}
func (n *NamespaceModule) GenerateAndroidBuildActions(ctx ModuleContext) {
}

View file

@ -222,9 +222,6 @@ func newMockCcLibraryModule() Module {
return m
}
func (p *mockCcLibraryModule) DepsMutator(ctx BottomUpMutatorContext) {
}
func (p *mockCcLibraryModule) GenerateAndroidBuildActions(ModuleContext) {
}
@ -244,8 +241,5 @@ func newMockJavaLibraryModule() Module {
return m
}
func (p *mockJavaLibraryModule) DepsMutator(ctx BottomUpMutatorContext) {
}
func (p *mockJavaLibraryModule) GenerateAndroidBuildActions(ModuleContext) {
}

View file

@ -212,9 +212,6 @@ func (p *prebuiltModule) Name() string {
return p.prebuilt.Name(p.ModuleBase.Name())
}
func (p *prebuiltModule) DepsMutator(ctx BottomUpMutatorContext) {
}
func (p *prebuiltModule) GenerateAndroidBuildActions(ModuleContext) {
}

View file

@ -19,6 +19,7 @@ import (
"io"
"android/soong/android"
"github.com/google/blueprint/proptools"
)
@ -61,9 +62,6 @@ func (m *apexKey) installable() bool {
return m.properties.Installable == nil || proptools.Bool(m.properties.Installable)
}
func (m *apexKey) DepsMutator(ctx android.BottomUpMutatorContext) {
}
func (m *apexKey) GenerateAndroidBuildActions(ctx android.ModuleContext) {
if ctx.Config().FlattenApex() && !ctx.Config().UnbundledBuild() {
// Flattened APEXes are not signed

View file

@ -1869,9 +1869,6 @@ type Defaults struct {
func (*Defaults) GenerateAndroidBuildActions(ctx android.ModuleContext) {
}
func (d *Defaults) DepsMutator(ctx android.BottomUpMutatorContext) {
}
func defaultsFactory() android.Module {
return DefaultsFactory()
}

View file

@ -93,9 +93,6 @@ type headerModule struct {
licensePath android.ModuleSrcPath
}
func (m *headerModule) DepsMutator(ctx android.BottomUpMutatorContext) {
}
func getHeaderInstallDir(ctx android.ModuleContext, header android.Path, from string,
to string) android.OutputPath {
// Output path is the sysroot base + "usr/include" + to directory + directory component
@ -210,9 +207,6 @@ type versionedHeaderModule struct {
licensePath android.ModuleSrcPath
}
func (m *versionedHeaderModule) DepsMutator(ctx android.BottomUpMutatorContext) {
}
func (m *versionedHeaderModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
if String(m.properties.License) == "" {
ctx.PropertyErrorf("license", "field is required")
@ -335,9 +329,6 @@ type preprocessedHeadersModule struct {
licensePath android.ModuleSrcPath
}
func (m *preprocessedHeadersModule) DepsMutator(ctx android.BottomUpMutatorContext) {
}
func (m *preprocessedHeadersModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
if String(m.properties.License) == "" {
ctx.PropertyErrorf("license", "field is required")

View file

@ -528,9 +528,6 @@ type Defaults struct {
func (*Defaults) GenerateAndroidBuildActions(ctx android.ModuleContext) {
}
func (d *Defaults) DepsMutator(ctx android.BottomUpMutatorContext) {
}
func defaultsFactory() android.Module {
return DefaultsFactory()
}

View file

@ -519,8 +519,6 @@ func toolFactory() android.Module {
return module
}
func (t *testTool) DepsMutator(ctx android.BottomUpMutatorContext) {}
func (t *testTool) GenerateAndroidBuildActions(ctx android.ModuleContext) {
t.outputFile = android.PathForTesting("out", ctx.ModuleName())
}

View file

@ -503,9 +503,6 @@ func AndroidAppCertificateFactory() android.Module {
return module
}
func (c *AndroidAppCertificate) DepsMutator(ctx android.BottomUpMutatorContext) {
}
func (c *AndroidAppCertificate) GenerateAndroidBuildActions(ctx android.ModuleContext) {
cert := String(c.properties.Certificate)
c.Certificate = Certificate{

View file

@ -1816,9 +1816,6 @@ type DocDefaults struct {
func (*DocDefaults) GenerateAndroidBuildActions(ctx android.ModuleContext) {
}
func (d *DocDefaults) DepsMutator(ctx android.BottomUpMutatorContext) {
}
func DocDefaultsFactory() android.Module {
module := &DocDefaults{}

View file

@ -1840,9 +1840,6 @@ type Defaults struct {
func (*Defaults) GenerateAndroidBuildActions(ctx android.ModuleContext) {
}
func (d *Defaults) DepsMutator(ctx android.BottomUpMutatorContext) {
}
func defaultsFactory() android.Module {
return DefaultsFactory()
}

View file

@ -47,10 +47,6 @@ type prebuiltApis struct {
properties prebuiltApisProperties
}
func (module *prebuiltApis) DepsMutator(ctx android.BottomUpMutatorContext) {
// no need to implement
}
func (module *prebuiltApis) GenerateAndroidBuildActions(ctx android.ModuleContext) {
// no need to implement
}

View file

@ -38,9 +38,6 @@ func PhonyFactory() android.Module {
return module
}
func (p *phony) DepsMutator(ctx android.BottomUpMutatorContext) {
}
func (p *phony) GenerateAndroidBuildActions(ctx android.ModuleContext) {
p.requiredModuleNames = ctx.RequiredModuleNames()
if len(p.requiredModuleNames) == 0 {

View file

@ -30,9 +30,6 @@ type Defaults struct {
func (d *Defaults) GenerateAndroidBuildActions(ctx android.ModuleContext) {
}
func (d *Defaults) DepsMutator(ctx android.BottomUpMutatorContext) {
}
func defaultsFactory() android.Module {
return DefaultsFactory()
}