Use soong_java_prebuilt.mk to export soong jars to java
Instead of trying to squeeze soong jars through prebuilt_internal.mk, make a separate soong_java_prebuilt.mk. Test: m -j checkbuild Change-Id: Idadef3c21a6f618d573110f04c80d7db3db92031
This commit is contained in:
parent
0a6e007e06
commit
5349941875
|
@ -42,6 +42,7 @@ type AndroidMkData struct {
|
|||
SubName string
|
||||
OutputFile OptionalPath
|
||||
Disabled bool
|
||||
Include string
|
||||
|
||||
Custom func(w io.Writer, name, prefix, moduleDir string, data AndroidMkData)
|
||||
|
||||
|
@ -163,6 +164,10 @@ func translateAndroidMkModule(ctx blueprint.SingletonContext, w io.Writer, mod b
|
|||
|
||||
data := provider.AndroidMk()
|
||||
|
||||
if data.Include == "" {
|
||||
data.Include = "$(BUILD_PREBUILT)"
|
||||
}
|
||||
|
||||
// Make does not understand LinuxBionic
|
||||
if amod.Os() == LinuxBionic {
|
||||
return nil
|
||||
|
@ -268,5 +273,5 @@ func WriteAndroidMkData(w io.Writer, data AndroidMkData) {
|
|||
extra(w, data.OutputFile.Path())
|
||||
}
|
||||
|
||||
fmt.Fprintln(w, "include $(BUILD_PREBUILT)")
|
||||
fmt.Fprintln(w, "include "+data.Include)
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ func (library *Library) AndroidMk() android.AndroidMkData {
|
|||
return android.AndroidMkData{
|
||||
Class: "JAVA_LIBRARIES",
|
||||
OutputFile: android.OptionalPathForPath(library.outputFile),
|
||||
Include: "$(BUILD_SYSTEM)/soong_java_prebuilt.mk",
|
||||
Extra: []android.AndroidMkExtraFunc{
|
||||
func(w io.Writer, outputFile android.Path) {
|
||||
fmt.Fprintln(w, "LOCAL_MODULE_SUFFIX := .jar")
|
||||
|
@ -41,6 +42,7 @@ func (prebuilt *Import) AndroidMk() android.AndroidMkData {
|
|||
return android.AndroidMkData{
|
||||
Class: "JAVA_LIBRARIES",
|
||||
OutputFile: android.OptionalPathForPath(prebuilt.combinedClasspathFile),
|
||||
Include: "$(BUILD_SYSTEM)/soong_java_prebuilt.mk",
|
||||
Extra: []android.AndroidMkExtraFunc{
|
||||
func(w io.Writer, outputFile android.Path) {
|
||||
fmt.Fprintln(w, "LOCAL_MODULE_SUFFIX := .jar")
|
||||
|
@ -54,6 +56,7 @@ func (binary *Binary) AndroidMk() android.AndroidMkData {
|
|||
return android.AndroidMkData{
|
||||
Class: "JAVA_LIBRARIES",
|
||||
OutputFile: android.OptionalPathForPath(binary.outputFile),
|
||||
Include: "$(BUILD_SYSTEM)/soong_java_prebuilt.mk",
|
||||
SubName: ".jar",
|
||||
Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) {
|
||||
android.WriteAndroidMkData(w, data)
|
||||
|
|
Loading…
Reference in New Issue