Merge "Copy implementation and header jars to make when possible"

This commit is contained in:
Paul Duffin
2021-06-17 20:34:49 +00:00
committed by Gerrit Code Review

View File

@@ -231,8 +231,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")
},