Fix dist(s)-with-tag and add tests to prevent regression.

While AndroidMkEntries' DistFiles were populated from java_library
properly, there was a bug in the conditionals that dropped the tagged
DistFiles.

Fixes b/152834186
Fixes b/161339864

Test: soong tests, m sdk dist (creates out/dist/test.jar with
aosp/1363578)

Signed-off-by: Jingwen Chen <jingwen@google.com>
Change-Id: Id895282256fd367b2f46dcb7a643465fa66c9456
This commit is contained in:
Jingwen Chen
2020-07-21 11:32:19 +00:00
parent 0bcda81dd5
commit 8481186d56
2 changed files with 35 additions and 1 deletions

View File

@@ -165,7 +165,7 @@ func (a *AndroidMkEntries) GetDistForGoals(mod blueprint.Module) []string {
var ret []string
availableTaggedDists := TaggedDistFiles{}
if a.DistFiles != nil && len(a.DistFiles[""]) > 0 {
if a.DistFiles != nil {
availableTaggedDists = a.DistFiles
} else if a.OutputFile.Valid() {
availableTaggedDists = MakeDefaultDistFiles(a.OutputFile.Path())