diff options
-rw-r--r-- | android/mutator.go | 123 | ||||
-rw-r--r-- | android/mutator_test.go | 2 | ||||
-rw-r--r-- | android/prebuilt.go | 4 | ||||
-rw-r--r-- | cc/cc.go | 2 |
4 files changed, 5 insertions, 126 deletions
diff --git a/android/mutator.go b/android/mutator.go index 783118a6a..f9bf36014 100644 --- a/android/mutator.go +++ b/android/mutator.go @@ -26,7 +26,7 @@ import ( // run Pre-deps mutators // run depsMutator // run PostDeps mutators -// run FinalDeps mutators (CreateVariations disallowed in this phase) +// run FinalDeps mutators (TransitionMutators disallowed in this phase) // continue on to GenerateAndroidBuildActions // collateGloballyRegisteredMutators constructs the list of mutators that have been registered @@ -231,36 +231,6 @@ type BottomUpMutatorContext interface { // module's dependency list. AddReverseDependency(module blueprint.Module, tag blueprint.DependencyTag, name string) - // CreateVariations splits a module into multiple variants, one for each name in the variationNames - // parameter. It returns a list of new modules in the same order as the variationNames - // list. - // - // If any of the dependencies of the module being operated on were already split - // by calling CreateVariations with the same name, the dependency will automatically - // be updated to point the matching variant. - // - // If a module is split, and then a module depending on the first module is not split - // when the Mutator is later called on it, the dependency of the depending module will - // automatically be updated to point to the first variant. - CreateVariations(...string) []Module - - // CreateLocationVariations splits a module into multiple variants, one for each name in the variantNames - // parameter. It returns a list of new modules in the same order as the variantNames - // list. - // - // Local variations do not affect automatic dependency resolution - dependencies added - // to the split module via deps or DynamicDependerModule must exactly match a variant - // that contains all the non-local variations. - CreateLocalVariations(...string) []Module - - // SetDependencyVariation sets all dangling dependencies on the current module to point to the variation - // with given name. This function ignores the default variation set by SetDefaultDependencyVariation. - SetDependencyVariation(string) - - // SetDefaultDependencyVariation sets the default variation when a dangling reference is detected - // during the subsequent calls on Create*Variations* functions. To reset, set it to nil. - SetDefaultDependencyVariation(*string) - // AddVariationDependencies adds deps as dependencies of the current module, but uses the variations // argument to select which variant of the dependency to use. It returns a slice of modules for // each dependency (some entries may be nil). A variant of the dependency must exist that matches @@ -287,12 +257,6 @@ type BottomUpMutatorContext interface { // be ordered correctly for all future mutator passes. AddFarVariationDependencies([]blueprint.Variation, blueprint.DependencyTag, ...string) []blueprint.Module - // AddInterVariantDependency adds a dependency between two variants of the same module. Variants are always - // ordered in the same orderas they were listed in CreateVariations, and AddInterVariantDependency does not change - // that ordering, but it associates a DependencyTag with the dependency and makes it visible to VisitDirectDeps, - // WalkDeps, etc. - AddInterVariantDependency(tag blueprint.DependencyTag, from, to blueprint.Module) - // ReplaceDependencies finds all the variants of the module with the specified name, then // replaces all dependencies onto those variants with the current variant of this module. // Replacements don't take effect until after the mutator pass is finished. @@ -303,30 +267,6 @@ type BottomUpMutatorContext interface { // as long as the supplied predicate returns true. // Replacements don't take effect until after the mutator pass is finished. ReplaceDependenciesIf(string, blueprint.ReplaceDependencyPredicate) - - // AliasVariation takes a variationName that was passed to CreateVariations for this module, - // and creates an alias from the current variant (before the mutator has run) to the new - // variant. The alias will be valid until the next time a mutator calls CreateVariations or - // CreateLocalVariations on this module without also calling AliasVariation. The alias can - // be used to add dependencies on the newly created variant using the variant map from - // before CreateVariations was run. - AliasVariation(variationName string) - - // CreateAliasVariation takes a toVariationName that was passed to CreateVariations for this - // module, and creates an alias from a new fromVariationName variant the toVariationName - // variant. The alias will be valid until the next time a mutator calls CreateVariations or - // CreateLocalVariations on this module without also calling AliasVariation. The alias can - // be used to add dependencies on the toVariationName variant using the fromVariationName - // variant. - CreateAliasVariation(fromVariationName, toVariationName string) - - // SetVariationProvider sets the value for a provider for the given newly created variant of - // the current module, i.e. one of the Modules returned by CreateVariations.. It panics if - // not called during the appropriate mutator or GenerateBuildActions pass for the provider, - // if the value is not of the appropriate type, or if the module is not a newly created - // variant of the current module. The value should not be modified after being passed to - // SetVariationProvider. - SetVariationProvider(module blueprint.Module, provider blueprint.AnyProviderKey, value interface{}) } // An outgoingTransitionContextImpl and incomingTransitionContextImpl is created for every dependency of every module @@ -755,51 +695,6 @@ func (b *bottomUpMutatorContext) AddReverseDependency(module blueprint.Module, t } b.bp.AddReverseDependency(module, tag, name) } - -func (b *bottomUpMutatorContext) CreateVariations(variations ...string) []Module { - if b.finalPhase { - panic("CreateVariations not allowed in FinalDepsMutators") - } - - modules := b.bp.CreateVariations(variations...) - - aModules := make([]Module, len(modules)) - for i := range variations { - aModules[i] = modules[i].(Module) - base := aModules[i].base() - base.commonProperties.DebugMutators = append(base.commonProperties.DebugMutators, b.MutatorName()) - base.commonProperties.DebugVariations = append(base.commonProperties.DebugVariations, variations[i]) - } - - return aModules -} - -func (b *bottomUpMutatorContext) CreateLocalVariations(variations ...string) []Module { - if b.finalPhase { - panic("CreateLocalVariations not allowed in FinalDepsMutators") - } - - modules := b.bp.CreateLocalVariations(variations...) - - aModules := make([]Module, len(modules)) - for i := range variations { - aModules[i] = modules[i].(Module) - base := aModules[i].base() - base.commonProperties.DebugMutators = append(base.commonProperties.DebugMutators, b.MutatorName()) - base.commonProperties.DebugVariations = append(base.commonProperties.DebugVariations, variations[i]) - } - - return aModules -} - -func (b *bottomUpMutatorContext) SetDependencyVariation(variation string) { - b.bp.SetDependencyVariation(variation) -} - -func (b *bottomUpMutatorContext) SetDefaultDependencyVariation(variation *string) { - b.bp.SetDefaultDependencyVariation(variation) -} - func (b *bottomUpMutatorContext) AddVariationDependencies(variations []blueprint.Variation, tag blueprint.DependencyTag, names ...string) []blueprint.Module { if b.baseModuleContext.checkedMissingDeps() { @@ -817,10 +712,6 @@ func (b *bottomUpMutatorContext) AddFarVariationDependencies(variations []bluepr return b.bp.AddFarVariationDependencies(variations, tag, names...) } -func (b *bottomUpMutatorContext) AddInterVariantDependency(tag blueprint.DependencyTag, from, to blueprint.Module) { - b.bp.AddInterVariantDependency(tag, from, to) -} - func (b *bottomUpMutatorContext) ReplaceDependencies(name string) { if b.baseModuleContext.checkedMissingDeps() { panic("Adding deps not allowed after checking for missing deps") @@ -834,15 +725,3 @@ func (b *bottomUpMutatorContext) ReplaceDependenciesIf(name string, predicate bl } b.bp.ReplaceDependenciesIf(name, predicate) } - -func (b *bottomUpMutatorContext) AliasVariation(variationName string) { - b.bp.AliasVariation(variationName) -} - -func (b *bottomUpMutatorContext) CreateAliasVariation(fromVariationName, toVariationName string) { - b.bp.CreateAliasVariation(fromVariationName, toVariationName) -} - -func (b *bottomUpMutatorContext) SetVariationProvider(module blueprint.Module, provider blueprint.AnyProviderKey, value interface{}) { - b.bp.SetVariationProvider(module, provider, value) -} diff --git a/android/mutator_test.go b/android/mutator_test.go index b3ef00f3d..5d4074a54 100644 --- a/android/mutator_test.go +++ b/android/mutator_test.go @@ -287,7 +287,7 @@ func TestFinalDepsPhase(t *testing.T) { AssertDeepEquals(t, "final", finalWant, finalGot) } -func TestNoCreateVariationsInFinalDeps(t *testing.T) { +func TestTransitionMutatorInFinalDeps(t *testing.T) { GroupFixturePreparers( FixtureRegisterWithContext(func(ctx RegistrationContext) { ctx.FinalDepsMutators(func(ctx RegisterMutatorsContext) { diff --git a/android/prebuilt.go b/android/prebuilt.go index fd5a6eaee..4f04d057b 100644 --- a/android/prebuilt.go +++ b/android/prebuilt.go @@ -359,8 +359,8 @@ func GetEmbeddedPrebuilt(module Module) *Prebuilt { // // This function is for use on dependencies after PrebuiltPostDepsMutator has // run - any dependency that is registered before that will already reference -// the right module. This function is only safe to call after all mutators that -// may call CreateVariations, e.g. in GenerateAndroidBuildActions. +// the right module. This function is only safe to call after all TransitionMutators +// have run, e.g. in GenerateAndroidBuildActions. func PrebuiltGetPreferred(ctx BaseModuleContext, module Module) Module { if !module.IsReplacedByPrebuilt() { return module @@ -137,7 +137,7 @@ type Deps struct { // LLNDK headers for the ABI checker to check LLNDK implementation library. // An LLNDK implementation is the core variant. LLNDK header libs are reexported by the vendor variant. - // The core variant cannot depend on the vendor variant because of the order of CreateVariations. + // The core variant cannot depend on the vendor variant because of the order of imageTransitionMutator.Split(). // Instead, the LLNDK implementation depends on the LLNDK header libs. LlndkHeaderLibs []string } |