Divorce disting from androidmk
Change AndroidMkEntries.getDistContributions and
AndroidMkInfo.getDistContributions into a freestanding
getDistContributions.
This enables us to not call the AndroidMk related functions in
soong-only builds.
Bug: 398938465
Test: Diff'd the ninja files from "m nothing dist" before/after this cl, no changes
Change-Id: I2f9d537c0d66f0ae3715f083e2f55436e4c0a59f
diff --git a/android/androidmk_test.go b/android/androidmk_test.go
index 4cdd6a3..cd61133 100644
--- a/android/androidmk_test.go
+++ b/android/androidmk_test.go
@@ -346,7 +346,7 @@
if len(entries) != 1 {
t.Errorf("Expected a single AndroidMk entry, got %d", len(entries))
}
- distContributions := entries[0].getDistContributions(module)
+ distContributions := getDistContributions(ctx, module)
if err := compareContributions(expectedContributions, distContributions); err != nil {
t.Errorf("%s\nExpected Contributions\n%sActualContributions\n%s",
@@ -648,8 +648,8 @@
default_dist_files: "none",
dist_output_file: false,
dists: [
- // The following is silently ignored because there is not default file
- // in either the dist files or the output file.
+ // The following will dist one.out because there's no default dist file provided
+ // (default_dist_files: "none") and one.out is the outputfile for the "" tag.
{
targets: ["my_goal"],
},
@@ -664,6 +664,12 @@
{
goals: "my_goal",
copies: []distCopy{
+ distCopyForTest("one.out", "one.out"),
+ },
+ },
+ {
+ goals: "my_goal",
+ copies: []distCopy{
distCopyForTest("two.out", "two.out"),
distCopyForTest("three/four.out", "four.out"),
},