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
This commit is contained in:
@@ -371,3 +371,14 @@ func FailIfNoMatchingErrors(t *testing.T, pattern string, errs []error) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
Reference in New Issue
Block a user