aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorColin Cross2018-12-14 13:49:49 -0600
committerColin Cross2018-12-14 13:49:55 -0600
commitb8901d7fb8c4ea8b829fdbc2da127568436d6b2a (patch)
treeed335d7f6ea35b7ed8afda093d9f3e55473044e2 /common
parent7f9ccd53d79d6eb4bfae1e9d2a1300bdf79a361e (diff)
downloadplatform-build-b8901d7fb8c4ea8b829fdbc2da127568436d6b2a.tar.gz
platform-build-b8901d7fb8c4ea8b829fdbc2da127568436d6b2a.tar.xz
platform-build-b8901d7fb8c4ea8b829fdbc2da127568436d6b2a.zip
Revert "Move dexpreopting to Soong"
This reverts commit e736c58043290dad18ddbd690d554cdc413157a8. Test: none Bug: 119412419
Diffstat (limited to 'common')
-rw-r--r--common/json.mk35
1 files changed, 0 insertions, 35 deletions
diff --git a/common/json.mk b/common/json.mk
deleted file mode 100644
index ba8ffa73e..000000000
--- a/common/json.mk
+++ /dev/null
@@ -1,35 +0,0 @@
14space :=$= $(space)$(space)$(space)$(space)
2invert_bool =$= $(if $(strip $(1)),,true)
3
4# Converts a list to a JSON list.
5# $1: List separator.
6# $2: List.
7_json_list =$= [$(if $(2),"$(subst $(1),"$(comma)",$(2))")]
8
9# Converts a space-separated list to a JSON list.
10json_list =$= $(call _json_list,$(space),$(1))
11
12# Converts a comma-separated list to a JSON list.
13csv_to_json_list =$= $(call _json_list,$(comma),$(1))
14
15# Adds or removes 4 spaces from _json_indent
16json_increase_indent =$= $(eval _json_indent := $$(_json_indent)$$(4space))
17json_decrease_indent =$= $(eval _json_indent := $$(subst _,$$(space),$$(patsubst %____,%,$$(subst $$(space),_,$$(_json_indent)))))
18
19# 1: Key name
20# 2: Value
21add_json_val =$= $(eval _json_contents := $$(_json_contents)$$(_json_indent)"$$(strip $$(1))": $$(strip $$(2))$$(comma)$$(newline))
22add_json_str =$= $(call add_json_val,$(1),"$(strip $(2))")
23add_json_list =$= $(call add_json_val,$(1),$(call json_list,$(patsubst %,%,$(2))))
24add_json_csv =$= $(call add_json_val,$(1),$(call csv_to_json_list,$(strip $(2))))
25add_json_bool =$= $(call add_json_val,$(1),$(if $(strip $(2)),true,false))
26add_json_map =$= $(eval _json_contents := $$(_json_contents)$$(_json_indent)"$$(strip $$(1))": {$$(newline))$(json_increase_indent)
27end_json_map =$= $(json_decrease_indent)$(eval _json_contents := $$(_json_contents)$$(if $$(filter %$$(comma),$$(lastword $$(_json_contents))),__SV_END)$$(_json_indent)},$$(newline))
28
29# Clears _json_contents to start a new json file
30json_start =$= $(eval _json_contents := {$$(newline))$(eval _json_indent := $$(4space))
31
32# Adds the trailing close brace to _json_contents, and removes any trailing commas if necessary
33json_end =$= $(eval _json_contents := $$(subst $$(comma)$$(newline)__SV_END,$$(newline),$$(_json_contents)__SV_END}$$(newline)))
34
35json_contents =$= $(_json_contents)