diff options
author | 2020-07-21 11:32:19 +0000 | |
---|---|---|
committer | 2020-07-21 12:30:39 +0000 | |
commit | 8481186d56e040fffc8f01d0a392704310295435 (patch) | |
tree | 14b0e362a4b93cedf410a86ddeedaf4626aab484 /android/androidmk_test.go | |
parent | 0bcda81dd540fe78ffe5cf19da8e92a56133d7df (diff) |
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
Diffstat (limited to 'android/androidmk_test.go')
-rw-r--r-- | android/androidmk_test.go | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/android/androidmk_test.go b/android/androidmk_test.go index 250f086e5..a558f453f 100644 --- a/android/androidmk_test.go +++ b/android/androidmk_test.go @@ -45,6 +45,8 @@ func (m *customModule) OutputFiles(tag string) (Paths, error) { return PathsForTesting("one.out"), nil case ".multiple": return PathsForTesting("two.out", "three/four.out"), nil + case ".another-tag": + return PathsForTesting("another.out"), nil default: return nil, fmt.Errorf("unsupported module reference tag %q", tag) } @@ -123,6 +125,38 @@ func TestGetDistForGoals(t *testing.T) { bp: ` custom { name: "foo", + dist: { + targets: ["my_goal"], + tag: ".another-tag", + } + } + `, + expectedAndroidMkLines: []string{ + ".PHONY: my_goal\n", + "$(call dist-for-goals,my_goal,another.out:another.out)\n", + }, + }, + { + bp: ` + custom { + name: "foo", + dists: [ + { + targets: ["my_goal"], + tag: ".another-tag", + }, + ], + } + `, + expectedAndroidMkLines: []string{ + ".PHONY: my_goal\n", + "$(call dist-for-goals,my_goal,another.out:another.out)\n", + }, + }, + { + bp: ` + custom { + name: "foo", dists: [ { targets: ["my_goal"], |