From 0b3e48fb501111b4d7b31746b7bf7b4bc75f024f Mon Sep 17 00:00:00 2001 From: Ken Wakasa Date: Sat, 16 Aug 2014 02:34:53 +0900 Subject: [PATCH] DO NOT MERGE: Abolish source code overlay and introduce overridable src dir This should make IDEs happy with appropriate source code directory selection. Change-Id: Ic734bd4d20aa050c688a3158b1a382ae0ac18991 (cherry picked from commit fb74ab15c1343084740d65ef8744cad33a678e82) --- .../compat/AppWorkaroundsHelper.java | 0 .../DictionaryPackConstants.java | 0 .../dictionarypack/MetadataUriGetter.java | 0 .../inputmethod/latin/SpecialKeyDetector.java | 0 .../latin/about/AboutPreferences.java | 0 .../inputmethod/latin/define/DebugFlags.java | 0 .../inputmethod/latin/define/JniLibName.java | 0 .../latin/define/ProductionFlags.java | 0 .../ContextualDictionaryUpdater.java | 0 .../PersonalizationDictionaryUpdater.java | 0 .../AdditionalFeaturesSettingUtils.java | 0 .../latin/utils/FeedbackUtils.java | 0 .../latin/utils/FileTransforms.java | 0 .../latin/utils/MetadataFileUriGetter.java | 0 .../inputmethod/latin/utils/StatsUtils.java | 0 java/Android.mk | 2 +- tools/dicttool/Android.mk | 39 +++++++++++-------- 17 files changed, 23 insertions(+), 18 deletions(-) rename {java => java-overridable}/src/com/android/inputmethod/compat/AppWorkaroundsHelper.java (100%) rename {java => java-overridable}/src/com/android/inputmethod/dictionarypack/DictionaryPackConstants.java (100%) rename {java => java-overridable}/src/com/android/inputmethod/dictionarypack/MetadataUriGetter.java (100%) rename {java => java-overridable}/src/com/android/inputmethod/latin/SpecialKeyDetector.java (100%) rename {java => java-overridable}/src/com/android/inputmethod/latin/about/AboutPreferences.java (100%) rename {java => java-overridable}/src/com/android/inputmethod/latin/define/DebugFlags.java (100%) rename {java => java-overridable}/src/com/android/inputmethod/latin/define/JniLibName.java (100%) rename {java => java-overridable}/src/com/android/inputmethod/latin/define/ProductionFlags.java (100%) rename {java => java-overridable}/src/com/android/inputmethod/latin/personalization/ContextualDictionaryUpdater.java (100%) rename {java => java-overridable}/src/com/android/inputmethod/latin/personalization/PersonalizationDictionaryUpdater.java (100%) rename {java => java-overridable}/src/com/android/inputmethod/latin/settings/AdditionalFeaturesSettingUtils.java (100%) rename {java => java-overridable}/src/com/android/inputmethod/latin/utils/FeedbackUtils.java (100%) rename {java => java-overridable}/src/com/android/inputmethod/latin/utils/FileTransforms.java (100%) rename {java => java-overridable}/src/com/android/inputmethod/latin/utils/MetadataFileUriGetter.java (100%) rename {java => java-overridable}/src/com/android/inputmethod/latin/utils/StatsUtils.java (100%) diff --git a/java/src/com/android/inputmethod/compat/AppWorkaroundsHelper.java b/java-overridable/src/com/android/inputmethod/compat/AppWorkaroundsHelper.java similarity index 100% rename from java/src/com/android/inputmethod/compat/AppWorkaroundsHelper.java rename to java-overridable/src/com/android/inputmethod/compat/AppWorkaroundsHelper.java diff --git a/java/src/com/android/inputmethod/dictionarypack/DictionaryPackConstants.java b/java-overridable/src/com/android/inputmethod/dictionarypack/DictionaryPackConstants.java similarity index 100% rename from java/src/com/android/inputmethod/dictionarypack/DictionaryPackConstants.java rename to java-overridable/src/com/android/inputmethod/dictionarypack/DictionaryPackConstants.java diff --git a/java/src/com/android/inputmethod/dictionarypack/MetadataUriGetter.java b/java-overridable/src/com/android/inputmethod/dictionarypack/MetadataUriGetter.java similarity index 100% rename from java/src/com/android/inputmethod/dictionarypack/MetadataUriGetter.java rename to java-overridable/src/com/android/inputmethod/dictionarypack/MetadataUriGetter.java diff --git a/java/src/com/android/inputmethod/latin/SpecialKeyDetector.java b/java-overridable/src/com/android/inputmethod/latin/SpecialKeyDetector.java similarity index 100% rename from java/src/com/android/inputmethod/latin/SpecialKeyDetector.java rename to java-overridable/src/com/android/inputmethod/latin/SpecialKeyDetector.java diff --git a/java/src/com/android/inputmethod/latin/about/AboutPreferences.java b/java-overridable/src/com/android/inputmethod/latin/about/AboutPreferences.java similarity index 100% rename from java/src/com/android/inputmethod/latin/about/AboutPreferences.java rename to java-overridable/src/com/android/inputmethod/latin/about/AboutPreferences.java diff --git a/java/src/com/android/inputmethod/latin/define/DebugFlags.java b/java-overridable/src/com/android/inputmethod/latin/define/DebugFlags.java similarity index 100% rename from java/src/com/android/inputmethod/latin/define/DebugFlags.java rename to java-overridable/src/com/android/inputmethod/latin/define/DebugFlags.java diff --git a/java/src/com/android/inputmethod/latin/define/JniLibName.java b/java-overridable/src/com/android/inputmethod/latin/define/JniLibName.java similarity index 100% rename from java/src/com/android/inputmethod/latin/define/JniLibName.java rename to java-overridable/src/com/android/inputmethod/latin/define/JniLibName.java diff --git a/java/src/com/android/inputmethod/latin/define/ProductionFlags.java b/java-overridable/src/com/android/inputmethod/latin/define/ProductionFlags.java similarity index 100% rename from java/src/com/android/inputmethod/latin/define/ProductionFlags.java rename to java-overridable/src/com/android/inputmethod/latin/define/ProductionFlags.java diff --git a/java/src/com/android/inputmethod/latin/personalization/ContextualDictionaryUpdater.java b/java-overridable/src/com/android/inputmethod/latin/personalization/ContextualDictionaryUpdater.java similarity index 100% rename from java/src/com/android/inputmethod/latin/personalization/ContextualDictionaryUpdater.java rename to java-overridable/src/com/android/inputmethod/latin/personalization/ContextualDictionaryUpdater.java diff --git a/java/src/com/android/inputmethod/latin/personalization/PersonalizationDictionaryUpdater.java b/java-overridable/src/com/android/inputmethod/latin/personalization/PersonalizationDictionaryUpdater.java similarity index 100% rename from java/src/com/android/inputmethod/latin/personalization/PersonalizationDictionaryUpdater.java rename to java-overridable/src/com/android/inputmethod/latin/personalization/PersonalizationDictionaryUpdater.java diff --git a/java/src/com/android/inputmethod/latin/settings/AdditionalFeaturesSettingUtils.java b/java-overridable/src/com/android/inputmethod/latin/settings/AdditionalFeaturesSettingUtils.java similarity index 100% rename from java/src/com/android/inputmethod/latin/settings/AdditionalFeaturesSettingUtils.java rename to java-overridable/src/com/android/inputmethod/latin/settings/AdditionalFeaturesSettingUtils.java diff --git a/java/src/com/android/inputmethod/latin/utils/FeedbackUtils.java b/java-overridable/src/com/android/inputmethod/latin/utils/FeedbackUtils.java similarity index 100% rename from java/src/com/android/inputmethod/latin/utils/FeedbackUtils.java rename to java-overridable/src/com/android/inputmethod/latin/utils/FeedbackUtils.java diff --git a/java/src/com/android/inputmethod/latin/utils/FileTransforms.java b/java-overridable/src/com/android/inputmethod/latin/utils/FileTransforms.java similarity index 100% rename from java/src/com/android/inputmethod/latin/utils/FileTransforms.java rename to java-overridable/src/com/android/inputmethod/latin/utils/FileTransforms.java diff --git a/java/src/com/android/inputmethod/latin/utils/MetadataFileUriGetter.java b/java-overridable/src/com/android/inputmethod/latin/utils/MetadataFileUriGetter.java similarity index 100% rename from java/src/com/android/inputmethod/latin/utils/MetadataFileUriGetter.java rename to java-overridable/src/com/android/inputmethod/latin/utils/MetadataFileUriGetter.java diff --git a/java/src/com/android/inputmethod/latin/utils/StatsUtils.java b/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtils.java similarity index 100% rename from java/src/com/android/inputmethod/latin/utils/StatsUtils.java rename to java-overridable/src/com/android/inputmethod/latin/utils/StatsUtils.java diff --git a/java/Android.mk b/java/Android.mk index 9b8b2b448..0d12c45fe 100644 --- a/java/Android.mk +++ b/java/Android.mk @@ -17,7 +17,7 @@ include $(CLEAR_VARS) LOCAL_MODULE_TAGS := optional -LOCAL_SRC_FILES := $(call all-java-files-under, src) +LOCAL_SRC_FILES := $(call all-java-files-under, src ../java-overridable/src) LOCAL_PACKAGE_NAME := LatinIME diff --git a/tools/dicttool/Android.mk b/tools/dicttool/Android.mk index 0f1f34418..3e3d419e6 100644 --- a/tools/dicttool/Android.mk +++ b/tools/dicttool/Android.mk @@ -32,10 +32,12 @@ LOCAL_PATH := $(LATINIME_DICTTOOL_AOSP_LOCAL_PATH) include $(CLEAR_VARS) LATINIME_LOCAL_DIR := ../.. -LATINIME_BASE_SOURCE_DIRECTORY := $(LATINIME_LOCAL_DIR)/java/src/com/android/inputmethod -LATINIME_ANNOTATIONS_SOURCE_DIRECTORY := $(LATINIME_BASE_SOURCE_DIRECTORY)/annotations -MAKEDICT_CORE_SOURCE_DIRECTORY := $(LATINIME_BASE_SOURCE_DIRECTORY)/latin/makedict -LATINIME_TESTS_SOURCE_DIRECTORY := $(LATINIME_LOCAL_DIR)/tests/src/com/android/inputmethod/latin +LATINIME_BASE_SRC_DIR := $(LATINIME_LOCAL_DIR)/java/src/com/android/inputmethod +LATINIME_BASE_OVERRIDABLE_SRC_DIR := \ + $(LATINIME_LOCAL_DIR)/java-overridable/src/com/android/inputmethod +LATINIME_ANNOTATIONS_SRC_DIR := $(LATINIME_BASE_SRC_DIR)/annotations +MAKEDICT_CORE_SRC_DIR := $(LATINIME_BASE_SRC_DIR)/latin/makedict +LATINIME_TESTS_SRC_DIR := $(LATINIME_LOCAL_DIR)/tests/src/com/android/inputmethod/latin # Dependencies for Dicttool. Most of these files are needed by BinaryDictionary.java. Note that # a significant part of the dependencies are mocked in the compat/ directory, with empty or @@ -51,7 +53,6 @@ LATINIME_SRC_FILES_FOR_DICTTOOL := \ latin/PrevWordsInfo.java \ latin/SuggestedWords.java \ latin/WordComposer.java \ - latin/define/DebugFlags.java \ latin/settings/NativeSuggestOptions.java \ latin/settings/SettingsValuesForSuggestion.java \ latin/utils/BinaryDictionaryUtils.java \ @@ -63,29 +64,33 @@ LATINIME_SRC_FILES_FOR_DICTTOOL := \ latin/utils/ResizableIntArray.java \ latin/utils/StringUtils.java +LATINIME_OVERRIDABLE_SRC_FILES_FOR_DICTTOOL := \ + latin/define/DebugFlags.java + LATINIME_TEST_SRC_FILES_FOR_DICTTOOL := \ utils/ByteArrayDictBuffer.java -USED_TARGETED_SRCS := \ - $(addprefix $(LATINIME_BASE_SOURCE_DIRECTORY)/, $(LATINIME_SRC_FILES_FOR_DICTTOOL)) \ - $(addprefix $(LATINIME_TESTS_SOURCE_DIRECTORY)/, $(LATINIME_TEST_SRC_FILES_FOR_DICTTOOL)) +USED_TARGETED_SRC_FILES := \ + $(addprefix $(LATINIME_BASE_SRC_DIR)/, $(LATINIME_SRC_FILES_FOR_DICTTOOL)) \ + $(addprefix $(LATINIME_BASE_OVERRIDABLE_SRC_DIR)/, \ + $(LATINIME_OVERRIDABLE_SRC_FILES_FOR_DICTTOOL)) \ + $(addprefix $(LATINIME_TESTS_SRC_DIR)/, $(LATINIME_TEST_SRC_FILES_FOR_DICTTOOL)) -DICTTOOL_ONDEVICE_TESTS_DIRECTORY := \ +DICTTOOL_ONDEVICE_TESTS_DIR := \ $(LATINIME_LOCAL_DIR)/tests/src/com/android/inputmethod/latin/makedict/ -DICTTOOL_COMPAT_TESTS_DIRECTORY := compat +DICTTOOL_COMPAT_TESTS_DIR := compat -LOCAL_MAIN_SRC_FILES := $(call all-java-files-under, $(MAKEDICT_CORE_SOURCE_DIRECTORY)) +LOCAL_MAIN_SRC_FILES := $(call all-java-files-under, $(MAKEDICT_CORE_SRC_DIR)) LOCAL_TOOL_SRC_FILES := $(call all-java-files-under, src) -LOCAL_ANNOTATIONS_SRC_FILES := \ - $(call all-java-files-under, $(LATINIME_ANNOTATIONS_SOURCE_DIRECTORY)) +LOCAL_ANNOTATIONS_SRC_FILES := $(call all-java-files-under, $(LATINIME_ANNOTATIONS_SRC_DIR)) LOCAL_SRC_FILES := $(LOCAL_TOOL_SRC_FILES) \ $(filter-out $(addprefix %/, $(notdir $(LOCAL_TOOL_SRC_FILES))), $(LOCAL_MAIN_SRC_FILES)) \ - $(call all-java-files-under, $(DICTTOOL_COMPAT_TESTS_DIRECTORY)) \ - $(LOCAL_ANNOTATIONS_SRC_FILES) $(USED_TARGETED_SRCS) \ - $(LATINIME_BASE_SOURCE_DIRECTORY)/latin/Constants.java \ + $(call all-java-files-under, $(DICTTOOL_COMPAT_TESTS_DIR)) \ + $(LOCAL_ANNOTATIONS_SRC_FILES) $(USED_TARGETED_SRC_FILES) \ + $(LATINIME_BASE_SRC_DIR)/latin/Constants.java \ $(call all-java-files-under, tests) \ - $(call all-java-files-under, $(DICTTOOL_ONDEVICE_TESTS_DIRECTORY)) + $(call all-java-files-under, $(DICTTOOL_ONDEVICE_TESTS_DIR)) LOCAL_JAVA_LIBRARIES := junit LOCAL_STATIC_JAVA_LIBRARIES := jsr305lib