From e2a17a5a406c5772f39a7c22fe07092989e7707b Mon Sep 17 00:00:00 2001 From: Liz Kammer Date: Tue, 24 Nov 2020 13:31:28 -0800 Subject: [PATCH] Convert csuite config to use AndroidMkEntries This is to facilitate consolidation of compatibility suite logic. Test: m nothing and compare soong Android mk files -- no diffs Change-Id: Ibc60d14fdde93835124e18a5c484bbda496bdb9e --- android/csuite_config.go | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/android/csuite_config.go b/android/csuite_config.go index 15c518a07..a5b15331a 100644 --- a/android/csuite_config.go +++ b/android/csuite_config.go @@ -14,11 +14,6 @@ package android -import ( - "fmt" - "io" -) - func init() { RegisterModuleType("csuite_config", CSuiteConfigFactory) } @@ -38,22 +33,21 @@ func (me *CSuiteConfig) GenerateAndroidBuildActions(ctx ModuleContext) { me.OutputFilePath = PathForModuleOut(ctx, me.BaseModuleName()).OutputPath } -func (me *CSuiteConfig) AndroidMk() AndroidMkData { - androidMkData := AndroidMkData{ +func (me *CSuiteConfig) AndroidMkEntries() []AndroidMkEntries { + androidMkEntries := AndroidMkEntries{ Class: "FAKE", Include: "$(BUILD_SYSTEM)/suite_host_config.mk", OutputFile: OptionalPathForPath(me.OutputFilePath), } - androidMkData.Extra = []AndroidMkExtraFunc{ - func(w io.Writer, outputFile Path) { + androidMkEntries.ExtraEntries = []AndroidMkExtraEntriesFunc{ + func(entries *AndroidMkEntries) { if me.properties.Test_config != nil { - fmt.Fprintf(w, "LOCAL_TEST_CONFIG := %s\n", - *me.properties.Test_config) + entries.SetString("LOCAL_TEST_CONFIG", *me.properties.Test_config) } - fmt.Fprintln(w, "LOCAL_COMPATIBILITY_SUITE := csuite") + entries.AddStrings("LOCAL_COMPATIBILITY_SUITE", "csuite") }, } - return androidMkData + return []AndroidMkEntries{androidMkEntries} } func InitCSuiteConfigModule(me *CSuiteConfig) {