From 02b11a6035cafa7652faa0ceb17cb1d893a38c62 Mon Sep 17 00:00:00 2001 From: Jaewoong Jung Date: Mon, 7 Dec 2020 10:23:54 -0800 Subject: [PATCH] Remove AndroidMkExtraFootersFunc entries param. I added in case anyone needs to access AndroidMkEntries to generate footer lines, but nobody uses it, and it only confuses people. Test: m nothing, TreeHugger Change-Id: Ic8a450e3c306d9228c1fdec212c7441bd6aaee03 --- android/androidmk.go | 4 ++-- android/makefile_goal.go | 2 +- cc/androidmk.go | 6 +++--- java/androidmk.go | 8 ++++---- java/robolectric.go | 2 +- sdk/sdk.go | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/android/androidmk.go b/android/androidmk.go index 42c5d0083..b32048aab 100644 --- a/android/androidmk.go +++ b/android/androidmk.go @@ -141,7 +141,7 @@ type AndroidMkEntries struct { } type AndroidMkExtraEntriesFunc func(entries *AndroidMkEntries) -type AndroidMkExtraFootersFunc func(w io.Writer, name, prefix, moduleDir string, entries *AndroidMkEntries) +type AndroidMkExtraFootersFunc func(w io.Writer, name, prefix, moduleDir string) // Utility funcs to manipulate Android.mk variable entries. @@ -554,7 +554,7 @@ func (a *AndroidMkEntries) fillInEntries(config Config, bpPath string, mod bluep fmt.Fprintln(&a.footer, "include "+a.Include) blueprintDir := filepath.Dir(bpPath) for _, footerFunc := range a.ExtraFooters { - footerFunc(&a.footer, name, prefix, blueprintDir, a) + footerFunc(&a.footer, name, prefix, blueprintDir) } } diff --git a/android/makefile_goal.go b/android/makefile_goal.go index b5d9d691e..07354a648 100644 --- a/android/makefile_goal.go +++ b/android/makefile_goal.go @@ -80,7 +80,7 @@ func (p *makefileGoal) AndroidMkEntries() []AndroidMkEntries { Class: "ETC", OutputFile: OptionalPathForPath(p.outputFilePath), ExtraFooters: []AndroidMkExtraFootersFunc{ - func(w io.Writer, name, prefix, moduleDir string, entries *AndroidMkEntries) { + func(w io.Writer, name, prefix, moduleDir string) { // Can't use Cp because inputPath() is not a valid Path. fmt.Fprintf(w, "$(eval $(call copy-one-file,%s,%s))\n", proptools.String(p.inputPath()), p.outputFilePath) }, diff --git a/cc/androidmk.go b/cc/androidmk.go index 320e69b4f..9b61e55e9 100644 --- a/cc/androidmk.go +++ b/cc/androidmk.go @@ -130,7 +130,7 @@ func (c *Module) AndroidMkEntries() []android.AndroidMkEntries { }, }, ExtraFooters: []android.AndroidMkExtraFootersFunc{ - func(w io.Writer, name, prefix, moduleDir string, entries *android.AndroidMkEntries) { + func(w io.Writer, name, prefix, moduleDir string) { if c.Properties.IsSdkVariant && c.Properties.SdkAndPlatformVariantVisibleToMake && c.CcLibraryInterface() && c.Shared() { // Using the SDK variant as a JNI library needs a copy of the .so that @@ -296,7 +296,7 @@ func (library *libraryDecorator) AndroidMkEntries(ctx AndroidMkContext, entries func (object *objectLinker) AndroidMkEntries(ctx AndroidMkContext, entries *android.AndroidMkEntries) { entries.Class = "STATIC_LIBRARIES" entries.ExtraFooters = append(entries.ExtraFooters, - func(w io.Writer, name, prefix, moduleDir string, entries *android.AndroidMkEntries) { + func(w io.Writer, name, prefix, moduleDir string) { out := entries.OutputFile.Path() varname := fmt.Sprintf("SOONG_%sOBJECT_%s%s", prefix, name, entries.SubName) @@ -574,7 +574,7 @@ func (c *snapshotObjectLinker) AndroidMkEntries(ctx AndroidMkContext, entries *a } entries.ExtraFooters = append(entries.ExtraFooters, - func(w io.Writer, name, prefix, moduleDir string, entries *android.AndroidMkEntries) { + func(w io.Writer, name, prefix, moduleDir string) { out := entries.OutputFile.Path() varname := fmt.Sprintf("SOONG_%sOBJECT_%s%s", prefix, name, entries.SubName) diff --git a/java/androidmk.go b/java/androidmk.go index fc573c8b6..aaad44f72 100644 --- a/java/androidmk.go +++ b/java/androidmk.go @@ -274,7 +274,7 @@ func (binary *Binary) AndroidMkEntries() []android.AndroidMkEntries { }, }, ExtraFooters: []android.AndroidMkExtraFootersFunc{ - func(w io.Writer, name, prefix, moduleDir string, entries *android.AndroidMkEntries) { + func(w io.Writer, name, prefix, moduleDir string) { fmt.Fprintln(w, "jar_installed_module := $(LOCAL_INSTALLED_MODULE)") }, }, @@ -289,7 +289,7 @@ func (binary *Binary) AndroidMkEntries() []android.AndroidMkEntries { }, }, ExtraFooters: []android.AndroidMkExtraFootersFunc{ - func(w io.Writer, name, prefix, moduleDir string, entries *android.AndroidMkEntries) { + func(w io.Writer, name, prefix, moduleDir string) { // Ensure that the wrapper script timestamp is always updated when the jar is updated fmt.Fprintln(w, "$(LOCAL_INSTALLED_MODULE): $(jar_installed_module)") fmt.Fprintln(w, "jar_installed_module :=") @@ -393,7 +393,7 @@ func (app *AndroidApp) AndroidMkEntries() []android.AndroidMkEntries { }, }, ExtraFooters: []android.AndroidMkExtraFootersFunc{ - func(w io.Writer, name, prefix, moduleDir string, entries *android.AndroidMkEntries) { + func(w io.Writer, name, prefix, moduleDir string) { if app.noticeOutputs.Merged.Valid() { fmt.Fprintf(w, "$(call dist-for-goals,%s,%s:%s)\n", app.installApkName, app.noticeOutputs.Merged.String(), app.installApkName+"_NOTICE") @@ -548,7 +548,7 @@ func (dstubs *Droidstubs) AndroidMkEntries() []android.AndroidMkEntries { }, }, ExtraFooters: []android.AndroidMkExtraFootersFunc{ - func(w io.Writer, name, prefix, moduleDir string, entries *android.AndroidMkEntries) { + func(w io.Writer, name, prefix, moduleDir string) { if dstubs.apiFile != nil { fmt.Fprintf(w, ".PHONY: %s %s.txt\n", dstubs.Name(), dstubs.Name()) fmt.Fprintf(w, "%s %s.txt: %s\n", dstubs.Name(), dstubs.Name(), dstubs.apiFile) diff --git a/java/robolectric.go b/java/robolectric.go index 419efda88..c821e5bd3 100644 --- a/java/robolectric.go +++ b/java/robolectric.go @@ -260,7 +260,7 @@ func (r *robolectricTest) AndroidMkEntries() []android.AndroidMkEntries { entries := &entriesList[0] entries.ExtraFooters = []android.AndroidMkExtraFootersFunc{ - func(w io.Writer, name, prefix, moduleDir string, entries *android.AndroidMkEntries) { + func(w io.Writer, name, prefix, moduleDir string) { if s := r.robolectricProperties.Test_options.Shards; s != nil && *s > 1 { numShards := int(*s) shardSize := (len(r.tests) + numShards - 1) / numShards diff --git a/sdk/sdk.go b/sdk/sdk.go index 50b0886d4..f3d075022 100644 --- a/sdk/sdk.go +++ b/sdk/sdk.go @@ -311,7 +311,7 @@ func (s *sdk) AndroidMkEntries() []android.AndroidMkEntries { DistFiles: android.MakeDefaultDistFiles(s.snapshotFile.Path()), Include: "$(BUILD_PHONY_PACKAGE)", ExtraFooters: []android.AndroidMkExtraFootersFunc{ - func(w io.Writer, name, prefix, moduleDir string, entries *android.AndroidMkEntries) { + func(w io.Writer, name, prefix, moduleDir string) { // Allow the sdk to be built by simply passing its name on the command line. fmt.Fprintln(w, ".PHONY:", s.Name()) fmt.Fprintln(w, s.Name()+":", s.snapshotFile.String())