Remove dists from MakeVarsContext
All usages have been moved to GenerateAndroidBuildActions.
Bug: 395184523
Test: Presubmits
Change-Id: Ic16e7835b794435d65e7cfe4beeda8d8cb6b2df6
diff --git a/android/androidmk.go b/android/androidmk.go
index 7d6b056..62ab596 100644
--- a/android/androidmk.go
+++ b/android/androidmk.go
@@ -779,17 +779,6 @@
func (so *soongOnlyAndroidMkSingleton) soongOnlyBuildActions(ctx SingletonContext, mods []blueprint.Module) {
allDistContributions, moduleInfoJSONs := getSoongOnlyDataFromMods(ctx, mods)
- for _, provider := range append(makeVarsInitProviders, *getSingletonMakevarsProviders(ctx.Config())...) {
- mctx := &makeVarsContext{
- SingletonContext: ctx,
- pctx: provider.pctx,
- }
- provider.call(mctx)
- if contribution := distsToDistContributions(mctx.dists); contribution != nil {
- allDistContributions = append(allDistContributions, *contribution)
- }
- }
-
singletonDists := getSingletonDists(ctx.Config())
singletonDists.lock.Lock()
if contribution := distsToDistContributions(singletonDists.dists); contribution != nil {
@@ -966,31 +955,6 @@
}
}
}
- if x, ok := mod.(ModuleMakeVarsProvider); ok {
- mctx := &makeVarsContext{
- SingletonContext: ctx.(SingletonContext),
- config: ctx.Config(),
- pctx: pctx,
- }
- if !x.Enabled(ctx) {
- continue
- }
- x.MakeVars(mctx)
- if contribution := distsToDistContributions(mctx.dists); contribution != nil {
- allDistContributions = append(allDistContributions, *contribution)
- }
- }
- if x, ok := mod.(SingletonMakeVarsProvider); ok {
- mctx := &makeVarsContext{
- SingletonContext: ctx.(SingletonContext),
- config: ctx.Config(),
- pctx: pctx,
- }
- x.MakeVars(mctx)
- if contribution := distsToDistContributions(mctx.dists); contribution != nil {
- allDistContributions = append(allDistContributions, *contribution)
- }
- }
}
}
return allDistContributions, moduleInfoJSONs
diff --git a/android/makevars.go b/android/makevars.go
index baa1d44..2931d0b 100644
--- a/android/makevars.go
+++ b/android/makevars.go
@@ -65,24 +65,6 @@
// dependencies to be added to it. Phony can be called on the same name multiple
// times to add additional dependencies.
Phony(names string, deps ...Path)
-
- // DistForGoal creates a rule to copy one or more Paths to the artifacts
- // directory on the build server when the specified goal is built.
- DistForGoal(goal string, paths ...Path)
-
- // DistForGoalWithFilename creates a rule to copy a Path to the artifacts
- // directory on the build server with the given filename when the specified
- // goal is built.
- DistForGoalWithFilename(goal string, path Path, filename string)
-
- // DistForGoals creates a rule to copy one or more Paths to the artifacts
- // directory on the build server when any of the specified goals are built.
- DistForGoals(goals []string, paths ...Path)
-
- // DistForGoalsWithFilename creates a rule to copy a Path to the artifacts
- // directory on the build server with the given filename when any of the
- // specified goals are built.
- DistForGoalsWithFilename(goals []string, path Path, filename string)
}
// MakeVarsContext contains the set of functions available for MakeVarsProvider
@@ -198,11 +180,9 @@
type makeVarsContext struct {
SingletonContext
- config Config
pctx PackageContext
vars []makeVarsVariable
phonies []phony
- dists []dist
}
var _ MakeVarsContext = &makeVarsContext{}
@@ -263,7 +243,6 @@
vars = append(vars, mctx.vars...)
phonies = append(phonies, mctx.phonies...)
- dists = append(dists, mctx.dists...)
}
singletonDists := getSingletonDists(ctx.Config())
@@ -281,7 +260,6 @@
vars = append(vars, mctx.vars...)
phonies = append(phonies, mctx.phonies...)
- dists = append(dists, mctx.dists...)
}
if m.ExportedToMake() {
@@ -611,13 +589,6 @@
c.phonies = append(c.phonies, phony{name, deps})
}
-func (c *makeVarsContext) addDist(goals []string, paths []distCopy) {
- c.dists = append(c.dists, dist{
- goals: goals,
- paths: paths,
- })
-}
-
func (c *makeVarsContext) Strict(name, ninjaStr string) {
c.addVariable(name, ninjaStr, true, false)
}
@@ -641,26 +612,3 @@
func (c *makeVarsContext) Phony(name string, deps ...Path) {
c.addPhony(name, Paths(deps).Strings())
}
-
-func (c *makeVarsContext) DistForGoal(goal string, paths ...Path) {
- c.DistForGoals([]string{goal}, paths...)
-}
-
-func (c *makeVarsContext) DistForGoalWithFilename(goal string, path Path, filename string) {
- c.DistForGoalsWithFilename([]string{goal}, path, filename)
-}
-
-func (c *makeVarsContext) DistForGoals(goals []string, paths ...Path) {
- var copies distCopies
- for _, path := range paths {
- copies = append(copies, distCopy{
- from: path,
- dest: path.Base(),
- })
- }
- c.addDist(goals, copies)
-}
-
-func (c *makeVarsContext) DistForGoalsWithFilename(goals []string, path Path, filename string) {
- c.addDist(goals, distCopies{{from: path, dest: filename}})
-}