diff --git a/Android.bp b/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..b1a778c5630c2c3aca32228a2a58d480d4f561a5 --- /dev/null +++ b/Android.bp @@ -0,0 +1,11 @@ +cc_library_headers { + name: "libminikin_headers", + host_supported: true, + export_include_dirs: ["include"], +} + +subdirs = [ + "app", + "libs/minikin", + "sample", +] diff --git a/app/Android.bp b/app/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..e8085c1f3ea56b169577cb84f1e63c7c7c8f243b --- /dev/null +++ b/app/Android.bp @@ -0,0 +1,30 @@ +// Copyright (C) 2015 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// see how_to_run.txt for instructions on running these tests + +cc_binary_host { + name: "hyphtool", + + static_libs: ["libminikin"], + + // Shared libraries which are dependencies of minikin; these are not automatically + // pulled in by the build system (and thus sadly must be repeated). + shared_libs: [ + "liblog", + "libicuuc", + ], + + srcs: ["HyphTool.cpp"], +} diff --git a/app/Android.mk b/app/Android.mk deleted file mode 100644 index 23305b7b4c6f064122592a850b60e6b35959f5d9..0000000000000000000000000000000000000000 --- a/app/Android.mk +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (C) 2015 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# see how_to_run.txt for instructions on running these tests - -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := hyphtool -LOCAL_MODULE_TAGS := optional - -LOCAL_STATIC_LIBRARIES := libminikin_host - -# Shared libraries which are dependencies of minikin; these are not automatically -# pulled in by the build system (and thus sadly must be repeated). - -LOCAL_SHARED_LIBRARIES := \ - liblog \ - libicuuc - -LOCAL_SRC_FILES += \ - HyphTool.cpp - -include $(BUILD_HOST_EXECUTABLE) diff --git a/libs/minikin/Android.bp b/libs/minikin/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..f7b2dea05707d0875fd2b111d8106240844e65b6 --- /dev/null +++ b/libs/minikin/Android.bp @@ -0,0 +1,89 @@ +// Copyright (C) 2013 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generate unicode emoji data from UCD. +genrule { + name: "gen-emoji-header", + cmd: "python $(location unicode_emoji_h_gen.py) -i $(in) -o $(out)", + srcs: ["emoji-data.txt"], + out: ["generated/UnicodeData.h"], + tool_files: ["unicode_emoji_h_gen.py"], +} + +cc_library { + name: "libminikin", + host_supported: true, + srcs: [ + "Hyphenator.cpp", + ], + target: { + android: { + srcs: [ + "AnalyzeStyle.cpp", + "CmapCoverage.cpp", + "FontCollection.cpp", + "FontFamily.cpp", + "FontLanguage.cpp", + "FontLanguageListCache.cpp", + "GraphemeBreak.cpp", + "HbFontCache.cpp", + "Layout.cpp", + "LayoutUtils.cpp", + "LineBreaker.cpp", + "Measurement.cpp", + "MinikinInternal.cpp", + "MinikinRefCounted.cpp", + "MinikinFont.cpp", + "MinikinFontFreeType.cpp", + "SparseBitSet.cpp", + "WordBreaker.cpp", + ], + shared_libs: [ + "libharfbuzz_ng", + "libft2", + "libz", + "libutils", + ], + // TODO: clean up Minikin so it doesn't need the freetype include + export_shared_lib_headers: ["libft2"], + }, + }, + generated_headers: ["gen-emoji-header"], + cppflags: [ + "-Werror", + "-Wall", + "-Wextra", + ], + product_variables: { + debuggable: { + // Enable race detection on eng and userdebug build. + cppflags: ["-DENABLE_RACE_DETECTION"], + }, + }, + shared_libs: [ + "liblog", + "libicuuc", + ], + header_libs: ["libminikin_headers"], + export_header_lib_headers: ["libminikin_headers"], + + clang: true, + sanitize: { + misc_undefined: [ + "signed-integer-overflow", + // b/26432628. + //"unsigned-integer-overflow", + ], + }, +} diff --git a/libs/minikin/Android.mk b/libs/minikin/Android.mk deleted file mode 100644 index d6c3df7f621e6633ef29cdee273f9a3cd28fbf96..0000000000000000000000000000000000000000 --- a/libs/minikin/Android.mk +++ /dev/null @@ -1,116 +0,0 @@ -# Copyright (C) 2013 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) -# Generate unicode emoji data from UCD. -UNICODE_EMOJI_H_GEN_PY := $(LOCAL_PATH)/unicode_emoji_h_gen.py -UNICODE_EMOJI_DATA := $(TOP)/external/unicode/emoji-data.txt - -UNICODE_EMOJI_H := $(intermediates)/generated/UnicodeData.h -$(UNICODE_EMOJI_H): $(UNICODE_EMOJI_H_GEN_PY) $(UNICODE_EMOJI_DATA) -$(LOCAL_PATH)/MinikinInternal.cpp: $(UNICODE_EMOJI_H) -$(UNICODE_EMOJI_H): PRIVATE_CUSTOM_TOOL := python $(UNICODE_EMOJI_H_GEN_PY) \ - -i $(UNICODE_EMOJI_DATA) \ - -o $(UNICODE_EMOJI_H) -$(UNICODE_EMOJI_H): - $(transform-generated-source) - -include $(CLEAR_VARS) -minikin_src_files := \ - AnalyzeStyle.cpp \ - CmapCoverage.cpp \ - FontCollection.cpp \ - FontFamily.cpp \ - FontLanguage.cpp \ - FontLanguageListCache.cpp \ - GraphemeBreak.cpp \ - HbFontCache.cpp \ - Hyphenator.cpp \ - Layout.cpp \ - LayoutUtils.cpp \ - LineBreaker.cpp \ - Measurement.cpp \ - MinikinInternal.cpp \ - MinikinRefCounted.cpp \ - MinikinFont.cpp \ - MinikinFontFreeType.cpp \ - SparseBitSet.cpp \ - WordBreaker.cpp - -minikin_c_includes := \ - external/harfbuzz_ng/src \ - external/freetype/include \ - frameworks/minikin/include \ - $(intermediates) - -minikin_shared_libraries := \ - libharfbuzz_ng \ - libft2 \ - liblog \ - libz \ - libicuuc \ - libutils - -ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) -# Enable race detection on eng and userdebug build. -enable_race_detection := -DENABLE_RACE_DETECTION -else -enable_race_detection := -endif - -LOCAL_MODULE := libminikin -LOCAL_EXPORT_C_INCLUDE_DIRS := frameworks/minikin/include -LOCAL_SRC_FILES := $(minikin_src_files) -LOCAL_C_INCLUDES := $(minikin_c_includes) -LOCAL_CPPFLAGS += -Werror -Wall -Wextra $(enable_race_detection) -LOCAL_SHARED_LIBRARIES := $(minikin_shared_libraries) -LOCAL_CLANG := true -LOCAL_SANITIZE := signed-integer-overflow -# b/26432628. -#LOCAL_SANITIZE += unsigned-integer-overflow - -include $(BUILD_SHARED_LIBRARY) - -include $(CLEAR_VARS) - -LOCAL_MODULE := libminikin -LOCAL_MODULE_TAGS := optional -LOCAL_EXPORT_C_INCLUDE_DIRS := frameworks/minikin/include -LOCAL_SRC_FILES := $(minikin_src_files) -LOCAL_C_INCLUDES := $(minikin_c_includes) -LOCAL_CPPFLAGS += -Werror -Wall -Wextra $(enable_race_detection) -LOCAL_SHARED_LIBRARIES := $(minikin_shared_libraries) -LOCAL_CLANG := true -LOCAL_SANITIZE := signed-integer-overflow -# b/26432628. -#LOCAL_SANITIZE += unsigned-integer-overflow - -include $(BUILD_STATIC_LIBRARY) - -include $(CLEAR_VARS) - -# Reduced library (currently just hyphenation) for host - -LOCAL_MODULE := libminikin_host -LOCAL_MODULE_TAGS := optional -LOCAL_EXPORT_C_INCLUDE_DIRS := frameworks/minikin/include -LOCAL_C_INCLUDES := $(minikin_c_includes) -LOCAL_CPPFLAGS += -Werror -Wall -Wextra $(enable_race_detection) -LOCAL_SHARED_LIBRARIES := liblog libicuuc - -LOCAL_SRC_FILES := Hyphenator.cpp - -include $(BUILD_HOST_STATIC_LIBRARY) diff --git a/libs/minikin/emoji-data.txt b/libs/minikin/emoji-data.txt new file mode 120000 index 0000000000000000000000000000000000000000..90161250c54d0af1c8ce355b2bd7abf7208d91fb --- /dev/null +++ b/libs/minikin/emoji-data.txt @@ -0,0 +1 @@ +../../../../external/unicode/emoji-data.txt \ No newline at end of file diff --git a/sample/Android.bp b/sample/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..208988969a91a0d87dc8eded07ee34551aa992f3 --- /dev/null +++ b/sample/Android.bp @@ -0,0 +1,53 @@ +// Copyright (C) 2013 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +cc_test { + name: "minikin_example", + gtest: false, + + srcs: ["example.cpp"], + + shared_libs: [ + "libutils", + "liblog", + "libcutils", + "libharfbuzz_ng", + "libicuuc", + "libft2", + "libpng", + "libz", + "libminikin", + ], +} + +cc_test { + name: "minikin_skia_example", + gtest: false, + + srcs: [ + "example_skia.cpp", + "MinikinSkia.cpp", + ], + + shared_libs: [ + "libutils", + "liblog", + "libcutils", + "libharfbuzz_ng", + "libicuuc", + "libskia", + "libminikin", + "libft2", + ], +} diff --git a/sample/Android.mk b/sample/Android.mk deleted file mode 100644 index c4a644d74d51f9b02406e7f361d7d0db7ebc2057..0000000000000000000000000000000000000000 --- a/sample/Android.mk +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright (C) 2013 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE_TAGS := tests - -LOCAL_C_INCLUDES += \ - external/harfbuzz_ng/src \ - external/freetype/include \ - frameworks/minikin/include - -LOCAL_SRC_FILES:= example.cpp - -LOCAL_SHARED_LIBRARIES += \ - libutils \ - liblog \ - libcutils \ - libharfbuzz_ng \ - libicuuc \ - libft2 \ - libpng \ - libz \ - libminikin - -LOCAL_MODULE:= minikin_example - -include $(BUILD_EXECUTABLE) - - -include $(CLEAR_VARS) - -LOCAL_MODULE_TAG := tests - -LOCAL_C_INCLUDES += \ - external/harfbuzz_ng/src \ - external/freetype/include \ - frameworks/minikin/include \ - external/skia/src/core - -LOCAL_SRC_FILES:= example_skia.cpp \ - MinikinSkia.cpp - -LOCAL_SHARED_LIBRARIES += \ - libutils \ - liblog \ - libcutils \ - libharfbuzz_ng \ - libicuuc \ - libskia \ - libminikin \ - libft2 - -LOCAL_MODULE:= minikin_skia_example - -include $(BUILD_EXECUTABLE)