New AndroidMk authoring system based on entry map.
The new system collects all Android.mk variable assignments using a map
and writes them to io.Writer. Compared to the previous system, which
directly writes all entries to buffers, this new system is more robust
and test-friendly.
Test: Built without prebuilt_etc.go change and diffed the mk output.
Test: prebuilt_etc_test.go
Change-Id: Idd28443d129ff70053295015e69328a8fa3eca47
diff --git a/android/testing.go b/android/testing.go
index aee6855..c0db75e 100644
--- a/android/testing.go
+++ b/android/testing.go
@@ -371,3 +371,14 @@
}
}
}
+
+func AndroidMkEntriesForTest(t *testing.T, config Config, bpPath string, mod blueprint.Module) AndroidMkEntries {
+ var p AndroidMkEntriesProvider
+ var ok bool
+ if p, ok = mod.(AndroidMkEntriesProvider); !ok {
+ t.Errorf("module does not implmement AndroidMkEntriesProvider: " + mod.Name())
+ }
+ entries := p.AndroidMkEntries()
+ entries.fillInEntries(config, bpPath, mod)
+ return entries
+}