soong: rework soong_config for Pie
Change-Id: I3c5001f02975e5487ba66a02217f1d24d2021272
diff --git a/build/soong/soong_config.mk b/build/soong/soong_config.mk
index eed8e09..46d8c29 100644
--- a/build/soong/soong_config.mk
+++ b/build/soong/soong_config.mk
@@ -1,7 +1,8 @@
-omnirom_soong:
- $(hide) mkdir -p $(dir $@)
- $(hide) (\
- echo '{'; \
- echo '"Omnirom": {'; \
- echo '},'; \
- echo '') > $(SOONG_VARIABLES_TMP)
+_contents := $(_contents) "Omnirom":{$(newline)
+
+# See build/core/soong_config.mk for the add_json_* functions you can use here.
+
+# This causes the build system to strip out the last comma in our nested struct, to keep the JSON valid.
+_contents := $(_contents)__SV_END
+
+_contents := $(_contents) },$(newline)