aboutsummaryrefslogtreecommitdiffstats
path: root/androidmk
diff options
context:
space:
mode:
authorSasha Smundak <asmundak@google.com>2019-03-08 15:43:26 -0800
committerSasha Smundak <asmundak@google.com>2019-03-11 10:11:17 -0700
commit177a1a589d97385324fe73ecc24dae0befde44b4 (patch)
treef4b9977f967cf512a70d578b4f3838622b181507 /androidmk
parentfdd1457fa683d5a7c21c471d5dc3294cdb29cf1e (diff)
downloadbuild_soong-177a1a589d97385324fe73ecc24dae0befde44b4.tar.gz
build_soong-177a1a589d97385324fe73ecc24dae0befde44b4.tar.bz2
build_soong-177a1a589d97385324fe73ecc24dae0befde44b4.zip
Fix crash in mergeListProperties
The value of a property to be merged may be a reference to a variable. When we first create an attribute for a makefile variable (e.g. we create 'android_static_libs' from LOCAL_STATIC_ANDROID_LIBRARIES), we set its type correctly. However, reparse in bpfix erases this information, so by the time 'android_static_libs' attribute is to be merged with 'static_libs', it has no type and merge occurs. It isn't easy to fix properly, so just don't merge in such case, Soong will complain and it will be fixed manually. Fixes: 125519127 Test: unit tests in androidmk_test.go Change-Id: Ic66d7ab686a2fdde987f32e2b204c72d9bf0d026
Diffstat (limited to 'androidmk')
-rw-r--r--androidmk/cmd/androidmk/androidmk_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/androidmk/cmd/androidmk/androidmk_test.go b/androidmk/cmd/androidmk/androidmk_test.go
index 98d4506a..2976a0cd 100644
--- a/androidmk/cmd/androidmk/androidmk_test.go
+++ b/androidmk/cmd/androidmk/androidmk_test.go
@@ -1075,6 +1075,25 @@ vts_config {
// Comment line 2
`,
},
+ {
+ desc: "Merge with variable reference",
+ in: `
+include $(CLEAR_VARS)
+LOCAL_MODULE := foo
+LOCAL_STATIC_ANDROID_LIBRARIES := $(FOO)
+LOCAL_STATIC_JAVA_LIBRARIES := javalib
+LOCAL_JAVA_RESOURCE_DIRS := $(FOO)
+include $(BUILD_PACKAGE)
+`,
+ expected: `
+android_app {
+ name: "foo",
+ static_libs: FOO,
+ static_libs: ["javalib"],
+ java_resource_dirs: FOO,
+}
+`,
+ },
}
func TestEndToEnd(t *testing.T) {