Export Rust SourceProvider types and methods
The AIDL compiler now uses SourceProvider to compiler the generated Rust code from system/tools/aidl/build/aidl_interface.go using its own SourceProvider object, which needs access to baseSourceProvider and all methods of SourceProvider. Test: mmma system/tools/aidl with 1357705 applied Change-Id: I226609a7fccca2e7e1bfbad5d69d1821d37e43a1
This commit is contained in:
@@ -26,18 +26,18 @@ import (
|
||||
type AndroidMkContext interface {
|
||||
Name() string
|
||||
Target() android.Target
|
||||
subAndroidMk(*android.AndroidMkData, interface{})
|
||||
SubAndroidMk(*android.AndroidMkData, interface{})
|
||||
}
|
||||
|
||||
type subAndroidMkProvider interface {
|
||||
type SubAndroidMkProvider interface {
|
||||
AndroidMk(AndroidMkContext, *android.AndroidMkData)
|
||||
}
|
||||
|
||||
func (mod *Module) subAndroidMk(data *android.AndroidMkData, obj interface{}) {
|
||||
func (mod *Module) SubAndroidMk(data *android.AndroidMkData, obj interface{}) {
|
||||
if mod.subAndroidMkOnce == nil {
|
||||
mod.subAndroidMkOnce = make(map[subAndroidMkProvider]bool)
|
||||
mod.subAndroidMkOnce = make(map[SubAndroidMkProvider]bool)
|
||||
}
|
||||
if androidmk, ok := obj.(subAndroidMkProvider); ok {
|
||||
if androidmk, ok := obj.(SubAndroidMkProvider); ok {
|
||||
if !mod.subAndroidMkOnce[androidmk] {
|
||||
mod.subAndroidMkOnce[androidmk] = true
|
||||
androidmk.AndroidMk(mod, data)
|
||||
@@ -77,10 +77,10 @@ func (mod *Module) AndroidMk() android.AndroidMkData {
|
||||
}
|
||||
|
||||
if mod.compiler != nil && !mod.compiler.Disabled() {
|
||||
mod.subAndroidMk(&ret, mod.compiler)
|
||||
mod.SubAndroidMk(&ret, mod.compiler)
|
||||
} else if mod.sourceProvider != nil {
|
||||
// If the compiler is disabled, this is a SourceProvider.
|
||||
mod.subAndroidMk(&ret, mod.sourceProvider)
|
||||
mod.SubAndroidMk(&ret, mod.sourceProvider)
|
||||
}
|
||||
ret.SubName += mod.Properties.SubName
|
||||
|
||||
@@ -88,7 +88,7 @@ func (mod *Module) AndroidMk() android.AndroidMkData {
|
||||
}
|
||||
|
||||
func (binary *binaryDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
|
||||
ctx.subAndroidMk(ret, binary.baseCompiler)
|
||||
ctx.SubAndroidMk(ret, binary.baseCompiler)
|
||||
|
||||
if binary.distFile.Valid() {
|
||||
ret.DistFiles = android.MakeDefaultDistFiles(binary.distFile.Path())
|
||||
@@ -122,7 +122,7 @@ func (test *testDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidM
|
||||
}
|
||||
|
||||
func (library *libraryDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
|
||||
ctx.subAndroidMk(ret, library.baseCompiler)
|
||||
ctx.SubAndroidMk(ret, library.baseCompiler)
|
||||
|
||||
if library.rlib() {
|
||||
ret.Class = "RLIB_LIBRARIES"
|
||||
@@ -150,7 +150,7 @@ func (library *libraryDecorator) AndroidMk(ctx AndroidMkContext, ret *android.An
|
||||
}
|
||||
|
||||
func (procMacro *procMacroDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
|
||||
ctx.subAndroidMk(ret, procMacro.baseCompiler)
|
||||
ctx.SubAndroidMk(ret, procMacro.baseCompiler)
|
||||
|
||||
ret.Class = "PROC_MACRO_LIBRARIES"
|
||||
if procMacro.distFile.Valid() {
|
||||
@@ -159,8 +159,8 @@ func (procMacro *procMacroDecorator) AndroidMk(ctx AndroidMkContext, ret *androi
|
||||
|
||||
}
|
||||
|
||||
func (sourceProvider *baseSourceProvider) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
|
||||
outFile := sourceProvider.outputFile
|
||||
func (sourceProvider *BaseSourceProvider) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
|
||||
outFile := sourceProvider.OutputFile
|
||||
ret.Class = "ETC"
|
||||
ret.OutputFile = android.OptionalPathForPath(outFile)
|
||||
ret.SubName += sourceProvider.subName
|
||||
@@ -173,7 +173,7 @@ func (sourceProvider *baseSourceProvider) AndroidMk(ctx AndroidMkContext, ret *a
|
||||
}
|
||||
|
||||
func (bindgen *bindgenDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
|
||||
ctx.subAndroidMk(ret, bindgen.baseSourceProvider)
|
||||
ctx.SubAndroidMk(ret, bindgen.BaseSourceProvider)
|
||||
ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) {
|
||||
fmt.Fprintln(w, "LOCAL_UNINSTALLABLE_MODULE := true")
|
||||
})
|
||||
|
Reference in New Issue
Block a user