diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2021-02-22 22:40:31 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-02-22 22:40:31 +0000 |
commit | 277303f042e84a47cd2196126c9d85b05b3cf5c2 (patch) | |
tree | 091a6e5dcbc4bdd769124be156950ca0cb8e3192 /python | |
parent | a61a042fa667a74034f2310a8807f2a5fd98a305 (diff) | |
parent | aa2555387d214fc0292406d10714558054d794f3 (diff) |
Merge "Add ctx to AndroidMkExtraEntriesFunc"
Diffstat (limited to 'python')
-rw-r--r-- | python/androidmk.go | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/python/androidmk.go b/python/androidmk.go index 60637d39a..13b41723e 100644 --- a/python/androidmk.go +++ b/python/androidmk.go @@ -48,27 +48,29 @@ func (p *Module) AndroidMkEntries() []android.AndroidMkEntries { func (p *binaryDecorator) AndroidMk(base *Module, entries *android.AndroidMkEntries) { entries.Class = "EXECUTABLES" - entries.ExtraEntries = append(entries.ExtraEntries, func(entries *android.AndroidMkEntries) { - entries.AddCompatibilityTestSuites(p.binaryProperties.Test_suites...) - }) + entries.ExtraEntries = append(entries.ExtraEntries, + func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) { + entries.AddCompatibilityTestSuites(p.binaryProperties.Test_suites...) + }) base.subAndroidMk(entries, p.pythonInstaller) } func (p *testDecorator) AndroidMk(base *Module, entries *android.AndroidMkEntries) { entries.Class = "NATIVE_TESTS" - entries.ExtraEntries = append(entries.ExtraEntries, func(entries *android.AndroidMkEntries) { - entries.AddCompatibilityTestSuites(p.binaryDecorator.binaryProperties.Test_suites...) - if p.testConfig != nil { - entries.SetString("LOCAL_FULL_TEST_CONFIG", p.testConfig.String()) - } + entries.ExtraEntries = append(entries.ExtraEntries, + func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) { + entries.AddCompatibilityTestSuites(p.binaryDecorator.binaryProperties.Test_suites...) + if p.testConfig != nil { + entries.SetString("LOCAL_FULL_TEST_CONFIG", p.testConfig.String()) + } - entries.SetBoolIfTrue("LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG", !BoolDefault(p.binaryProperties.Auto_gen_config, true)) + entries.SetBoolIfTrue("LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG", !BoolDefault(p.binaryProperties.Auto_gen_config, true)) - entries.AddStrings("LOCAL_TEST_DATA", android.AndroidMkDataPaths(p.data)...) + entries.AddStrings("LOCAL_TEST_DATA", android.AndroidMkDataPaths(p.data)...) - entries.SetBoolIfTrue("LOCAL_IS_UNIT_TEST", Bool(p.testProperties.Test_options.Unit_test)) - }) + entries.SetBoolIfTrue("LOCAL_IS_UNIT_TEST", Bool(p.testProperties.Test_options.Unit_test)) + }) base.subAndroidMk(entries, p.binaryDecorator.pythonInstaller) } @@ -80,14 +82,15 @@ func (installer *pythonInstaller) AndroidMk(base *Module, entries *android.Andro } entries.Required = append(entries.Required, "libc++") - entries.ExtraEntries = append(entries.ExtraEntries, func(entries *android.AndroidMkEntries) { - path, file := filepath.Split(installer.path.ToMakePath().String()) - stem := strings.TrimSuffix(file, filepath.Ext(file)) - - entries.SetString("LOCAL_MODULE_SUFFIX", filepath.Ext(file)) - entries.SetString("LOCAL_MODULE_PATH", path) - entries.SetString("LOCAL_MODULE_STEM", stem) - entries.AddStrings("LOCAL_SHARED_LIBRARIES", installer.androidMkSharedLibs...) - entries.SetBool("LOCAL_CHECK_ELF_FILES", false) - }) + entries.ExtraEntries = append(entries.ExtraEntries, + func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) { + path, file := filepath.Split(installer.path.ToMakePath().String()) + stem := strings.TrimSuffix(file, filepath.Ext(file)) + + entries.SetString("LOCAL_MODULE_SUFFIX", filepath.Ext(file)) + entries.SetString("LOCAL_MODULE_PATH", path) + entries.SetString("LOCAL_MODULE_STEM", stem) + entries.AddStrings("LOCAL_SHARED_LIBRARIES", installer.androidMkSharedLibs...) + entries.SetBool("LOCAL_CHECK_ELF_FILES", false) + }) } |