1# In order to append $(icu4c_data) to the dataPath line in ICUConfig.properties
2# this hack here removes the path to that file in the source tree and instead
3# appends the path to a dynamically generated modified file to the list of
4# arguments passed to the jar tool.
5#
6# Prerequisites : $(icu4c_data) must be set. This variable will be cleared
7# after it's used.
8#
9# Usage : include this makefile after your $(BUILD*) rule.
10
11ifeq (,$(icu4c_data))
12$(error Must set icu4c_data before including adjust_icudt_path.mk)
13endif
14
15ifeq (,$(icu4j_config_root))
16$(error Must set icu4j_config_root before including adjust_icudt_path.mk)
17endif
18
19config_path := com/ibm/icu/ICUConfig.properties
20tmp_resource_dir := $(intermediates.COMMON)/tmp
21
22$(tmp_resource_dir)/$(config_path): private_icu4c_data := $(subst /,\/,$(icu4c_data))
23$(tmp_resource_dir)/$(config_path): $(icu4j_config_root)/$(config_path)
24	$(hide) mkdir -p $(dir $@)
25	$(hide) sed "/\.dataPath =/s/$$/ $(private_icu4c_data)/" $< > $@
26
27$(LOCAL_INTERMEDIATE_TARGETS): $(tmp_resource_dir)/$(config_path)
28$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_EXTRA_JAR_ARGS := \
29    $(subst -C "$(icu4j_config_root)" "$(config_path)",,$(extra_jar_args)) \
30    -C "$(tmp_resource_dir)" "$(config_path)"
31
32icu4c_data :=
33icu4c_config_root :=
34config_path :=
35tmp_resource_dir :=
36
37