Merge "Copy implementation and header jars to make when possible" am: 94b2e705d1 am: d11c1c8fa4

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1740074

Change-Id: I83a02203cbebd6dff91a06a7969615fbdfd01390
This commit is contained in:
Paul Duffin 2021-06-17 21:37:45 +00:00 committed by Automerger Merge Worker
commit 33ddfdf42b

View file

@ -230,8 +230,17 @@ func (p *prebuiltCommon) AndroidMkEntries() []android.AndroidMkEntries {
// we need to remove the suffix from LOCAL_MODULE_STEM, otherwise
// we will have foo.jar.jar
entries.SetString("LOCAL_MODULE_STEM", strings.TrimSuffix(fi.stem(), ".jar"))
entries.SetString("LOCAL_SOONG_CLASSES_JAR", fi.builtFile.String())
entries.SetString("LOCAL_SOONG_HEADER_JAR", fi.builtFile.String())
var classesJar android.Path
var headerJar android.Path
if javaModule, ok := fi.module.(java.ApexDependency); ok {
classesJar = javaModule.ImplementationAndResourcesJars()[0]
headerJar = javaModule.HeaderJars()[0]
} else {
classesJar = fi.builtFile
headerJar = fi.builtFile
}
entries.SetString("LOCAL_SOONG_CLASSES_JAR", classesJar.String())
entries.SetString("LOCAL_SOONG_HEADER_JAR", headerJar.String())
entries.SetString("LOCAL_SOONG_DEX_JAR", fi.builtFile.String())
entries.SetString("LOCAL_DEX_PREOPT", "false")
},