diff options
Diffstat (limited to 'android/androidmk.go')
-rw-r--r-- | android/androidmk.go | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/android/androidmk.go b/android/androidmk.go index 7afc9ded8..42593bac4 100644 --- a/android/androidmk.go +++ b/android/androidmk.go @@ -222,13 +222,23 @@ func (a *AndroidMkEntries) getDistContributions(mod blueprint.Module) *distContr amod := mod.(Module).base() name := amod.BaseModuleName() + // Collate the set of associated tag/paths available for copying to the dist. + // Start with an empty (nil) set. var availableTaggedDists TaggedDistFiles + // Then merge in any that are provided explicitly by the module. if a.DistFiles != nil { - availableTaggedDists = a.DistFiles - } else if a.OutputFile.Valid() { - availableTaggedDists = MakeDefaultDistFiles(a.OutputFile.Path()) - } else { + // 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() { + availableTaggedDists = availableTaggedDists.addPathsForTag(DefaultDistTag, a.OutputFile.Path()) + } + + if len(availableTaggedDists) == 0 { // Nothing dist-able for this module. return nil } @@ -245,7 +255,7 @@ func (a *AndroidMkEntries) getDistContributions(mod blueprint.Module) *distContr var tag string if dist.Tag == nil { // If the dist struct does not specify a tag, use the default output files tag. - tag = "" + tag = DefaultDistTag } else { tag = *dist.Tag } @@ -259,10 +269,10 @@ func (a *AndroidMkEntries) getDistContributions(mod blueprint.Module) *distContr } if len(tagPaths) > 1 && (dist.Dest != nil || dist.Suffix != nil) { - errorMessage := "Cannot apply dest/suffix for more than one dist " + - "file for %s goals in module %s. The list of dist files, " + + errorMessage := "%s: Cannot apply dest/suffix for more than one dist " + + "file for %q goals tag %q in module %s. The list of dist files, " + "which should have a single element, is:\n%s" - panic(fmt.Errorf(errorMessage, goals, name, tagPaths)) + panic(fmt.Errorf(errorMessage, mod, goals, tag, name, tagPaths)) } copiesForGoals := distContributions.getCopiesForGoals(goals) |