Remove DistFiles from AndroidMk datastructures
The code that collects dists also supports getting them from
OutputFiles. Switch the few remaining usages of AndroidMk-based
disted files over to OutputFiles, and remove DistFiles from the
AndroidMk datastructures.
This should allow us to clean up more AndroidMk code in a followup
cl.
Bug: 398938465
Test: Confirmed that the ninja files for "m nothing dist" don't change after this cl.
Change-Id: I9eaed21018ef73ec36276556e7daa7201b272009
diff --git a/android/androidmk.go b/android/androidmk.go
index d9d78f3..5cb5a66 100644
--- a/android/androidmk.go
+++ b/android/androidmk.go
@@ -107,8 +107,6 @@
SubName string
// If set, this value overrides the base module name. SubName is still appended.
OverrideName string
- // Dist files to output
- DistFiles TaggedDistFiles
// The output file for Kati to process and/or install. If absent, the module is skipped.
OutputFile OptionalPath
// If true, the module is skipped and does not appear on the final Android-<product name>.mk
@@ -360,15 +358,9 @@
// Start with an empty (nil) set.
var availableTaggedDists TaggedDistFiles
- // Then merge in any that are provided explicitly by the module.
- if a.DistFiles != nil {
- // Merge the DistFiles into the set.
- availableTaggedDists = availableTaggedDists.merge(a.DistFiles)
- }
-
// If no paths have been provided for the DefaultDistTag and the output file is
// valid then add that as the default dist path.
- if _, ok := availableTaggedDists[DefaultDistTag]; !ok && a.OutputFile.Valid() {
+ if a.OutputFile.Valid() {
availableTaggedDists = availableTaggedDists.addPathsForTag(DefaultDistTag, a.OutputFile.Path())
}
@@ -1295,8 +1287,6 @@
SubName string
// If set, this value overrides the base module name. SubName is still appended.
OverrideName string
- // Dist files to output
- DistFiles TaggedDistFiles
// The output file for Kati to process and/or install. If absent, the module is skipped.
OutputFile OptionalPath
// If true, the module is skipped and does not appear on the final Android-<product name>.mk
@@ -1682,15 +1672,9 @@
// Start with an empty (nil) set.
var availableTaggedDists TaggedDistFiles
- // Then merge in any that are provided explicitly by the module.
- if a.DistFiles != nil {
- // Merge the DistFiles into the set.
- availableTaggedDists = availableTaggedDists.merge(a.DistFiles)
- }
-
// If no paths have been provided for the DefaultDistTag and the output file is
// valid then add that as the default dist path.
- if _, ok := availableTaggedDists[DefaultDistTag]; !ok && a.OutputFile.Valid() {
+ if a.OutputFile.Valid() {
availableTaggedDists = availableTaggedDists.addPathsForTag(DefaultDistTag, a.OutputFile.Path())
}
@@ -1815,9 +1799,8 @@
Class: mkinfo.Class,
SubName: mkinfo.SubName,
OverrideName: mkinfo.OverrideName,
- // There is no modification on DistFiles or OutputFile, so no need to
+ // There is no modification on OutputFile, so no need to
// make their deep copy.
- DistFiles: mkinfo.DistFiles,
OutputFile: mkinfo.OutputFile,
Disabled: mkinfo.Disabled,
Include: mkinfo.Include,