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 11 ifeq (,$(icu4c_data)) 12 $(error Must set icu4c_data before including adjust_icudt_path.mk) 13 endif 14 15 ifeq (,$(icu4j_config_root)) 16 $(error Must set icu4j_config_root before including adjust_icudt_path.mk) 17 endif 18 19 config_path := com/ibm/icu/ICUConfig.properties 20 tmp_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 32 icu4c_data := 33 icu4c_config_root := 34 config_path := 35 tmp_resource_dir := 36 37