Remove bp2build deps mutator
Refactor bp2build to retrieve modules directly by name, instead of via DirectDeps. This functions properly as bp2build has no need for variant information of the blueprint graph. Test: USE_BAZEL_ANALYSIS=1 m fmtlib Change-Id: Ief4b67bc56f24929871af772f3a742f07085bf8c
This commit is contained in:
@@ -73,6 +73,7 @@ type BazelConversionPathContext interface {
|
|||||||
EarlyModulePathContext
|
EarlyModulePathContext
|
||||||
|
|
||||||
GetDirectDep(name string) (blueprint.Module, blueprint.DependencyTag)
|
GetDirectDep(name string) (blueprint.Module, blueprint.DependencyTag)
|
||||||
|
ModuleFromName(name string) (blueprint.Module, bool)
|
||||||
Module() Module
|
Module() Module
|
||||||
ModuleType() string
|
ModuleType() string
|
||||||
OtherModuleName(m blueprint.Module) string
|
OtherModuleName(m blueprint.Module) string
|
||||||
@@ -331,11 +332,9 @@ func expandSrcsForBazel(ctx BazelConversionPathContext, paths, expandedExcludes
|
|||||||
// module. The label will be relative to the current directory if appropriate. The dependency must
|
// module. The label will be relative to the current directory if appropriate. The dependency must
|
||||||
// already be resolved by either deps mutator or path deps mutator.
|
// already be resolved by either deps mutator or path deps mutator.
|
||||||
func getOtherModuleLabel(ctx BazelConversionPathContext, dep, tag string, isWholeLibs bool) bazel.Label {
|
func getOtherModuleLabel(ctx BazelConversionPathContext, dep, tag string, isWholeLibs bool) bazel.Label {
|
||||||
m, _ := ctx.GetDirectDep(dep)
|
m, _ := ctx.ModuleFromName(dep)
|
||||||
if m == nil {
|
if m == nil {
|
||||||
panic(fmt.Errorf(`Cannot get direct dep %q of %q.
|
panic(fmt.Errorf("No module named %q found, but was a direct dep of %q", dep, ctx.Module().Name()))
|
||||||
This is likely because it was not added via AddDependency().
|
|
||||||
This may be due a mutator skipped during bp2build.`, dep, ctx.Module().Name()))
|
|
||||||
}
|
}
|
||||||
otherLabel := bazelModuleLabel(ctx, m, tag)
|
otherLabel := bazelModuleLabel(ctx, m, tag)
|
||||||
label := bazelModuleLabel(ctx, ctx.Module(), "")
|
label := bazelModuleLabel(ctx, ctx.Module(), "")
|
||||||
|
@@ -223,6 +223,8 @@ type BaseModuleContext interface {
|
|||||||
// the first DependencyTag.
|
// the first DependencyTag.
|
||||||
GetDirectDep(name string) (blueprint.Module, blueprint.DependencyTag)
|
GetDirectDep(name string) (blueprint.Module, blueprint.DependencyTag)
|
||||||
|
|
||||||
|
ModuleFromName(name string) (blueprint.Module, bool)
|
||||||
|
|
||||||
// VisitDirectDepsBlueprint calls visit for each direct dependency. If there are multiple
|
// VisitDirectDepsBlueprint calls visit for each direct dependency. If there are multiple
|
||||||
// direct dependencies on the same module visit will be called multiple times on that module
|
// direct dependencies on the same module visit will be called multiple times on that module
|
||||||
// and OtherModuleDependencyTag will return a different tag for each.
|
// and OtherModuleDependencyTag will return a different tag for each.
|
||||||
@@ -2032,8 +2034,13 @@ type baseModuleContext struct {
|
|||||||
tagPath []blueprint.DependencyTag
|
tagPath []blueprint.DependencyTag
|
||||||
|
|
||||||
strictVisitDeps bool // If true, enforce that all dependencies are enabled
|
strictVisitDeps bool // If true, enforce that all dependencies are enabled
|
||||||
|
|
||||||
|
bazelConversionMode bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (b *baseModuleContext) BazelConversionMode() bool {
|
||||||
|
return b.bazelConversionMode
|
||||||
|
}
|
||||||
func (b *baseModuleContext) OtherModuleName(m blueprint.Module) string {
|
func (b *baseModuleContext) OtherModuleName(m blueprint.Module) string {
|
||||||
return b.bp.OtherModuleName(m)
|
return b.bp.OtherModuleName(m)
|
||||||
}
|
}
|
||||||
@@ -2373,6 +2380,18 @@ func (b *baseModuleContext) GetDirectDep(name string) (blueprint.Module, bluepri
|
|||||||
return b.getDirectDepFirstTag(name)
|
return b.getDirectDepFirstTag(name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (b *baseModuleContext) ModuleFromName(name string) (blueprint.Module, bool) {
|
||||||
|
if !b.BazelConversionMode() {
|
||||||
|
panic("cannot call ModuleFromName if not in bazel conversion mode")
|
||||||
|
}
|
||||||
|
if len(name) > 1 && (name[0] == ':' || (name[0] == '/' && name[1] == '/')) {
|
||||||
|
moduleName, _ := SrcIsModuleWithTag(name)
|
||||||
|
return b.bp.ModuleFromName(moduleName)
|
||||||
|
} else {
|
||||||
|
return b.bp.ModuleFromName(name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (b *baseModuleContext) VisitDirectDepsBlueprint(visit func(blueprint.Module)) {
|
func (b *baseModuleContext) VisitDirectDepsBlueprint(visit func(blueprint.Module)) {
|
||||||
b.bp.VisitDirectDeps(visit)
|
b.bp.VisitDirectDeps(visit)
|
||||||
}
|
}
|
||||||
|
@@ -35,7 +35,7 @@ import (
|
|||||||
// continue on to GenerateAndroidBuildActions
|
// continue on to GenerateAndroidBuildActions
|
||||||
|
|
||||||
// RegisterMutatorsForBazelConversion is a alternate registration pipeline for bp2build. Exported for testing.
|
// RegisterMutatorsForBazelConversion is a alternate registration pipeline for bp2build. Exported for testing.
|
||||||
func RegisterMutatorsForBazelConversion(ctx *Context, preArchMutators, depsMutators, bp2buildMutators []RegisterMutatorFunc) {
|
func RegisterMutatorsForBazelConversion(ctx *Context, preArchMutators, bp2buildMutators []RegisterMutatorFunc) {
|
||||||
mctx := ®isterMutatorsContext{
|
mctx := ®isterMutatorsContext{
|
||||||
bazelConversionMode: true,
|
bazelConversionMode: true,
|
||||||
}
|
}
|
||||||
@@ -53,16 +53,6 @@ func RegisterMutatorsForBazelConversion(ctx *Context, preArchMutators, depsMutat
|
|||||||
f(mctx)
|
f(mctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
bp2buildDepsMutators = append([]RegisterMutatorFunc{
|
|
||||||
registerDepsMutatorBp2Build,
|
|
||||||
registerPathDepsMutator,
|
|
||||||
registerBp2buildArchPathDepsMutator,
|
|
||||||
}, depsMutators...)
|
|
||||||
|
|
||||||
for _, f := range bp2buildDepsMutators {
|
|
||||||
f(mctx)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Register bp2build mutators
|
// Register bp2build mutators
|
||||||
for _, f := range bp2buildMutators {
|
for _, f := range bp2buildMutators {
|
||||||
f(mctx)
|
f(mctx)
|
||||||
@@ -227,7 +217,6 @@ func FinalDepsMutators(f RegisterMutatorFunc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var bp2buildPreArchMutators = []RegisterMutatorFunc{}
|
var bp2buildPreArchMutators = []RegisterMutatorFunc{}
|
||||||
var bp2buildDepsMutators = []RegisterMutatorFunc{}
|
|
||||||
var bp2buildMutators = map[string]RegisterMutatorFunc{}
|
var bp2buildMutators = map[string]RegisterMutatorFunc{}
|
||||||
|
|
||||||
// See http://b/192523357
|
// See http://b/192523357
|
||||||
@@ -254,12 +243,6 @@ func PreArchBp2BuildMutators(f RegisterMutatorFunc) {
|
|||||||
bp2buildPreArchMutators = append(bp2buildPreArchMutators, f)
|
bp2buildPreArchMutators = append(bp2buildPreArchMutators, f)
|
||||||
}
|
}
|
||||||
|
|
||||||
// DepsBp2BuildMutators adds mutators to be register for converting Android Blueprint modules into
|
|
||||||
// Bazel BUILD targets that should run prior to conversion to resolve dependencies.
|
|
||||||
func DepsBp2BuildMutators(f RegisterMutatorFunc) {
|
|
||||||
bp2buildDepsMutators = append(bp2buildDepsMutators, f)
|
|
||||||
}
|
|
||||||
|
|
||||||
type BaseMutatorContext interface {
|
type BaseMutatorContext interface {
|
||||||
BaseModuleContext
|
BaseModuleContext
|
||||||
|
|
||||||
@@ -269,6 +252,9 @@ type BaseMutatorContext interface {
|
|||||||
// Rename all variants of a module. The new name is not visible to calls to ModuleName,
|
// Rename all variants of a module. The new name is not visible to calls to ModuleName,
|
||||||
// AddDependency or OtherModuleName until after this mutator pass is complete.
|
// AddDependency or OtherModuleName until after this mutator pass is complete.
|
||||||
Rename(name string)
|
Rename(name string)
|
||||||
|
|
||||||
|
// BazelConversionMode returns whether this mutator is being run as part of Bazel Conversion.
|
||||||
|
BazelConversionMode() bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type TopDownMutator func(TopDownMutatorContext)
|
type TopDownMutator func(TopDownMutatorContext)
|
||||||
@@ -410,26 +396,24 @@ type BottomUpMutatorContext interface {
|
|||||||
// variant of the current module. The value should not be modified after being passed to
|
// variant of the current module. The value should not be modified after being passed to
|
||||||
// SetVariationProvider.
|
// SetVariationProvider.
|
||||||
SetVariationProvider(module blueprint.Module, provider blueprint.ProviderKey, value interface{})
|
SetVariationProvider(module blueprint.Module, provider blueprint.ProviderKey, value interface{})
|
||||||
|
|
||||||
// BazelConversionMode returns whether this mutator is being run as part of Bazel Conversion.
|
|
||||||
BazelConversionMode() bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type bottomUpMutatorContext struct {
|
type bottomUpMutatorContext struct {
|
||||||
bp blueprint.BottomUpMutatorContext
|
bp blueprint.BottomUpMutatorContext
|
||||||
baseModuleContext
|
baseModuleContext
|
||||||
finalPhase bool
|
finalPhase bool
|
||||||
bazelConversionMode bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func bottomUpMutatorContextFactory(ctx blueprint.BottomUpMutatorContext, a Module,
|
func bottomUpMutatorContextFactory(ctx blueprint.BottomUpMutatorContext, a Module,
|
||||||
finalPhase, bazelConversionMode bool) BottomUpMutatorContext {
|
finalPhase, bazelConversionMode bool) BottomUpMutatorContext {
|
||||||
|
|
||||||
|
moduleContext := a.base().baseModuleContextFactory(ctx)
|
||||||
|
moduleContext.bazelConversionMode = bazelConversionMode
|
||||||
|
|
||||||
return &bottomUpMutatorContext{
|
return &bottomUpMutatorContext{
|
||||||
bp: ctx,
|
bp: ctx,
|
||||||
baseModuleContext: a.base().baseModuleContextFactory(ctx),
|
baseModuleContext: a.base().baseModuleContextFactory(ctx),
|
||||||
finalPhase: finalPhase,
|
finalPhase: finalPhase,
|
||||||
bazelConversionMode: bazelConversionMode,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -462,9 +446,11 @@ func (x *registerMutatorsContext) mutatorName(name string) string {
|
|||||||
func (x *registerMutatorsContext) TopDown(name string, m TopDownMutator) MutatorHandle {
|
func (x *registerMutatorsContext) TopDown(name string, m TopDownMutator) MutatorHandle {
|
||||||
f := func(ctx blueprint.TopDownMutatorContext) {
|
f := func(ctx blueprint.TopDownMutatorContext) {
|
||||||
if a, ok := ctx.Module().(Module); ok {
|
if a, ok := ctx.Module().(Module); ok {
|
||||||
|
moduleContext := a.base().baseModuleContextFactory(ctx)
|
||||||
|
moduleContext.bazelConversionMode = x.bazelConversionMode
|
||||||
actx := &topDownMutatorContext{
|
actx := &topDownMutatorContext{
|
||||||
bp: ctx,
|
bp: ctx,
|
||||||
baseModuleContext: a.base().baseModuleContextFactory(ctx),
|
baseModuleContext: moduleContext,
|
||||||
}
|
}
|
||||||
m(actx)
|
m(actx)
|
||||||
}
|
}
|
||||||
@@ -733,7 +719,3 @@ func (b *bottomUpMutatorContext) CreateAliasVariation(fromVariationName, toVaria
|
|||||||
func (b *bottomUpMutatorContext) SetVariationProvider(module blueprint.Module, provider blueprint.ProviderKey, value interface{}) {
|
func (b *bottomUpMutatorContext) SetVariationProvider(module blueprint.Module, provider blueprint.ProviderKey, value interface{}) {
|
||||||
b.bp.SetVariationProvider(module, provider, value)
|
b.bp.SetVariationProvider(module, provider, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *bottomUpMutatorContext) BazelConversionMode() bool {
|
|
||||||
return b.bazelConversionMode
|
|
||||||
}
|
|
||||||
|
@@ -180,7 +180,7 @@ func (ctx *Context) RegisterForBazelConversion() {
|
|||||||
bp2buildMutatorList = append(bp2buildMutatorList, f)
|
bp2buildMutatorList = append(bp2buildMutatorList, f)
|
||||||
}
|
}
|
||||||
|
|
||||||
RegisterMutatorsForBazelConversion(ctx, bp2buildPreArchMutators, bp2buildDepsMutators, bp2buildMutatorList)
|
RegisterMutatorsForBazelConversion(ctx, bp2buildPreArchMutators, bp2buildMutatorList)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Register the pipeline of singletons, module types, and mutators for
|
// Register the pipeline of singletons, module types, and mutators for
|
||||||
|
@@ -171,9 +171,9 @@ func NewTestArchContext(config Config) *TestContext {
|
|||||||
|
|
||||||
type TestContext struct {
|
type TestContext struct {
|
||||||
*Context
|
*Context
|
||||||
preArch, preDeps, postDeps, finalDeps []RegisterMutatorFunc
|
preArch, preDeps, postDeps, finalDeps []RegisterMutatorFunc
|
||||||
bp2buildPreArch, bp2buildDeps, bp2buildMutators []RegisterMutatorFunc
|
bp2buildPreArch, bp2buildMutators []RegisterMutatorFunc
|
||||||
NameResolver *NameResolver
|
NameResolver *NameResolver
|
||||||
|
|
||||||
// The list of pre-singletons and singletons registered for the test.
|
// The list of pre-singletons and singletons registered for the test.
|
||||||
preSingletons, singletons sortableComponents
|
preSingletons, singletons sortableComponents
|
||||||
@@ -224,12 +224,6 @@ func (ctx *TestContext) PreArchBp2BuildMutators(f RegisterMutatorFunc) {
|
|||||||
ctx.bp2buildPreArch = append(ctx.bp2buildPreArch, f)
|
ctx.bp2buildPreArch = append(ctx.bp2buildPreArch, f)
|
||||||
}
|
}
|
||||||
|
|
||||||
// DepsBp2BuildMutators adds mutators to be register for converting Android Blueprint modules into
|
|
||||||
// Bazel BUILD targets that should run prior to conversion to resolve dependencies.
|
|
||||||
func (ctx *TestContext) DepsBp2BuildMutators(f RegisterMutatorFunc) {
|
|
||||||
ctx.bp2buildDeps = append(ctx.bp2buildDeps, f)
|
|
||||||
}
|
|
||||||
|
|
||||||
// registeredComponentOrder defines the order in which a sortableComponent type is registered at
|
// registeredComponentOrder defines the order in which a sortableComponent type is registered at
|
||||||
// runtime and provides support for reordering the components registered for a test in the same
|
// runtime and provides support for reordering the components registered for a test in the same
|
||||||
// way.
|
// way.
|
||||||
@@ -464,7 +458,7 @@ func (ctx *TestContext) Register() {
|
|||||||
|
|
||||||
// RegisterForBazelConversion prepares a test context for bp2build conversion.
|
// RegisterForBazelConversion prepares a test context for bp2build conversion.
|
||||||
func (ctx *TestContext) RegisterForBazelConversion() {
|
func (ctx *TestContext) RegisterForBazelConversion() {
|
||||||
RegisterMutatorsForBazelConversion(ctx.Context, ctx.bp2buildPreArch, ctx.bp2buildDeps, ctx.bp2buildMutators)
|
RegisterMutatorsForBazelConversion(ctx.Context, ctx.bp2buildPreArch, ctx.bp2buildMutators)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ctx *TestContext) ParseFileList(rootDir string, filePaths []string) (deps []string, errs []error) {
|
func (ctx *TestContext) ParseFileList(rootDir string, filePaths []string) (deps []string, errs []error) {
|
||||||
|
@@ -556,7 +556,6 @@ genrule {
|
|||||||
moduleTypeUnderTestFactory android.ModuleFactory
|
moduleTypeUnderTestFactory android.ModuleFactory
|
||||||
moduleTypeUnderTestBp2BuildMutator func(android.TopDownMutatorContext)
|
moduleTypeUnderTestBp2BuildMutator func(android.TopDownMutatorContext)
|
||||||
preArchMutators []android.RegisterMutatorFunc
|
preArchMutators []android.RegisterMutatorFunc
|
||||||
depsMutators []android.RegisterMutatorFunc
|
|
||||||
bp string
|
bp string
|
||||||
expectedBazelTargets []string
|
expectedBazelTargets []string
|
||||||
fs map[string]string
|
fs map[string]string
|
||||||
@@ -720,7 +719,6 @@ genrule {
|
|||||||
moduleTypeUnderTest: "genrule",
|
moduleTypeUnderTest: "genrule",
|
||||||
moduleTypeUnderTestFactory: genrule.GenRuleFactory,
|
moduleTypeUnderTestFactory: genrule.GenRuleFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: genrule.GenruleBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: genrule.GenruleBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{genrule.RegisterGenruleBp2BuildDeps},
|
|
||||||
bp: `genrule {
|
bp: `genrule {
|
||||||
name: "foo.tool",
|
name: "foo.tool",
|
||||||
out: ["foo_tool.out"],
|
out: ["foo_tool.out"],
|
||||||
@@ -758,7 +756,6 @@ genrule {
|
|||||||
moduleTypeUnderTest: "genrule",
|
moduleTypeUnderTest: "genrule",
|
||||||
moduleTypeUnderTestFactory: genrule.GenRuleFactory,
|
moduleTypeUnderTestFactory: genrule.GenRuleFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: genrule.GenruleBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: genrule.GenruleBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{genrule.RegisterGenruleBp2BuildDeps},
|
|
||||||
bp: `genrule {
|
bp: `genrule {
|
||||||
name: "foo.tools",
|
name: "foo.tools",
|
||||||
out: ["foo_tool.out", "foo_tool2.out"],
|
out: ["foo_tool.out", "foo_tool2.out"],
|
||||||
@@ -798,7 +795,6 @@ genrule {
|
|||||||
moduleTypeUnderTest: "genrule",
|
moduleTypeUnderTest: "genrule",
|
||||||
moduleTypeUnderTestFactory: genrule.GenRuleFactory,
|
moduleTypeUnderTestFactory: genrule.GenRuleFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: genrule.GenruleBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: genrule.GenruleBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{genrule.RegisterGenruleBp2BuildDeps},
|
|
||||||
bp: `genrule {
|
bp: `genrule {
|
||||||
name: "foo",
|
name: "foo",
|
||||||
out: ["foo.out"],
|
out: ["foo.out"],
|
||||||
@@ -822,7 +818,6 @@ genrule {
|
|||||||
moduleTypeUnderTest: "genrule",
|
moduleTypeUnderTest: "genrule",
|
||||||
moduleTypeUnderTestFactory: genrule.GenRuleFactory,
|
moduleTypeUnderTestFactory: genrule.GenRuleFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: genrule.GenruleBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: genrule.GenruleBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{genrule.RegisterGenruleBp2BuildDeps},
|
|
||||||
bp: `genrule {
|
bp: `genrule {
|
||||||
name: "foo",
|
name: "foo",
|
||||||
out: ["foo.out"],
|
out: ["foo.out"],
|
||||||
@@ -846,7 +841,6 @@ genrule {
|
|||||||
moduleTypeUnderTest: "genrule",
|
moduleTypeUnderTest: "genrule",
|
||||||
moduleTypeUnderTestFactory: genrule.GenRuleFactory,
|
moduleTypeUnderTestFactory: genrule.GenRuleFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: genrule.GenruleBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: genrule.GenruleBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{genrule.RegisterGenruleBp2BuildDeps},
|
|
||||||
bp: `genrule {
|
bp: `genrule {
|
||||||
name: "foo",
|
name: "foo",
|
||||||
out: ["foo.out"],
|
out: ["foo.out"],
|
||||||
@@ -873,7 +867,6 @@ genrule {
|
|||||||
moduleTypeUnderTest: "genrule",
|
moduleTypeUnderTest: "genrule",
|
||||||
moduleTypeUnderTestFactory: genrule.GenRuleFactory,
|
moduleTypeUnderTestFactory: genrule.GenRuleFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: genrule.GenruleBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: genrule.GenruleBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{genrule.RegisterGenruleBp2BuildDeps},
|
|
||||||
bp: `genrule {
|
bp: `genrule {
|
||||||
name: "foo",
|
name: "foo",
|
||||||
out: ["foo.out"],
|
out: ["foo.out"],
|
||||||
@@ -900,7 +893,6 @@ genrule {
|
|||||||
moduleTypeUnderTest: "genrule",
|
moduleTypeUnderTest: "genrule",
|
||||||
moduleTypeUnderTestFactory: genrule.GenRuleFactory,
|
moduleTypeUnderTestFactory: genrule.GenRuleFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: genrule.GenruleBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: genrule.GenruleBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{genrule.RegisterGenruleBp2BuildDeps},
|
|
||||||
bp: `genrule {
|
bp: `genrule {
|
||||||
name: "foo",
|
name: "foo",
|
||||||
out: ["foo.out"],
|
out: ["foo.out"],
|
||||||
@@ -933,9 +925,6 @@ genrule {
|
|||||||
config := android.TestConfig(buildDir, nil, testCase.bp, fs)
|
config := android.TestConfig(buildDir, nil, testCase.bp, fs)
|
||||||
ctx := android.NewTestContext(config)
|
ctx := android.NewTestContext(config)
|
||||||
ctx.RegisterModuleType(testCase.moduleTypeUnderTest, testCase.moduleTypeUnderTestFactory)
|
ctx.RegisterModuleType(testCase.moduleTypeUnderTest, testCase.moduleTypeUnderTestFactory)
|
||||||
for _, m := range testCase.depsMutators {
|
|
||||||
ctx.DepsBp2BuildMutators(m)
|
|
||||||
}
|
|
||||||
ctx.RegisterBp2BuildMutator(testCase.moduleTypeUnderTest, testCase.moduleTypeUnderTestBp2BuildMutator)
|
ctx.RegisterBp2BuildMutator(testCase.moduleTypeUnderTest, testCase.moduleTypeUnderTestBp2BuildMutator)
|
||||||
ctx.RegisterForBazelConversion()
|
ctx.RegisterForBazelConversion()
|
||||||
|
|
||||||
@@ -1370,7 +1359,6 @@ func TestCombineBuildFilesBp2buildTargets(t *testing.T) {
|
|||||||
moduleTypeUnderTestFactory android.ModuleFactory
|
moduleTypeUnderTestFactory android.ModuleFactory
|
||||||
moduleTypeUnderTestBp2BuildMutator func(android.TopDownMutatorContext)
|
moduleTypeUnderTestBp2BuildMutator func(android.TopDownMutatorContext)
|
||||||
preArchMutators []android.RegisterMutatorFunc
|
preArchMutators []android.RegisterMutatorFunc
|
||||||
depsMutators []android.RegisterMutatorFunc
|
|
||||||
bp string
|
bp string
|
||||||
expectedBazelTargets []string
|
expectedBazelTargets []string
|
||||||
fs map[string]string
|
fs map[string]string
|
||||||
@@ -1487,9 +1475,6 @@ func TestCombineBuildFilesBp2buildTargets(t *testing.T) {
|
|||||||
config := android.TestConfig(buildDir, nil, testCase.bp, fs)
|
config := android.TestConfig(buildDir, nil, testCase.bp, fs)
|
||||||
ctx := android.NewTestContext(config)
|
ctx := android.NewTestContext(config)
|
||||||
ctx.RegisterModuleType(testCase.moduleTypeUnderTest, testCase.moduleTypeUnderTestFactory)
|
ctx.RegisterModuleType(testCase.moduleTypeUnderTest, testCase.moduleTypeUnderTestFactory)
|
||||||
for _, m := range testCase.depsMutators {
|
|
||||||
ctx.DepsBp2BuildMutators(m)
|
|
||||||
}
|
|
||||||
ctx.RegisterBp2BuildMutator(testCase.moduleTypeUnderTest, testCase.moduleTypeUnderTestBp2BuildMutator)
|
ctx.RegisterBp2BuildMutator(testCase.moduleTypeUnderTest, testCase.moduleTypeUnderTestBp2BuildMutator)
|
||||||
ctx.RegisterForBazelConversion()
|
ctx.RegisterForBazelConversion()
|
||||||
|
|
||||||
|
@@ -73,9 +73,6 @@ func runBp2BuildTestCase(t *testing.T, registerModuleTypes func(ctx android.Regi
|
|||||||
registerModuleTypes(ctx)
|
registerModuleTypes(ctx)
|
||||||
ctx.RegisterModuleType(tc.moduleTypeUnderTest, tc.moduleTypeUnderTestFactory)
|
ctx.RegisterModuleType(tc.moduleTypeUnderTest, tc.moduleTypeUnderTestFactory)
|
||||||
ctx.RegisterBp2BuildConfig(bp2buildConfig)
|
ctx.RegisterBp2BuildConfig(bp2buildConfig)
|
||||||
for _, m := range tc.depsMutators {
|
|
||||||
ctx.DepsBp2BuildMutators(m)
|
|
||||||
}
|
|
||||||
ctx.RegisterBp2BuildMutator(tc.moduleTypeUnderTest, tc.moduleTypeUnderTestBp2BuildMutator)
|
ctx.RegisterBp2BuildMutator(tc.moduleTypeUnderTest, tc.moduleTypeUnderTestBp2BuildMutator)
|
||||||
ctx.RegisterForBazelConversion()
|
ctx.RegisterForBazelConversion()
|
||||||
|
|
||||||
@@ -333,7 +330,6 @@ func TestCcLibrarySharedStaticProps(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library",
|
moduleTypeUnderTest: "cc_library",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
dir: "foo/bar",
|
dir: "foo/bar",
|
||||||
filesystem: map[string]string{
|
filesystem: map[string]string{
|
||||||
"foo/bar/both.cpp": "",
|
"foo/bar/both.cpp": "",
|
||||||
@@ -418,7 +414,6 @@ func TestCcLibraryWholeStaticLibsAlwaysLink(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library",
|
moduleTypeUnderTest: "cc_library",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
dir: "foo/bar",
|
dir: "foo/bar",
|
||||||
filesystem: map[string]string{
|
filesystem: map[string]string{
|
||||||
"foo/bar/Android.bp": `
|
"foo/bar/Android.bp": `
|
||||||
@@ -465,7 +460,6 @@ func TestCcLibrarySharedStaticPropsInArch(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library",
|
moduleTypeUnderTest: "cc_library",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
dir: "foo/bar",
|
dir: "foo/bar",
|
||||||
filesystem: map[string]string{
|
filesystem: map[string]string{
|
||||||
"foo/bar/arm.cpp": "",
|
"foo/bar/arm.cpp": "",
|
||||||
@@ -604,7 +598,6 @@ func TestCcLibrarySharedStaticPropsWithMixedSources(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library",
|
moduleTypeUnderTest: "cc_library",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
dir: "foo/bar",
|
dir: "foo/bar",
|
||||||
filesystem: map[string]string{
|
filesystem: map[string]string{
|
||||||
"foo/bar/both_source.cpp": "",
|
"foo/bar/both_source.cpp": "",
|
||||||
@@ -745,7 +738,6 @@ func TestCcLibraryNonConfiguredVersionScript(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library",
|
moduleTypeUnderTest: "cc_library",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
dir: "foo/bar",
|
dir: "foo/bar",
|
||||||
filesystem: map[string]string{
|
filesystem: map[string]string{
|
||||||
"foo/bar/Android.bp": `
|
"foo/bar/Android.bp": `
|
||||||
@@ -776,7 +768,6 @@ func TestCcLibraryConfiguredVersionScript(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library",
|
moduleTypeUnderTest: "cc_library",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
dir: "foo/bar",
|
dir: "foo/bar",
|
||||||
filesystem: map[string]string{
|
filesystem: map[string]string{
|
||||||
"foo/bar/Android.bp": `
|
"foo/bar/Android.bp": `
|
||||||
@@ -819,7 +810,6 @@ func TestCcLibrarySharedLibs(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library",
|
moduleTypeUnderTest: "cc_library",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
dir: "foo/bar",
|
dir: "foo/bar",
|
||||||
filesystem: map[string]string{
|
filesystem: map[string]string{
|
||||||
"foo/bar/Android.bp": `
|
"foo/bar/Android.bp": `
|
||||||
@@ -859,7 +849,6 @@ func TestCcLibraryPackRelocations(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library",
|
moduleTypeUnderTest: "cc_library",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
dir: "foo/bar",
|
dir: "foo/bar",
|
||||||
filesystem: map[string]string{
|
filesystem: map[string]string{
|
||||||
"foo/bar/Android.bp": `
|
"foo/bar/Android.bp": `
|
||||||
@@ -933,7 +922,6 @@ func TestCcLibrarySpacesInCopts(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library",
|
moduleTypeUnderTest: "cc_library",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
dir: "foo/bar",
|
dir: "foo/bar",
|
||||||
filesystem: map[string]string{
|
filesystem: map[string]string{
|
||||||
"foo/bar/Android.bp": `
|
"foo/bar/Android.bp": `
|
||||||
@@ -963,7 +951,6 @@ func TestCcLibraryCppFlagsGoesIntoCopts(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library",
|
moduleTypeUnderTest: "cc_library",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
dir: "foo/bar",
|
dir: "foo/bar",
|
||||||
filesystem: map[string]string{
|
filesystem: map[string]string{
|
||||||
"foo/bar/Android.bp": `cc_library {
|
"foo/bar/Android.bp": `cc_library {
|
||||||
@@ -1019,7 +1006,6 @@ func TestCcLibraryLabelAttributeGetTargetProperties(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library",
|
moduleTypeUnderTest: "cc_library",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
dir: "foo/bar",
|
dir: "foo/bar",
|
||||||
filesystem: map[string]string{
|
filesystem: map[string]string{
|
||||||
"foo/bar/Android.bp": `
|
"foo/bar/Android.bp": `
|
||||||
@@ -1061,7 +1047,6 @@ func TestCcLibraryExcludeLibs(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library",
|
moduleTypeUnderTest: "cc_library",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
filesystem: map[string]string{},
|
filesystem: map[string]string{},
|
||||||
blueprint: soongCcLibraryStaticPreamble + `
|
blueprint: soongCcLibraryStaticPreamble + `
|
||||||
cc_library {
|
cc_library {
|
||||||
@@ -1308,7 +1293,6 @@ func TestCcLibraryStrip(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library",
|
moduleTypeUnderTest: "cc_library",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
dir: "foo/bar",
|
dir: "foo/bar",
|
||||||
filesystem: map[string]string{
|
filesystem: map[string]string{
|
||||||
"foo/bar/Android.bp": `
|
"foo/bar/Android.bp": `
|
||||||
@@ -1415,7 +1399,6 @@ func TestCcLibraryStripWithArch(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library",
|
moduleTypeUnderTest: "cc_library",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
dir: "foo/bar",
|
dir: "foo/bar",
|
||||||
filesystem: map[string]string{
|
filesystem: map[string]string{
|
||||||
"foo/bar/Android.bp": `
|
"foo/bar/Android.bp": `
|
||||||
|
@@ -45,7 +45,6 @@ type bp2buildTestCase struct {
|
|||||||
moduleTypeUnderTest string
|
moduleTypeUnderTest string
|
||||||
moduleTypeUnderTestFactory android.ModuleFactory
|
moduleTypeUnderTestFactory android.ModuleFactory
|
||||||
moduleTypeUnderTestBp2BuildMutator func(android.TopDownMutatorContext)
|
moduleTypeUnderTestBp2BuildMutator func(android.TopDownMutatorContext)
|
||||||
depsMutators []android.RegisterMutatorFunc
|
|
||||||
blueprint string
|
blueprint string
|
||||||
expectedBazelTargets []string
|
expectedBazelTargets []string
|
||||||
filesystem map[string]string
|
filesystem map[string]string
|
||||||
@@ -181,7 +180,6 @@ func TestCcLibraryHeadersOSSpecificHeader(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library_headers",
|
moduleTypeUnderTest: "cc_library_headers",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryHeaderFactory,
|
moduleTypeUnderTestFactory: cc.LibraryHeaderFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryHeadersBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryHeadersBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
filesystem: map[string]string{},
|
filesystem: map[string]string{},
|
||||||
blueprint: soongCcLibraryPreamble + `
|
blueprint: soongCcLibraryPreamble + `
|
||||||
cc_library_headers { name: "android-lib" }
|
cc_library_headers { name: "android-lib" }
|
||||||
@@ -271,7 +269,6 @@ func TestCcLibraryHeadersOsSpecficHeaderLibsExportHeaderLibHeaders(t *testing.T)
|
|||||||
moduleTypeUnderTest: "cc_library_headers",
|
moduleTypeUnderTest: "cc_library_headers",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryHeaderFactory,
|
moduleTypeUnderTestFactory: cc.LibraryHeaderFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryHeadersBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryHeadersBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
filesystem: map[string]string{},
|
filesystem: map[string]string{},
|
||||||
blueprint: soongCcLibraryPreamble + `
|
blueprint: soongCcLibraryPreamble + `
|
||||||
cc_library_headers { name: "android-lib" }
|
cc_library_headers { name: "android-lib" }
|
||||||
@@ -318,7 +315,6 @@ func TestCcLibraryHeadersArchAndTargetExportSystemIncludes(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library_headers",
|
moduleTypeUnderTest: "cc_library_headers",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryHeaderFactory,
|
moduleTypeUnderTestFactory: cc.LibraryHeaderFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryHeadersBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryHeadersBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
filesystem: map[string]string{},
|
filesystem: map[string]string{},
|
||||||
blueprint: soongCcLibraryPreamble + `cc_library_headers {
|
blueprint: soongCcLibraryPreamble + `cc_library_headers {
|
||||||
name: "foo_headers",
|
name: "foo_headers",
|
||||||
|
@@ -469,7 +469,6 @@ func TestCcLibraryStaticArchSpecificStaticLib(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library_static",
|
moduleTypeUnderTest: "cc_library_static",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
filesystem: map[string]string{},
|
filesystem: map[string]string{},
|
||||||
blueprint: soongCcLibraryStaticPreamble + `
|
blueprint: soongCcLibraryStaticPreamble + `
|
||||||
cc_library_static { name: "static_dep" }
|
cc_library_static { name: "static_dep" }
|
||||||
@@ -517,7 +516,6 @@ func TestCcLibraryStaticOsSpecificStaticLib(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library_static",
|
moduleTypeUnderTest: "cc_library_static",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
filesystem: map[string]string{},
|
filesystem: map[string]string{},
|
||||||
blueprint: soongCcLibraryStaticPreamble + `
|
blueprint: soongCcLibraryStaticPreamble + `
|
||||||
cc_library_static { name: "static_dep" }
|
cc_library_static { name: "static_dep" }
|
||||||
@@ -565,7 +563,6 @@ func TestCcLibraryStaticBaseArchOsSpecificStaticLib(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library_static",
|
moduleTypeUnderTest: "cc_library_static",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
filesystem: map[string]string{},
|
filesystem: map[string]string{},
|
||||||
blueprint: soongCcLibraryStaticPreamble + `
|
blueprint: soongCcLibraryStaticPreamble + `
|
||||||
cc_library_static { name: "static_dep" }
|
cc_library_static { name: "static_dep" }
|
||||||
@@ -632,7 +629,6 @@ func TestCcLibraryStaticSimpleExcludeSrcs(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library_static",
|
moduleTypeUnderTest: "cc_library_static",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
filesystem: map[string]string{
|
filesystem: map[string]string{
|
||||||
"common.c": "",
|
"common.c": "",
|
||||||
"foo-a.c": "",
|
"foo-a.c": "",
|
||||||
@@ -665,7 +661,6 @@ func TestCcLibraryStaticOneArchSrcs(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library_static",
|
moduleTypeUnderTest: "cc_library_static",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
filesystem: map[string]string{
|
filesystem: map[string]string{
|
||||||
"common.c": "",
|
"common.c": "",
|
||||||
"foo-arm.c": "",
|
"foo-arm.c": "",
|
||||||
@@ -697,7 +692,6 @@ func TestCcLibraryStaticOneArchSrcsExcludeSrcs(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library_static",
|
moduleTypeUnderTest: "cc_library_static",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
filesystem: map[string]string{
|
filesystem: map[string]string{
|
||||||
"common.c": "",
|
"common.c": "",
|
||||||
"for-arm.c": "",
|
"for-arm.c": "",
|
||||||
@@ -734,7 +728,6 @@ func TestCcLibraryStaticTwoArchExcludeSrcs(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library_static",
|
moduleTypeUnderTest: "cc_library_static",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
filesystem: map[string]string{
|
filesystem: map[string]string{
|
||||||
"common.c": "",
|
"common.c": "",
|
||||||
"for-arm.c": "",
|
"for-arm.c": "",
|
||||||
@@ -782,7 +775,6 @@ func TestCcLibraryStaticFourArchExcludeSrcs(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library_static",
|
moduleTypeUnderTest: "cc_library_static",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
filesystem: map[string]string{
|
filesystem: map[string]string{
|
||||||
"common.c": "",
|
"common.c": "",
|
||||||
"for-arm.c": "",
|
"for-arm.c": "",
|
||||||
@@ -856,7 +848,6 @@ func TestCcLibraryStaticOneArchEmpty(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library_static",
|
moduleTypeUnderTest: "cc_library_static",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
filesystem: map[string]string{
|
filesystem: map[string]string{
|
||||||
"common.cc": "",
|
"common.cc": "",
|
||||||
"foo-no-arm.cc": "",
|
"foo-no-arm.cc": "",
|
||||||
@@ -892,7 +883,6 @@ func TestCcLibraryStaticOneArchEmptyOtherSet(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library_static",
|
moduleTypeUnderTest: "cc_library_static",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
filesystem: map[string]string{
|
filesystem: map[string]string{
|
||||||
"common.cc": "",
|
"common.cc": "",
|
||||||
"foo-no-arm.cc": "",
|
"foo-no-arm.cc": "",
|
||||||
@@ -934,7 +924,6 @@ func TestCcLibraryStaticMultipleDepSameName(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library_static",
|
moduleTypeUnderTest: "cc_library_static",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
filesystem: map[string]string{},
|
filesystem: map[string]string{},
|
||||||
blueprint: soongCcLibraryStaticPreamble + `
|
blueprint: soongCcLibraryStaticPreamble + `
|
||||||
cc_library_static { name: "static_dep" }
|
cc_library_static { name: "static_dep" }
|
||||||
@@ -967,7 +956,6 @@ func TestCcLibraryStaticOneMultilibSrcsExcludeSrcs(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library_static",
|
moduleTypeUnderTest: "cc_library_static",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
filesystem: map[string]string{
|
filesystem: map[string]string{
|
||||||
"common.c": "",
|
"common.c": "",
|
||||||
"for-lib32.c": "",
|
"for-lib32.c": "",
|
||||||
@@ -1003,7 +991,6 @@ func TestCcLibraryStaticTwoMultilibSrcsExcludeSrcs(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library_static",
|
moduleTypeUnderTest: "cc_library_static",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
filesystem: map[string]string{
|
filesystem: map[string]string{
|
||||||
"common.c": "",
|
"common.c": "",
|
||||||
"for-lib32.c": "",
|
"for-lib32.c": "",
|
||||||
@@ -1059,7 +1046,6 @@ func TestCcLibrarySTaticArchMultilibSrcsExcludeSrcs(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library_static",
|
moduleTypeUnderTest: "cc_library_static",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
filesystem: map[string]string{
|
filesystem: map[string]string{
|
||||||
"common.c": "",
|
"common.c": "",
|
||||||
"for-arm.c": "",
|
"for-arm.c": "",
|
||||||
@@ -1151,7 +1137,6 @@ func TestCcLibraryStaticArchSrcsExcludeSrcsGeneratedFiles(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library_static",
|
moduleTypeUnderTest: "cc_library_static",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
filesystem: map[string]string{
|
filesystem: map[string]string{
|
||||||
"common.cpp": "",
|
"common.cpp": "",
|
||||||
"for-x86.cpp": "",
|
"for-x86.cpp": "",
|
||||||
@@ -1243,7 +1228,6 @@ func TestCcLibraryStaticGetTargetProperties(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library_static",
|
moduleTypeUnderTest: "cc_library_static",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
blueprint: soongCcLibraryStaticPreamble + `
|
blueprint: soongCcLibraryStaticPreamble + `
|
||||||
cc_library_static {
|
cc_library_static {
|
||||||
name: "foo_static",
|
name: "foo_static",
|
||||||
@@ -1300,8 +1284,6 @@ func TestCcLibraryStaticProductVariableSelects(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library_static",
|
moduleTypeUnderTest: "cc_library_static",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
filesystem: map[string]string{},
|
|
||||||
blueprint: soongCcLibraryStaticPreamble + `
|
blueprint: soongCcLibraryStaticPreamble + `
|
||||||
cc_library_static {
|
cc_library_static {
|
||||||
name: "foo_static",
|
name: "foo_static",
|
||||||
@@ -1345,7 +1327,6 @@ func TestCcLibraryStaticProductVariableArchSpecificSelects(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library_static",
|
moduleTypeUnderTest: "cc_library_static",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
filesystem: map[string]string{},
|
filesystem: map[string]string{},
|
||||||
blueprint: soongCcLibraryStaticPreamble + `
|
blueprint: soongCcLibraryStaticPreamble + `
|
||||||
cc_library_static {
|
cc_library_static {
|
||||||
@@ -1417,7 +1398,6 @@ func TestCcLibraryStaticProductVariableStringReplacement(t *testing.T) {
|
|||||||
moduleTypeUnderTest: "cc_library_static",
|
moduleTypeUnderTest: "cc_library_static",
|
||||||
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
moduleTypeUnderTestFactory: cc.LibraryStaticFactory,
|
||||||
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
|
||||||
depsMutators: []android.RegisterMutatorFunc{cc.RegisterDepsBp2Build},
|
|
||||||
filesystem: map[string]string{},
|
filesystem: map[string]string{},
|
||||||
blueprint: soongCcLibraryStaticPreamble + `
|
blueprint: soongCcLibraryStaticPreamble + `
|
||||||
cc_library_static {
|
cc_library_static {
|
||||||
|
143
cc/bp2build.go
143
cc/bp2build.go
@@ -24,122 +24,6 @@ import (
|
|||||||
"github.com/google/blueprint/proptools"
|
"github.com/google/blueprint/proptools"
|
||||||
)
|
)
|
||||||
|
|
||||||
// bp2build functions and helpers for converting cc_* modules to Bazel.
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
android.DepsBp2BuildMutators(RegisterDepsBp2Build)
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterDepsBp2Build(ctx android.RegisterMutatorsContext) {
|
|
||||||
ctx.BottomUp("cc_bp2build_deps", depsBp2BuildMutator)
|
|
||||||
}
|
|
||||||
|
|
||||||
// A naive deps mutator to add deps on all modules across all combinations of
|
|
||||||
// target props for cc modules. This is needed to make module -> bazel label
|
|
||||||
// resolution work in the bp2build mutator later. This is probably
|
|
||||||
// the wrong way to do it, but it works.
|
|
||||||
//
|
|
||||||
// TODO(jingwen): can we create a custom os mutator in depsBp2BuildMutator to do this?
|
|
||||||
func depsBp2BuildMutator(ctx android.BottomUpMutatorContext) {
|
|
||||||
module, ok := ctx.Module().(*Module)
|
|
||||||
if !ok {
|
|
||||||
// Not a cc module
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if !module.ConvertWithBp2build(ctx) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
var allDeps []string
|
|
||||||
|
|
||||||
for _, configToProps := range module.GetArchVariantProperties(ctx, &BaseCompilerProperties{}) {
|
|
||||||
for _, props := range configToProps {
|
|
||||||
if baseCompilerProps, ok := props.(*BaseCompilerProperties); ok {
|
|
||||||
allDeps = append(allDeps, baseCompilerProps.Generated_headers...)
|
|
||||||
allDeps = append(allDeps, baseCompilerProps.Generated_sources...)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, configToProps := range module.GetArchVariantProperties(ctx, &BaseLinkerProperties{}) {
|
|
||||||
for _, props := range configToProps {
|
|
||||||
if baseLinkerProps, ok := props.(*BaseLinkerProperties); ok {
|
|
||||||
allDeps = append(allDeps, baseLinkerProps.Header_libs...)
|
|
||||||
allDeps = append(allDeps, baseLinkerProps.Export_header_lib_headers...)
|
|
||||||
allDeps = append(allDeps, baseLinkerProps.Static_libs...)
|
|
||||||
allDeps = append(allDeps, baseLinkerProps.Exclude_static_libs...)
|
|
||||||
allDeps = append(allDeps, baseLinkerProps.Whole_static_libs...)
|
|
||||||
allDeps = append(allDeps, baseLinkerProps.Shared_libs...)
|
|
||||||
allDeps = append(allDeps, baseLinkerProps.Exclude_shared_libs...)
|
|
||||||
allDeps = append(allDeps, baseLinkerProps.System_shared_libs...)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deps in the static: { .. } and shared: { .. } props of a cc_library.
|
|
||||||
if lib, ok := module.compiler.(*libraryDecorator); ok {
|
|
||||||
appendDeps := func(deps []string, p StaticOrSharedProperties, system bool) []string {
|
|
||||||
deps = append(deps, p.Static_libs...)
|
|
||||||
deps = append(deps, p.Whole_static_libs...)
|
|
||||||
deps = append(deps, p.Shared_libs...)
|
|
||||||
// TODO(b/186024507, b/186489250): Temporarily exclude adding
|
|
||||||
// system_shared_libs deps until libc and libm builds.
|
|
||||||
if system {
|
|
||||||
allDeps = append(allDeps, p.System_shared_libs...)
|
|
||||||
}
|
|
||||||
return deps
|
|
||||||
}
|
|
||||||
|
|
||||||
allDeps = appendDeps(allDeps, lib.SharedProperties.Shared, lib.shared())
|
|
||||||
allDeps = appendDeps(allDeps, lib.StaticProperties.Static, lib.static())
|
|
||||||
|
|
||||||
// Deps in the target/arch nested static: { .. } and shared: { .. } props of a cc_library.
|
|
||||||
// target: { <target>: shared: { ... } }
|
|
||||||
for _, configToProps := range module.GetArchVariantProperties(ctx, &SharedProperties{}) {
|
|
||||||
for _, props := range configToProps {
|
|
||||||
if p, ok := props.(*SharedProperties); ok {
|
|
||||||
allDeps = appendDeps(allDeps, p.Shared, lib.shared())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, configToProps := range module.GetArchVariantProperties(ctx, &StaticProperties{}) {
|
|
||||||
for _, props := range configToProps {
|
|
||||||
if p, ok := props.(*StaticProperties); ok {
|
|
||||||
allDeps = appendDeps(allDeps, p.Static, lib.static())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// product variables only support a limited set of fields, this is the full list of field names
|
|
||||||
// related to cc module dependency management that are supported.
|
|
||||||
productVariableDepFields := [4]string{
|
|
||||||
"Shared_libs",
|
|
||||||
"Static_libs",
|
|
||||||
"Exclude_static_libs",
|
|
||||||
"Whole_static_libs",
|
|
||||||
}
|
|
||||||
|
|
||||||
productVariableProps := android.ProductVariableProperties(ctx)
|
|
||||||
for _, name := range productVariableDepFields {
|
|
||||||
props, exists := productVariableProps[name]
|
|
||||||
if !exists {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
for _, prop := range props {
|
|
||||||
if p, ok := prop.Property.([]string); !ok {
|
|
||||||
ctx.ModuleErrorf("Could not convert product variable %s property", name)
|
|
||||||
} else {
|
|
||||||
allDeps = append(allDeps, p...)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx.AddDependency(module, nil, android.SortedUniqueStrings(allDeps)...)
|
|
||||||
}
|
|
||||||
|
|
||||||
// staticOrSharedAttributes are the Bazel-ified versions of StaticOrSharedProperties --
|
// staticOrSharedAttributes are the Bazel-ified versions of StaticOrSharedProperties --
|
||||||
// properties which apply to either the shared or static version of a cc_library module.
|
// properties which apply to either the shared or static version of a cc_library module.
|
||||||
type staticOrSharedAttributes struct {
|
type staticOrSharedAttributes struct {
|
||||||
@@ -183,30 +67,33 @@ func groupSrcsByExtension(ctx android.TopDownMutatorContext, srcs bazel.LabelLis
|
|||||||
// Convert the filegroup dependencies into the extension-specific filegroups
|
// Convert the filegroup dependencies into the extension-specific filegroups
|
||||||
// filtered in the filegroup.bzl macro.
|
// filtered in the filegroup.bzl macro.
|
||||||
cppFilegroup := func(label string) string {
|
cppFilegroup := func(label string) string {
|
||||||
ctx.VisitDirectDeps(func(m android.Module) {
|
m, exists := ctx.ModuleFromName(label)
|
||||||
if isFilegroupNamed(m, label) {
|
if exists {
|
||||||
|
aModule, _ := m.(android.Module)
|
||||||
|
if isFilegroupNamed(aModule, label) {
|
||||||
label = label + "_cpp_srcs"
|
label = label + "_cpp_srcs"
|
||||||
return
|
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
return label
|
return label
|
||||||
}
|
}
|
||||||
cFilegroup := func(label string) string {
|
cFilegroup := func(label string) string {
|
||||||
ctx.VisitDirectDeps(func(m android.Module) {
|
m, exists := ctx.ModuleFromName(label)
|
||||||
if isFilegroupNamed(m, label) {
|
if exists {
|
||||||
|
aModule, _ := m.(android.Module)
|
||||||
|
if isFilegroupNamed(aModule, label) {
|
||||||
label = label + "_c_srcs"
|
label = label + "_c_srcs"
|
||||||
return
|
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
return label
|
return label
|
||||||
}
|
}
|
||||||
asFilegroup := func(label string) string {
|
asFilegroup := func(label string) string {
|
||||||
ctx.VisitDirectDeps(func(m android.Module) {
|
m, exists := ctx.ModuleFromName(label)
|
||||||
if isFilegroupNamed(m, label) {
|
if exists {
|
||||||
|
aModule, _ := m.(android.Module)
|
||||||
|
if isFilegroupNamed(aModule, label) {
|
||||||
label = label + "_as_srcs"
|
label = label + "_as_srcs"
|
||||||
return
|
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
return label
|
return label
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -68,7 +68,6 @@ func RegisterGenruleBuildComponents(ctx android.RegistrationContext) {
|
|||||||
ctx.BottomUp("genrule_tool_deps", toolDepsMutator).Parallel()
|
ctx.BottomUp("genrule_tool_deps", toolDepsMutator).Parallel()
|
||||||
})
|
})
|
||||||
|
|
||||||
android.DepsBp2BuildMutators(RegisterGenruleBp2BuildDeps)
|
|
||||||
android.RegisterBp2BuildMutator("genrule", GenruleBp2Build)
|
android.RegisterBp2BuildMutator("genrule", GenruleBp2Build)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user