diff options
author | Raph Levien <raph@google.com> | 2015-09-03 16:18:30 -0700 |
---|---|---|
committer | Roozbeh Pournader <roozbeh@google.com> | 2015-10-14 19:13:32 +0000 |
commit | c15709c28e9623c1937038f08af603c492901cbd (patch) | |
tree | 757ac71eb3f90f79e5c6580e524c8cf787bebf89 | |
parent | 7104a91f415b1001b75909f837f3b54d54671ea3 (diff) | |
download | hyphenation-patterns-marshmallow-dr-dragon-release.tar.gz |
Compile the hyphenation patterns to binaryandroid-wear-7.1.1_r1android-n-iot-preview-2android-6.0.1_r9android-6.0.1_r81android-6.0.1_r80android-6.0.1_r8android-6.0.1_r79android-6.0.1_r78android-6.0.1_r77android-6.0.1_r74android-6.0.1_r73android-6.0.1_r72android-6.0.1_r70android-6.0.1_r7android-6.0.1_r69android-6.0.1_r68android-6.0.1_r67android-6.0.1_r66android-6.0.1_r65android-6.0.1_r63android-6.0.1_r62android-6.0.1_r61android-6.0.1_r60android-6.0.1_r59android-6.0.1_r58android-6.0.1_r57android-6.0.1_r56android-6.0.1_r55android-6.0.1_r54android-6.0.1_r53android-6.0.1_r52android-6.0.1_r51android-6.0.1_r50android-6.0.1_r5android-6.0.1_r49android-6.0.1_r48android-6.0.1_r47android-6.0.1_r46android-6.0.1_r45android-6.0.1_r43android-6.0.1_r42android-6.0.1_r41android-6.0.1_r40android-6.0.1_r4android-6.0.1_r33android-6.0.1_r32android-6.0.1_r31android-6.0.1_r30android-6.0.1_r3android-6.0.1_r28android-6.0.1_r27android-6.0.1_r26android-6.0.1_r25android-6.0.1_r24android-6.0.1_r22android-6.0.1_r21android-6.0.1_r20android-6.0.1_r18android-6.0.1_r17android-6.0.1_r16android-6.0.1_r13android-6.0.1_r12android-6.0.1_r11android-6.0.1_r10android-6.0.1_r1android-6.0.0_r41nougat-mr1-wear-releasen-iot-preview-2marshmallow-mr3-releasemarshmallow-mr2-releasemarshmallow-mr1-releasemarshmallow-mr1-devmarshmallow-dr1.6-releasemarshmallow-dr1.5-releasemarshmallow-dr1.5-devmarshmallow-dr-dragon-releasemarshmallow-dr-arc-m54marshmallow-dr-arc-m53marshmallow-dr-arc-dev
Makefile updates to compile the hyphenation patterns to binary format
on the device.
Bug: 21562869
Bug: 21826930
Bug: 24570591
Change-Id: I8b92ed16626d11dce299415280d2e1a075436481
(cherry picked from commit 9c07dd308499248830f6f9c423fdb0c7bc10ff24)
-rw-r--r-- | Android.mk | 35 | ||||
-rw-r--r-- | build-hyb.mk | 13 | ||||
-rw-r--r-- | patterns.mk | 10 |
3 files changed, 33 insertions, 25 deletions
@@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -HYPHENS_DIR := $(call my-dir) +LOCAL_PATH := $(call my-dir) pattern_locales := \ en-US/en-us \ @@ -21,35 +21,32 @@ pattern_locales := \ hu/hu \ hy/hy \ nb/nb \ - nn/nn \ - sa/sa + nn/nn -pattern_src_files := \ - $(foreach locale, $(pattern_locales), \ - $(addprefix $(dir $(locale)), \ - $(addprefix hyph-, $(addprefix $(notdir $(locale)), \ - .chr.txt .hyp.txt .lic.txt .pat.txt)))) -pattern_locales := +# TODO: we have data for sa/sa, but it requires special case handling for case +# folding and normalization, so don't build it until that's fixed. -# We have to use BUILD_PREBUILT instead of PRODUCT_COPY_FILES, -# to copy over the NOTICE file. +BUILD_HYB := $(LOCAL_PATH)/build-hyb.mk ############################################################################# -# $(1): The source file name in LOCAL_PATH. -# It also serves as the module name and the dest file name. +# $(1): The subdirectory where the source files live. +$ $(2): The file name fragment. +# It is used to find source files, and also generate the resulting binary. ############################################################################# define build-one-pattern-module $(eval include $(CLEAR_VARS))\ -$(eval LOCAL_PATH := $(abspath $(addprefix $(HYPHENS_DIR)/, $(dir $(1)))))\ -$(eval LOCAL_MODULE := $(notdir $(1)))\ -$(eval LOCAL_SRC_FILES := $(notdir $(1)))\ +$(eval LOCAL_MODULE := $(addprefix hyph-, $(2)))\ +$(eval LOCAL_SRC_FILES := $(addprefix $(1)/hyph-, $(addprefix $(2), .pat.txt .chr.txt .hyp.txt)))\ +$(eval include $(BUILD_HYB))\ +$(eval include $(CLEAR_VARS))\ +$(eval LOCAL_MODULE := $(addprefix $(addprefix hyph-, $(2)), .lic.txt))\ +$(eval LOCAL_SRC_FILES := $(addprefix $(1)/hyph-, $(addprefix $(2), .lic.txt)))\ $(eval LOCAL_MODULE_CLASS := ETC)\ $(eval LOCAL_MODULE_TAGS := optional)\ $(eval LOCAL_MODULE_PATH := $(TARGET_OUT)/usr/hyphen-data)\ $(eval include $(BUILD_PREBUILT)) endef -$(foreach f, $(pattern_src_files), $(call build-one-pattern-module, $(f))) +$(foreach l, $(pattern_locales), $(call build-one-pattern-module, $(dir $(l)), $(notdir $l))) build-one-pattern-module := -pattern_src_files := -HYPHENS_DIR := +pattern_locales := diff --git a/build-hyb.mk b/build-hyb.mk new file mode 100644 index 0000000..a809c91 --- /dev/null +++ b/build-hyb.mk @@ -0,0 +1,13 @@ + +LOCAL_MODULE_CLASS := ETC +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_SUFFIX := .hyb +LOCAL_MODULE_PATH := $(TARGET_OUT)/usr/hyphen-data + +include $(BUILD_SYSTEM)/base_rules.mk + +MK_HYB_FILE := frameworks/minikin/tools/mk_hyb_file.py +$(LOCAL_BUILT_MODULE) : $(addprefix $(LOCAL_PATH)/, $(LOCAL_SRC_FILES)) $(MK_HYB_FILE) + @echo "Build hyb $@ <- $<" + @mkdir -p $(dir $@) + $(hide) $(MK_HYB_FILE) $< $@ diff --git a/patterns.mk b/patterns.mk index 82ee76e..bae5ea9 100644 --- a/patterns.mk +++ b/patterns.mk @@ -12,17 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -# We have to use PRODUCT_PACKAGES (together with BUILD_PREBUILT) instead of +# We have to use PRODUCT_PACKAGES (together with BUILD_HYPH) instead of # PRODUCT_COPY_FILES to install the pattern files, so that the NOTICE file can # get installed too. pattern_locales := \ en-us eu hu hy \ - nb nn sa und-ethi + nb nn und-ethi -PRODUCT_PACKAGES := \ - $(foreach locale, $(pattern_locales), \ - $(addprefix hyph-, $(addprefix $(locale), \ - .chr.txt .hyp.txt .lic.txt .pat.txt))) +PRODUCT_PACKAGES := $(addprefix hyph-,$(pattern_locales)) \ + $(addsuffix .lic.txt,$(addprefix hyph-,$(pattern_locales))) pattern_locales := |