Remove error from AndroidMkDataProvider.AndroidMk
It's never anything except nil, and it unnecessarily complicates the implementations. Test: m -j checkbuild Change-Id: I3e3b7251f32ffa84dbdfd0448faf248c306ca808
This commit is contained in:
@@ -33,7 +33,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type AndroidMkDataProvider interface {
|
type AndroidMkDataProvider interface {
|
||||||
AndroidMk() (AndroidMkData, error)
|
AndroidMk() AndroidMkData
|
||||||
BaseModuleName() string
|
BaseModuleName() string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -49,14 +49,17 @@ func (c *Module) subAndroidMk(data *android.AndroidMkData, obj interface{}) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Module) AndroidMk() (ret android.AndroidMkData, err error) {
|
func (c *Module) AndroidMk() android.AndroidMkData {
|
||||||
if c.Properties.HideFromMake {
|
if c.Properties.HideFromMake {
|
||||||
ret.Disabled = true
|
return android.AndroidMkData{
|
||||||
return ret, nil
|
Disabled: true,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret.OutputFile = c.outputFile
|
ret := android.AndroidMkData{
|
||||||
ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) {
|
OutputFile: c.outputFile,
|
||||||
|
Extra: []android.AndroidMkExtraFunc{
|
||||||
|
func(w io.Writer, outputFile android.Path) {
|
||||||
fmt.Fprintln(w, "LOCAL_SANITIZE := never")
|
fmt.Fprintln(w, "LOCAL_SANITIZE := never")
|
||||||
if len(c.Properties.AndroidMkSharedLibs) > 0 {
|
if len(c.Properties.AndroidMkSharedLibs) > 0 {
|
||||||
fmt.Fprintln(w, "LOCAL_SHARED_LIBRARIES := "+strings.Join(c.Properties.AndroidMkSharedLibs, " "))
|
fmt.Fprintln(w, "LOCAL_SHARED_LIBRARIES := "+strings.Join(c.Properties.AndroidMkSharedLibs, " "))
|
||||||
@@ -71,7 +74,9 @@ func (c *Module) AndroidMk() (ret android.AndroidMkData, err error) {
|
|||||||
if c.vndk() {
|
if c.vndk() {
|
||||||
fmt.Fprintln(w, "LOCAL_USE_VNDK := true")
|
fmt.Fprintln(w, "LOCAL_USE_VNDK := true")
|
||||||
}
|
}
|
||||||
})
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
for _, feature := range c.features {
|
for _, feature := range c.features {
|
||||||
c.subAndroidMk(&ret, feature)
|
c.subAndroidMk(&ret, feature)
|
||||||
@@ -90,7 +95,7 @@ func (c *Module) AndroidMk() (ret android.AndroidMkData, err error) {
|
|||||||
ret.SubName += vendorSuffix
|
ret.SubName += vendorSuffix
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret, nil
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
func androidMkWriteTestData(data android.Paths, ctx AndroidMkContext, ret *android.AndroidMkData) {
|
func androidMkWriteTestData(data android.Paths, ctx AndroidMkContext, ret *android.AndroidMkData) {
|
||||||
|
@@ -21,20 +21,26 @@ import (
|
|||||||
"android/soong/android"
|
"android/soong/android"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (library *Library) AndroidMk() (ret android.AndroidMkData, err error) {
|
func (library *Library) AndroidMk() android.AndroidMkData {
|
||||||
ret.Class = "JAVA_LIBRARIES"
|
return android.AndroidMkData{
|
||||||
ret.OutputFile = android.OptionalPathForPath(library.outputFile)
|
Class: "JAVA_LIBRARIES",
|
||||||
ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) {
|
OutputFile: android.OptionalPathForPath(library.outputFile),
|
||||||
|
Extra: []android.AndroidMkExtraFunc{
|
||||||
|
func(w io.Writer, outputFile android.Path) {
|
||||||
fmt.Fprintln(w, "LOCAL_MODULE_SUFFIX := .jar")
|
fmt.Fprintln(w, "LOCAL_MODULE_SUFFIX := .jar")
|
||||||
})
|
},
|
||||||
return
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (prebuilt *Import) AndroidMk() (ret android.AndroidMkData, err error) {
|
func (prebuilt *Import) AndroidMk() android.AndroidMkData {
|
||||||
ret.Class = "JAVA_LIBRARIES"
|
return android.AndroidMkData{
|
||||||
ret.OutputFile = android.OptionalPathForPath(prebuilt.combinedClasspathFile)
|
Class: "JAVA_LIBRARIES",
|
||||||
ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) {
|
OutputFile: android.OptionalPathForPath(prebuilt.combinedClasspathFile),
|
||||||
|
Extra: []android.AndroidMkExtraFunc{
|
||||||
|
func(w io.Writer, outputFile android.Path) {
|
||||||
fmt.Fprintln(w, "LOCAL_MODULE_SUFFIX := .jar")
|
fmt.Fprintln(w, "LOCAL_MODULE_SUFFIX := .jar")
|
||||||
})
|
},
|
||||||
return
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -48,13 +48,14 @@ func (p *phony) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *phony) AndroidMk() (ret android.AndroidMkData, err error) {
|
func (p *phony) AndroidMk() android.AndroidMkData {
|
||||||
ret.Custom = func(w io.Writer, name, prefix, moduleDir string) {
|
return android.AndroidMkData{
|
||||||
|
Custom: func(w io.Writer, name, prefix, moduleDir string) {
|
||||||
fmt.Fprintln(w, "\ninclude $(CLEAR_VARS)")
|
fmt.Fprintln(w, "\ninclude $(CLEAR_VARS)")
|
||||||
fmt.Fprintln(w, "LOCAL_PATH :=", moduleDir)
|
fmt.Fprintln(w, "LOCAL_PATH :=", moduleDir)
|
||||||
fmt.Fprintln(w, "LOCAL_MODULE :=", name)
|
fmt.Fprintln(w, "LOCAL_MODULE :=", name)
|
||||||
fmt.Fprintln(w, "LOCAL_REQUIRED_MODULES := "+strings.Join(p.requiredModuleNames, " "))
|
fmt.Fprintln(w, "LOCAL_REQUIRED_MODULES := "+strings.Join(p.requiredModuleNames, " "))
|
||||||
fmt.Fprintln(w, "include $(BUILD_PHONY_PACKAGE)")
|
fmt.Fprintln(w, "include $(BUILD_PHONY_PACKAGE)")
|
||||||
|
},
|
||||||
}
|
}
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
@@ -38,10 +38,12 @@ func (p *pythonBaseModule) subAndroidMk(data *android.AndroidMkData, obj interfa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *pythonBaseModule) AndroidMk() (ret android.AndroidMkData, err error) {
|
func (p *pythonBaseModule) AndroidMk() android.AndroidMkData {
|
||||||
|
ret := android.AndroidMkData{}
|
||||||
|
|
||||||
p.subAndroidMk(&ret, p.installer)
|
p.subAndroidMk(&ret, p.installer)
|
||||||
|
|
||||||
return ret, nil
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *pythonBinaryHostDecorator) AndroidMk(base *pythonBaseModule, ret *android.AndroidMkData) {
|
func (p *pythonBinaryHostDecorator) AndroidMk(base *pythonBaseModule, ret *android.AndroidMkData) {
|
||||||
|
Reference in New Issue
Block a user