1# 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 16# Only build if it's explicitly requested, or running mm/mmm. 17ifneq ($(ONE_SHOT_MAKEFILE)$(filter $(MAKECMDGOALS),dicttool_aosp),) 18 19LATINIME_DICTTOOL_AOSP_LOCAL_PATH := $(call my-dir) 20LOCAL_PATH := $(LATINIME_DICTTOOL_AOSP_LOCAL_PATH) 21LATINIME_HOST_NATIVE_LIBNAME := liblatinime-aosp-dicttool-host 22include $(LOCAL_PATH)/NativeLib.mk 23 24###################################### 25LOCAL_PATH := $(LATINIME_DICTTOOL_AOSP_LOCAL_PATH) 26include $(CLEAR_VARS) 27 28LATINIME_LOCAL_DIR := ../.. 29LATINIME_BASE_SRC_DIR := $(LATINIME_LOCAL_DIR)/java/src/com/android/inputmethod 30LATINIME_BASE_OVERRIDABLE_SRC_DIR := \ 31 $(LATINIME_LOCAL_DIR)/java-overridable/src/com/android/inputmethod 32MAKEDICT_CORE_SRC_DIR := $(LATINIME_BASE_SRC_DIR)/latin/makedict 33LATINIME_TESTS_SRC_DIR := $(LATINIME_LOCAL_DIR)/tests/src/com/android/inputmethod/latin 34 35# Dependencies for Dicttool. Most of these files are needed by BinaryDictionary.java. Note that 36# a significant part of the dependencies are mocked in the compat/ directory, with empty or 37# nearly-empty implementations, for parts that we don't use in Dicttool. 38LATINIME_SRC_FILES_FOR_DICTTOOL := \ 39 latin/BinaryDictionary.java \ 40 latin/DicTraverseSession.java \ 41 latin/Dictionary.java \ 42 latin/NgramContext.java \ 43 latin/SuggestedWords.java \ 44 latin/settings/SettingsValuesForSuggestion.java \ 45 latin/utils/BinaryDictionaryUtils.java \ 46 latin/utils/CombinedFormatUtils.java \ 47 latin/utils/JniUtils.java 48 49LATINIME_OVERRIDABLE_SRC_FILES_FOR_DICTTOOL := \ 50 latin/define/DebugFlags.java 51 52LATINIME_TEST_SRC_FILES_FOR_DICTTOOL := \ 53 utils/ByteArrayDictBuffer.java 54 55USED_TARGETED_SRC_FILES := \ 56 $(addprefix $(LATINIME_BASE_SRC_DIR)/, $(LATINIME_SRC_FILES_FOR_DICTTOOL)) \ 57 $(addprefix $(LATINIME_BASE_OVERRIDABLE_SRC_DIR)/, \ 58 $(LATINIME_OVERRIDABLE_SRC_FILES_FOR_DICTTOOL)) \ 59 $(addprefix $(LATINIME_TESTS_SRC_DIR)/, $(LATINIME_TEST_SRC_FILES_FOR_DICTTOOL)) 60 61DICTTOOL_ONDEVICE_TESTS_DIR := \ 62 $(LATINIME_LOCAL_DIR)/tests/src/com/android/inputmethod/latin/makedict/ 63DICTTOOL_COMPAT_TESTS_DIR := compat 64 65LOCAL_MAIN_SRC_FILES := $(call all-java-files-under, $(MAKEDICT_CORE_SRC_DIR)) 66LOCAL_TOOL_SRC_FILES := $(call all-java-files-under, src) 67 68LOCAL_SRC_FILES := $(LOCAL_TOOL_SRC_FILES) \ 69 $(filter-out $(addprefix %/, $(notdir $(LOCAL_TOOL_SRC_FILES))), $(LOCAL_MAIN_SRC_FILES)) \ 70 $(USED_TARGETED_SRC_FILES) \ 71 $(call all-java-files-under, \ 72 tests $(DICTTOOL_COMPAT_TESTS_DIR) $(DICTTOOL_ONDEVICE_TESTS_DIR)) 73 74LOCAL_JAVA_LIBRARIES := junit-host 75LOCAL_STATIC_JAVA_LIBRARIES := jsr305lib latinime-common-host 76LOCAL_REQUIRED_MODULES := $(LATINIME_HOST_NATIVE_LIBNAME) 77LOCAL_JAR_MANIFEST := etc/manifest.txt 78LOCAL_MODULE := dicttool_aosp 79 80include $(BUILD_HOST_JAVA_LIBRARY) 81include $(LOCAL_PATH)/etc/Android.mk 82 83# Clear our private variables 84LATINIME_DICTTOOL_AOSP_LOCAL_PATH := 85LATINIME_LOCAL_DIR := 86 87endif 88