aboutsummaryrefslogtreecommitdiffstats
path: root/java/androidmk.go
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2019-02-21 18:12:14 -0800
committerColin Cross <ccross@android.com>2019-03-20 19:29:59 +0000
commit42be761ebdc3ba35bc4f7851c20d50e2acd23fde (patch)
tree64b733bf1ad1eb4105d935809388f82e8d8ef845 /java/androidmk.go
parent1b781e52e2820d5c4e923844397c010a9e97e1d3 (diff)
downloadandroid_build_soong-42be761ebdc3ba35bc4f7851c20d50e2acd23fde.tar.gz
android_build_soong-42be761ebdc3ba35bc4f7851c20d50e2acd23fde.tar.bz2
android_build_soong-42be761ebdc3ba35bc4f7851c20d50e2acd23fde.zip
Add dex_import module type
Add a module type for importing a prebuilt jar that contains classes.dex files. Test: m with a prebuilt jar that contains classes.dex files in PRODUCT_BOOT_JARS Test: java_test.go, dexpreopt_test.go, dexpreopt_bootjars_test.go Bug: 124804356 Bug: 125517186 Change-Id: I496848f9dca11f758d49b1cb68168cec7f8e1718
Diffstat (limited to 'java/androidmk.go')
-rw-r--r--java/androidmk.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/java/androidmk.go b/java/androidmk.go
index 533b82e4..0c3b1c76 100644
--- a/java/androidmk.go
+++ b/java/androidmk.go
@@ -131,6 +131,28 @@ func (prebuilt *Import) AndroidMk() android.AndroidMkData {
}
}
+func (prebuilt *DexImport) AndroidMk() android.AndroidMkData {
+ return android.AndroidMkData{
+ Class: "JAVA_LIBRARIES",
+ OutputFile: android.OptionalPathForPath(prebuilt.maybeStrippedDexJarFile),
+ Include: "$(BUILD_SYSTEM)/soong_java_prebuilt.mk",
+ Extra: []android.AndroidMkExtraFunc{
+ func(w io.Writer, outputFile android.Path) {
+ if prebuilt.dexJarFile != nil {
+ fmt.Fprintln(w, "LOCAL_SOONG_DEX_JAR :=", prebuilt.dexJarFile.String())
+ // TODO(b/125517186): export the dex jar as a classes jar to match some mis-uses in Make until
+ // boot_jars_package_check.mk can check dex jars.
+ fmt.Fprintln(w, "LOCAL_SOONG_HEADER_JAR :=", prebuilt.dexJarFile.String())
+ fmt.Fprintln(w, "LOCAL_SOONG_CLASSES_JAR :=", prebuilt.dexJarFile.String())
+ }
+ if len(prebuilt.dexpreopter.builtInstalled) > 0 {
+ fmt.Fprintln(w, "LOCAL_SOONG_BUILT_INSTALLED :=", prebuilt.dexpreopter.builtInstalled)
+ }
+ },
+ },
+ }
+}
+
func (prebuilt *AARImport) AndroidMk() android.AndroidMkData {
return android.AndroidMkData{
Class: "JAVA_LIBRARIES",