aboutsummaryrefslogtreecommitdiffstats
path: root/native/dicttoolkit
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2018-10-24 17:44:49 -0700
committerDan Willemsen <dwillemsen@google.com>2018-11-01 23:09:33 +0000
commita23407bf62460833bb5f70f6c0c6b787443a4812 (patch)
treec89d66e72cc28d7edbcdec5abea2baed68cb9d00 /native/dicttoolkit
parenta92d0f926269264e578c9162c5df230cafb99b7c (diff)
downloadlatinime-a23407bf62460833bb5f70f6c0c6b787443a4812.tar.gz
latinime-a23407bf62460833bb5f70f6c0c6b787443a4812.tar.xz
latinime-a23407bf62460833bb5f70f6c0c6b787443a4812.zip
Convert to Android.bp
See build/soong/README.md for more information. Test: cd packages/inputmethods/LatinIME; mma Change-Id: Ib8867d3b74f09fc1d9f95adc9a49a81ac0f7f054 Merged-In: Ib8867d3b74f09fc1d9f95adc9a49a81ac0f7f054
Diffstat (limited to 'native/dicttoolkit')
-rw-r--r--native/dicttoolkit/Android.bp94
-rw-r--r--native/dicttoolkit/Android.mk66
-rw-r--r--native/dicttoolkit/CleanupNativeFileList.mk17
-rw-r--r--native/dicttoolkit/NativeFileList.mk44
-rw-r--r--native/dicttoolkit/UnitTests.mk65
-rw-r--r--native/dicttoolkit/src/offdevice_intermediate_dict/offdevice_intermediate_dict.h2
-rw-r--r--native/dicttoolkit/src/offdevice_intermediate_dict/offdevice_intermediate_dict_pt_node.h2
-rw-r--r--native/dicttoolkit/tests/offdevice_intermediate_dict/offdevice_intermediate_dict_test.cpp2
8 files changed, 97 insertions, 195 deletions
diff --git a/native/dicttoolkit/Android.bp b/native/dicttoolkit/Android.bp
new file mode 100644
index 000000000..b214ff984
--- /dev/null
+++ b/native/dicttoolkit/Android.bp
@@ -0,0 +1,94 @@
+// Copyright (C) 2014 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_defaults {
+ name: "dicttoolkit_defaults",
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+ "-Wextra",
+ "-Weffc++",
+ "-Wformat=2",
+ "-Wcast-qual",
+ "-Wcast-align",
+ "-Wwrite-strings",
+ "-Wfloat-equal",
+ "-Wpointer-arith",
+ "-Winit-self",
+ "-Wredundant-decls",
+ "-Woverloaded-virtual",
+ "-Wsign-promo",
+ "-Wno-system-headers",
+
+ // To suppress compiler warnings for unused variables/functions used for debug features etc.
+ "-Wno-unused-parameter",
+ "-Wno-unused-function",
+ ],
+
+ local_include_dirs: ["src"],
+ // TODO
+ include_dirs: ["packages/inputmethods/LatinIME/native/jni/src"],
+
+ product_variables: {
+ unbundled_build: {
+ enabled: false,
+ },
+ },
+}
+
+cc_library_host_static {
+ name: "liblatinime_dicttoolkit",
+ defaults: ["dicttoolkit_defaults"],
+
+ srcs: [
+ "src/command_executors/diff_executor.cpp",
+ "src/command_executors/header_executor.cpp",
+ "src/command_executors/help_executor.cpp",
+ "src/command_executors/info_executor.cpp",
+ "src/command_executors/makedict_executor.cpp",
+ "src/offdevice_intermediate_dict/offdevice_intermediate_dict.cpp",
+ "src/utils/arguments_parser.cpp",
+ "src/utils/command_utils.cpp",
+ "src/utils/utf8_utils.cpp",
+
+ ":LATIN_IME_CORE_SRC_FILES",
+ ],
+}
+
+cc_binary_host {
+ name: "dicttoolkit",
+ defaults: ["dicttoolkit_defaults"],
+
+ srcs: ["dict_toolkit_main.cpp"],
+ static_libs: ["liblatinime_dicttoolkit"],
+}
+
+cc_test_host {
+ name: "dicttoolkit_unittests",
+ defaults: ["dicttoolkit_defaults"],
+
+ srcs: [
+ "tests/command_executors/diff_executor_test.cpp",
+ "tests/command_executors/header_executor_test.cpp",
+ "tests/command_executors/info_executor_test.cpp",
+ "tests/command_executors/makedict_executor_test.cpp",
+ "tests/dict_toolkit_defines_test.cpp",
+ "tests/offdevice_intermediate_dict/offdevice_intermediate_dict_test.cpp",
+ "tests/utils/arguments_parser_test.cpp",
+ "tests/utils/command_utils_test.cpp",
+ "tests/utils/utf8_utils_test.cpp",
+ ],
+ static_libs: ["liblatinime_dicttoolkit"],
+}
diff --git a/native/dicttoolkit/Android.mk b/native/dicttoolkit/Android.mk
deleted file mode 100644
index 7a446860c..000000000
--- a/native/dicttoolkit/Android.mk
+++ /dev/null
@@ -1,66 +0,0 @@
-# Copyright (C) 2014 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.
-
-ifeq (,$(TARGET_BUILD_APPS))
-
-# Only build if it's explicitly requested, or running mm/mmm.
-ifneq ($(ONE_SHOT_MAKEFILE)$(filter $(MAKECMDGOALS),dicttoolkit),)
-
-# HACK: Temporarily disable host tool build on Mac until the build system is ready for C++11.
-LATINIME_HOST_OSNAME := $(shell uname -s)
-ifneq ($(LATINIME_HOST_OSNAME), Darwin) # TODO: Remove this
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LATIN_IME_CORE_PATH := $(LOCAL_PATH)/../jni
-
-LATIN_IME_DICT_TOOLKIT_SRC_DIR := src
-LATIN_IME_CORE_SRC_DIR := ../jni/src
-
-LOCAL_CFLAGS += -Werror -Wall -Wextra -Weffc++ -Wformat=2 -Wcast-qual -Wcast-align \
- -Wwrite-strings -Wfloat-equal -Wpointer-arith -Winit-self -Wredundant-decls \
- -Woverloaded-virtual -Wsign-promo -Wno-system-headers
-
-# To suppress compiler warnings for unused variables/functions used for debug features etc.
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function
-
-include $(LOCAL_PATH)/NativeFileList.mk
-include $(LATIN_IME_CORE_PATH)/NativeFileList.mk
-
-LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(LATIN_IME_DICT_TOOLKIT_SRC_DIR) \
- $(LATIN_IME_CORE_PATH)/$(LATIN_IME_CORE_SRC_DIR)
-
-LOCAL_SRC_FILES := $(LATIN_IME_DICT_TOOLKIT_MAIN_SRC_FILES) \
- $(addprefix $(LATIN_IME_DICT_TOOLKIT_SRC_DIR)/, $(LATIN_IME_DICT_TOOLKIT_SRC_FILES)) \
- $(addprefix $(LATIN_IME_CORE_SRC_DIR)/, $(LATIN_IME_CORE_SRC_FILES))
-
-LOCAL_MODULE := dicttoolkit
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_CXX_STL := libc++
-
-include $(BUILD_HOST_EXECUTABLE)
-#################### Clean up the tmp vars
-include $(LOCAL_PATH)/CleanupNativeFileList.mk
-#################### Unit test
-include $(LOCAL_PATH)/UnitTests.mk
-
-endif # Darwin - TODO: Remove this
-
-endif
-
-endif # TARGET_BUILD_APPS
diff --git a/native/dicttoolkit/CleanupNativeFileList.mk b/native/dicttoolkit/CleanupNativeFileList.mk
deleted file mode 100644
index b804b41ed..000000000
--- a/native/dicttoolkit/CleanupNativeFileList.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (C) 2014 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.
-
-LATIN_IME_DICT_TOOLKIT_MAIN_SRC_FILES :=
-LATIN_IME_DICT_TOOLKIT_SRC_FILES :=
-LATIN_IME_DICT_TOOLKIT_TEST_FILES :=
diff --git a/native/dicttoolkit/NativeFileList.mk b/native/dicttoolkit/NativeFileList.mk
deleted file mode 100644
index 9a547b054..000000000
--- a/native/dicttoolkit/NativeFileList.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 2014 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.
-
-LATIN_IME_DICT_TOOLKIT_MAIN_SRC_FILES := \
- dict_toolkit_main.cpp
-
-LATIN_IME_DICT_TOOLKIT_SRC_FILES := \
- $(addprefix command_executors/, \
- diff_executor.cpp \
- header_executor.cpp \
- help_executor.cpp \
- info_executor.cpp \
- makedict_executor.cpp) \
- $(addprefix offdevice_intermediate_dict/, \
- offdevice_intermediate_dict.cpp) \
- $(addprefix utils/, \
- arguments_parser.cpp \
- command_utils.cpp \
- utf8_utils.cpp)
-
-LATIN_IME_DICT_TOOLKIT_TEST_FILES := \
- $(addprefix command_executors/, \
- diff_executor_test.cpp \
- header_executor_test.cpp \
- info_executor_test.cpp \
- makedict_executor_test.cpp) \
- dict_toolkit_defines_test.cpp \
- $(addprefix offdevice_intermediate_dict/, \
- offdevice_intermediate_dict_test.cpp) \
- $(addprefix utils/, \
- arguments_parser_test.cpp \
- command_utils_test.cpp \
- utf8_utils_test.cpp)
diff --git a/native/dicttoolkit/UnitTests.mk b/native/dicttoolkit/UnitTests.mk
deleted file mode 100644
index 55177c084..000000000
--- a/native/dicttoolkit/UnitTests.mk
+++ /dev/null
@@ -1,65 +0,0 @@
-# Copyright (C) 2014 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.
-
-ifeq (,$(TARGET_BUILD_APPS))
-
-LOCAL_PATH := $(call my-dir)
-
-######################################
-include $(CLEAR_VARS)
-
-LATIN_IME_CORE_PATH := $(LOCAL_PATH)/../jni
-
-LATIN_IME_DICT_TOOLKIT_SRC_DIR := src
-LATIN_IME_CORE_SRC_DIR := ../jni/src
-LATIN_DICT_TOOLKIT_TEST_SRC_DIR := tests
-
-include $(LOCAL_PATH)/NativeFileList.mk
-include $(LATIN_IME_CORE_PATH)/NativeFileList.mk
-
-LATIN_IME_SRC_DIR := src
-LOCAL_ADDRESS_SANITIZER := true
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function
-LOCAL_CXX_STL := libc++
-LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(LATIN_IME_DICT_TOOLKIT_SRC_DIR) \
- $(LATIN_IME_CORE_PATH)/$(LATIN_IME_CORE_SRC_DIR)
-LOCAL_MODULE := liblatinime_dicttoolkit_host_static_for_unittests
-LOCAL_MODULE_TAGS := optional
-LOCAL_SRC_FILES := \
- $(addprefix $(LATIN_IME_DICT_TOOLKIT_SRC_DIR)/, $(LATIN_IME_DICT_TOOLKIT_SRC_FILES)) \
- $(addprefix $(LATIN_IME_CORE_SRC_DIR)/, $(LATIN_IME_CORE_SRC_FILES))
-include $(BUILD_HOST_STATIC_LIBRARY)
-
-include $(CLEAR_VARS)
-
-LOCAL_ADDRESS_SANITIZER := true
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function
-LOCAL_CXX_STL := libc++
-LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(LATIN_IME_DICT_TOOLKIT_SRC_DIR) \
- $(LATIN_IME_CORE_PATH)/$(LATIN_IME_CORE_SRC_DIR)
-LOCAL_MODULE := dicttoolkit_unittests
-LOCAL_MODULE_TAGS := tests
-LOCAL_SRC_FILES := \
- $(addprefix $(LATIN_DICT_TOOLKIT_TEST_SRC_DIR)/, $(LATIN_IME_DICT_TOOLKIT_TEST_FILES))
-LOCAL_STATIC_LIBRARIES += liblatinime_dicttoolkit_host_static_for_unittests
-include $(BUILD_HOST_NATIVE_TEST)
-
-include $(LOCAL_PATH)/CleanupNativeFileList.mk
-
-#################### Clean up the tmp vars
-LATINIME_HOST_OSNAME :=
-LATIN_IME_SRC_DIR :=
-LATIN_IME_TEST_SRC_DIR :=
-
-endif # TARGET_BUILD_APPS
diff --git a/native/dicttoolkit/src/offdevice_intermediate_dict/offdevice_intermediate_dict.h b/native/dicttoolkit/src/offdevice_intermediate_dict/offdevice_intermediate_dict.h
index 13d26ba91..ea17a31d3 100644
--- a/native/dicttoolkit/src/offdevice_intermediate_dict/offdevice_intermediate_dict.h
+++ b/native/dicttoolkit/src/offdevice_intermediate_dict/offdevice_intermediate_dict.h
@@ -20,7 +20,7 @@
#include "dict_toolkit_defines.h"
#include "offdevice_intermediate_dict/offdevice_intermediate_dict_header.h"
#include "offdevice_intermediate_dict/offdevice_intermediate_dict_pt_node_array.h"
-#include "suggest/core/dictionary/property/word_property.h"
+#include "dictionary/property/word_property.h"
#include "utils/int_array_view.h"
namespace latinime {
diff --git a/native/dicttoolkit/src/offdevice_intermediate_dict/offdevice_intermediate_dict_pt_node.h b/native/dicttoolkit/src/offdevice_intermediate_dict/offdevice_intermediate_dict_pt_node.h
index 721ccd778..e7d7e13eb 100644
--- a/native/dicttoolkit/src/offdevice_intermediate_dict/offdevice_intermediate_dict_pt_node.h
+++ b/native/dicttoolkit/src/offdevice_intermediate_dict/offdevice_intermediate_dict_pt_node.h
@@ -21,7 +21,7 @@
#include "dict_toolkit_defines.h"
#include "offdevice_intermediate_dict/offdevice_intermediate_dict_pt_node_array.h"
-#include "suggest/core/dictionary/property/word_property.h"
+#include "dictionary/property/word_property.h"
#include "utils/int_array_view.h"
namespace latinime {
diff --git a/native/dicttoolkit/tests/offdevice_intermediate_dict/offdevice_intermediate_dict_test.cpp b/native/dicttoolkit/tests/offdevice_intermediate_dict/offdevice_intermediate_dict_test.cpp
index f2e24ab5f..89598de60 100644
--- a/native/dicttoolkit/tests/offdevice_intermediate_dict/offdevice_intermediate_dict_test.cpp
+++ b/native/dicttoolkit/tests/offdevice_intermediate_dict/offdevice_intermediate_dict_test.cpp
@@ -20,7 +20,7 @@
#include <vector>
-#include "suggest/core/dictionary/property/word_property.h"
+#include "dictionary/property/word_property.h"
#include "utils/int_array_view.h"
namespace latinime {