From a18e9cfa29d22949d2c005fe2b51c5ffa2bf6379 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 10 Aug 2017 17:00:19 -0700 Subject: Remove error from AndroidMkDataProvider.AndroidMk It's never anything except nil, and it unnecessarily complicates the implementations. Test: m -j checkbuild Change-Id: I3e3b7251f32ffa84dbdfd0448faf248c306ca808 --- java/androidmk.go | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'java') diff --git a/java/androidmk.go b/java/androidmk.go index fd967cb5b..193992496 100644 --- a/java/androidmk.go +++ b/java/androidmk.go @@ -21,20 +21,26 @@ import ( "android/soong/android" ) -func (library *Library) AndroidMk() (ret android.AndroidMkData, err error) { - ret.Class = "JAVA_LIBRARIES" - ret.OutputFile = android.OptionalPathForPath(library.outputFile) - ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) { - fmt.Fprintln(w, "LOCAL_MODULE_SUFFIX := .jar") - }) - return +func (library *Library) AndroidMk() android.AndroidMkData { + return android.AndroidMkData{ + Class: "JAVA_LIBRARIES", + OutputFile: android.OptionalPathForPath(library.outputFile), + Extra: []android.AndroidMkExtraFunc{ + func(w io.Writer, outputFile android.Path) { + fmt.Fprintln(w, "LOCAL_MODULE_SUFFIX := .jar") + }, + }, + } } -func (prebuilt *Import) AndroidMk() (ret android.AndroidMkData, err error) { - ret.Class = "JAVA_LIBRARIES" - ret.OutputFile = android.OptionalPathForPath(prebuilt.combinedClasspathFile) - ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) { - fmt.Fprintln(w, "LOCAL_MODULE_SUFFIX := .jar") - }) - return +func (prebuilt *Import) AndroidMk() android.AndroidMkData { + return android.AndroidMkData{ + Class: "JAVA_LIBRARIES", + OutputFile: android.OptionalPathForPath(prebuilt.combinedClasspathFile), + Extra: []android.AndroidMkExtraFunc{ + func(w io.Writer, outputFile android.Path) { + fmt.Fprintln(w, "LOCAL_MODULE_SUFFIX := .jar") + }, + }, + } } -- cgit v1.2.3-59-g8ed1b