Allow AndroidMkData.Custom handlers to extend normal values

Pass accumulated AndroidMkData to AndroidMkData.Custom handlers
and expose WriteAndroidMkData so that Custom handlers can write
out the normal make variables and then add their own.

Test: No change to out/soong/Android-aosp_sailfish.mk
Change-Id: Id9717132bbd6c5cf3af8596f3eaa9bbb05d98e40
This commit is contained in:
Colin Cross
2017-08-10 17:07:28 -07:00
parent a18e9cfa29
commit 0f86d186b1
3 changed files with 59 additions and 55 deletions

View File

@@ -50,7 +50,7 @@ func (p *phony) GenerateAndroidBuildActions(ctx android.ModuleContext) {
func (p *phony) AndroidMk() android.AndroidMkData {
return android.AndroidMkData{
Custom: func(w io.Writer, name, prefix, moduleDir string) {
Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) {
fmt.Fprintln(w, "\ninclude $(CLEAR_VARS)")
fmt.Fprintln(w, "LOCAL_PATH :=", moduleDir)
fmt.Fprintln(w, "LOCAL_MODULE :=", name)