blob: 09af9a02027e9d18f72bef8eba09656f6b4a8fd0 [file] [log] [blame]
Jean Chalardddcb4842012-05-28 17:30:18 +09001#
2# Copyright (C) 2012 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
Ying Wangece72402014-07-29 10:46:38 -070016# Only build if it's explicitly requested, or running mm/mmm.
17ifneq ($(ONE_SHOT_MAKEFILE)$(filter $(MAKECMDGOALS),dicttool_aosp),)
18
Ken Wakasa344742b2014-03-07 12:37:40 +090019# HACK: Temporarily disable host tool build on Mac until the build system is ready for C++11.
20LATINIME_HOST_OSNAME := $(shell uname -s)
Tadashi G. Takaoka99258cb2014-05-24 03:07:58 +090021ifeq ($(LATINIME_HOST_OSNAME), Darwin) # TODO: Remove this
22$(warning dicttool_aosp is not supported on $(LATINIME_HOST_OSNAME))
23else # TODO: Remove this
Ken Wakasa344742b2014-03-07 12:37:40 +090024
Jean Chalarde7870a22013-08-12 12:44:04 +090025LATINIME_DICTTOOL_AOSP_LOCAL_PATH := $(call my-dir)
26LOCAL_PATH := $(LATINIME_DICTTOOL_AOSP_LOCAL_PATH)
27LATINIME_HOST_NATIVE_LIBNAME := liblatinime-aosp-dicttool-host
28include $(LOCAL_PATH)/NativeLib.mk
29
30######################################
31LOCAL_PATH := $(LATINIME_DICTTOOL_AOSP_LOCAL_PATH)
Jean Chalardddcb4842012-05-28 17:30:18 +090032include $(CLEAR_VARS)
33
Jean Chalarde7870a22013-08-12 12:44:04 +090034LATINIME_LOCAL_DIR := ../..
Ken Wakasafb74ab12014-08-16 02:34:53 +090035LATINIME_BASE_SRC_DIR := $(LATINIME_LOCAL_DIR)/java/src/com/android/inputmethod
36LATINIME_BASE_OVERRIDABLE_SRC_DIR := \
37 $(LATINIME_LOCAL_DIR)/java-overridable/src/com/android/inputmethod
Ken Wakasafb74ab12014-08-16 02:34:53 +090038MAKEDICT_CORE_SRC_DIR := $(LATINIME_BASE_SRC_DIR)/latin/makedict
39LATINIME_TESTS_SRC_DIR := $(LATINIME_LOCAL_DIR)/tests/src/com/android/inputmethod/latin
Jean Chalarda245d152013-12-12 15:08:10 +090040
41# Dependencies for Dicttool. Most of these files are needed by BinaryDictionary.java. Note that
42# a significant part of the dependencies are mocked in the compat/ directory, with empty or
43# nearly-empty implementations, for parts that we don't use in Dicttool.
Ken Wakasa96092eb2014-03-27 19:11:12 +090044LATINIME_SRC_FILES_FOR_DICTTOOL := \
Jean Chalard7ede6422014-03-14 22:50:20 +090045 event/Combiner.java \
Jean Chalardf8accd82014-03-13 17:37:16 +090046 event/Event.java \
47 latin/BinaryDictionary.java \
48 latin/DicTraverseSession.java \
49 latin/Dictionary.java \
50 latin/InputPointers.java \
51 latin/LastComposedWord.java \
Keisuke Kuroyanagibb0eca52014-09-29 10:52:18 +090052 latin/NgramContext.java \
Jean Chalardf8accd82014-03-13 17:37:16 +090053 latin/SuggestedWords.java \
54 latin/WordComposer.java \
55 latin/settings/NativeSuggestOptions.java \
Keisuke Kuroyanagib8a94792014-07-08 16:36:06 +090056 latin/settings/SettingsValuesForSuggestion.java \
Jean Chalardf8accd82014-03-13 17:37:16 +090057 latin/utils/BinaryDictionaryUtils.java \
Jean Chalardf8accd82014-03-13 17:37:16 +090058 latin/utils/CombinedFormatUtils.java \
59 latin/utils/CoordinateUtils.java \
60 latin/utils/FileUtils.java \
61 latin/utils/JniUtils.java \
62 latin/utils/LocaleUtils.java \
63 latin/utils/ResizableIntArray.java \
64 latin/utils/StringUtils.java
Keisuke Kuroyanagi93cda5b2014-03-27 15:30:32 +090065
Ken Wakasafb74ab12014-08-16 02:34:53 +090066LATINIME_OVERRIDABLE_SRC_FILES_FOR_DICTTOOL := \
67 latin/define/DebugFlags.java
68
Ken Wakasa96092eb2014-03-27 19:11:12 +090069LATINIME_TEST_SRC_FILES_FOR_DICTTOOL := \
Keisuke Kuroyanagi93cda5b2014-03-27 15:30:32 +090070 utils/ByteArrayDictBuffer.java
71
Ken Wakasafb74ab12014-08-16 02:34:53 +090072USED_TARGETED_SRC_FILES := \
73 $(addprefix $(LATINIME_BASE_SRC_DIR)/, $(LATINIME_SRC_FILES_FOR_DICTTOOL)) \
74 $(addprefix $(LATINIME_BASE_OVERRIDABLE_SRC_DIR)/, \
75 $(LATINIME_OVERRIDABLE_SRC_FILES_FOR_DICTTOOL)) \
76 $(addprefix $(LATINIME_TESTS_SRC_DIR)/, $(LATINIME_TEST_SRC_FILES_FOR_DICTTOOL))
Jean Chalarde7870a22013-08-12 12:44:04 +090077
Ken Wakasafb74ab12014-08-16 02:34:53 +090078DICTTOOL_ONDEVICE_TESTS_DIR := \
Jean Chalarde7870a22013-08-12 12:44:04 +090079 $(LATINIME_LOCAL_DIR)/tests/src/com/android/inputmethod/latin/makedict/
Ken Wakasafb74ab12014-08-16 02:34:53 +090080DICTTOOL_COMPAT_TESTS_DIR := compat
Jean Chalard54e84a02012-08-03 17:05:41 +090081
Ken Wakasafb74ab12014-08-16 02:34:53 +090082LOCAL_MAIN_SRC_FILES := $(call all-java-files-under, $(MAKEDICT_CORE_SRC_DIR))
Ken Wakasa02996dc2012-11-29 19:09:01 +090083LOCAL_TOOL_SRC_FILES := $(call all-java-files-under, src)
Jean Chalarde7870a22013-08-12 12:44:04 +090084
Jean Chalard54e84a02012-08-03 17:05:41 +090085LOCAL_SRC_FILES := $(LOCAL_TOOL_SRC_FILES) \
86 $(filter-out $(addprefix %/, $(notdir $(LOCAL_TOOL_SRC_FILES))), $(LOCAL_MAIN_SRC_FILES)) \
Ken Wakasab11fc7d2014-10-22 21:29:46 +090087 $(USED_TARGETED_SRC_FILES) \
88 $(call all-java-files-under, \
89 tests $(DICTTOOL_COMPAT_TESTS_DIR) $(DICTTOOL_ONDEVICE_TESTS_DIR))
Ken Wakasa60af4f02012-09-10 12:56:10 +090090
Jean Chalardd055cca2012-08-27 14:51:57 +090091LOCAL_JAVA_LIBRARIES := junit
Ken Wakasa54a1b8e2014-10-22 18:24:44 +090092LOCAL_STATIC_JAVA_LIBRARIES := jsr305lib latinime-common-host
Ying Wangfb57fe22014-06-09 12:16:30 -070093LOCAL_REQUIRED_MODULES := $(LATINIME_HOST_NATIVE_LIBNAME)
Jean Chalardddcb4842012-05-28 17:30:18 +090094LOCAL_JAR_MANIFEST := etc/manifest.txt
Jean Chalard4c573f32012-08-08 17:15:58 +090095LOCAL_MODULE := dicttool_aosp
Jean Chalardddcb4842012-05-28 17:30:18 +090096
97include $(BUILD_HOST_JAVA_LIBRARY)
98include $(LOCAL_PATH)/etc/Android.mk
Jean Chalarde7870a22013-08-12 12:44:04 +090099
Ken Wakasa344742b2014-03-07 12:37:40 +0900100endif # Darwin - TODO: Remove this
101
Jean Chalarde7870a22013-08-12 12:44:04 +0900102# Clear our private variables
103LATINIME_DICTTOOL_AOSP_LOCAL_PATH :=
104LATINIME_LOCAL_DIR :=
Ken Wakasa344742b2014-03-07 12:37:40 +0900105LATINIME_HOST_OSNAME :=
Ying Wangece72402014-07-29 10:46:38 -0700106
107endif