aboutsummaryrefslogtreecommitdiffstats
path: root/androidmk
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2018-02-21 16:40:06 -0800
committerColin Cross <ccross@android.com>2018-02-22 14:54:47 -0800
commit336ad7a6676515ec1f2a432ca176af62ff180155 (patch)
tree8e088ff39cb337c37bcd82ce6f6c8457622871ee /androidmk
parent3fad895e756e9483fd3eee210d14a43f936703dd (diff)
downloadbuild_soong-336ad7a6676515ec1f2a432ca176af62ff180155.tar.gz
build_soong-336ad7a6676515ec1f2a432ca176af62ff180155.tar.bz2
build_soong-336ad7a6676515ec1f2a432ca176af62ff180155.zip
Fix java_import and android_library_import conversions
java_import and android_library_import modules can't be handled directly in androidmk because the results may depend on properties that haven't been parsed yet. Add a bpfix pass (which is automatically included at the end of androidmk) to select android_library_import vs. java_import based on the extension of the prebuilt file, and convert the srcs property to jars or aars as appropriate. Bug: 73724997 Test: androidmk_test.go Change-Id: I1024742e9e96d5e1e88c3cc139eeb0d5a2f6849b
Diffstat (limited to 'androidmk')
-rw-r--r--androidmk/cmd/androidmk/androidmk_test.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/androidmk/cmd/androidmk/androidmk_test.go b/androidmk/cmd/androidmk/androidmk_test.go
index 3252791f..45df1a57 100644
--- a/androidmk/cmd/androidmk/androidmk_test.go
+++ b/androidmk/cmd/androidmk/androidmk_test.go
@@ -492,6 +492,36 @@ include $(call all-makefiles-under,$(LOCAL_PATH))
}
`,
},
+ {
+ desc: "java prebuilt",
+ in: `
+ include $(CLEAR_VARS)
+ LOCAL_SRC_FILES := test.jar
+ LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+ include $(BUILD_PREBUILT)
+ `,
+ expected: `
+ java_import {
+ jars: ["test.jar"],
+
+ }
+ `,
+ },
+ {
+ desc: "aar prebuilt",
+ in: `
+ include $(CLEAR_VARS)
+ LOCAL_SRC_FILES := test.aar
+ LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+ include $(BUILD_PREBUILT)
+ `,
+ expected: `
+ android_library_import {
+ aars: ["test.aar"],
+
+ }
+ `,
+ },
}
func reformatBlueprint(input string) string {