aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-08-08 17:15:58 +0900
committerJean Chalard <jchalard@google.com>2012-08-08 17:15:58 +0900
commit4c573f3c649201b3e0a8198b6aefc0f69c158611 (patch)
tree516d0cc0d4e2d18050ae9203a3a702fc0d7421d0
parent4ed69eed006c3e8a0b1ad8f3b0e23cd1cfb49679 (diff)
downloadlatinime-4c573f3c649201b3e0a8198b6aefc0f69c158611.tar.gz
latinime-4c573f3c649201b3e0a8198b6aefc0f69c158611.tar.xz
latinime-4c573f3c649201b3e0a8198b6aefc0f69c158611.zip
Rename dicttool to dicttool_aosp and split commands
Change-Id: I83d948be2db5cd0203e876f019697e1d5e038818
-rw-r--r--tools/dicttool/Android.mk2
-rw-r--r--tools/dicttool/etc/Android.mk2
-rwxr-xr-xtools/dicttool/etc/dicttool_aosp (renamed from tools/dicttool/etc/dicttool)2
-rwxr-xr-xtools/dicttool/etc/makedict_aosp (renamed from tools/dicttool/etc/makedict)2
-rw-r--r--tools/dicttool/src/android/inputmethod/latin/dicttool/AdditionalCommandList.java22
-rw-r--r--tools/dicttool/src/android/inputmethod/latin/dicttool/CommandList.java26
-rw-r--r--tools/dicttool/src/android/inputmethod/latin/dicttool/Dicttool.java9
7 files changed, 57 insertions, 8 deletions
diff --git a/tools/dicttool/Android.mk b/tools/dicttool/Android.mk
index e9c11acc4..df8cb1030 100644
--- a/tools/dicttool/Android.mk
+++ b/tools/dicttool/Android.mk
@@ -24,7 +24,7 @@ LOCAL_SRC_FILES := $(LOCAL_TOOL_SRC_FILES) \
$(filter-out $(addprefix %/, $(notdir $(LOCAL_TOOL_SRC_FILES))), $(LOCAL_MAIN_SRC_FILES)) \
$(call all-java-files-under,tests)
LOCAL_JAR_MANIFEST := etc/manifest.txt
-LOCAL_MODULE := dicttool
+LOCAL_MODULE := dicttool_aosp
LOCAL_JAVA_LIBRARIES := junit
LOCAL_MODULE_TAGS := eng
diff --git a/tools/dicttool/etc/Android.mk b/tools/dicttool/etc/Android.mk
index 1eab70fc1..8952827ab 100644
--- a/tools/dicttool/etc/Android.mk
+++ b/tools/dicttool/etc/Android.mk
@@ -16,5 +16,5 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := eng
-LOCAL_PREBUILT_EXECUTABLES := dicttool makedict
+LOCAL_PREBUILT_EXECUTABLES := dicttool_aosp makedict_aosp
include $(BUILD_HOST_PREBUILT)
diff --git a/tools/dicttool/etc/dicttool b/tools/dicttool/etc/dicttool_aosp
index 8a39694f7..a4879a279 100755
--- a/tools/dicttool/etc/dicttool
+++ b/tools/dicttool/etc/dicttool_aosp
@@ -33,7 +33,7 @@ progdir=`pwd`
prog="${progdir}"/`basename "${prog}"`
cd "${oldwd}"
-jarfile=dicttool.jar
+jarfile=dicttool_aosp.jar
frameworkdir="$progdir"
if [ ! -r "$frameworkdir/$jarfile" ]
then
diff --git a/tools/dicttool/etc/makedict b/tools/dicttool/etc/makedict_aosp
index fffeb2376..095c50538 100755
--- a/tools/dicttool/etc/makedict
+++ b/tools/dicttool/etc/makedict_aosp
@@ -15,4 +15,4 @@
# Dicttool supports making the dictionary using the 'makedict' command and
# the same arguments that the old 'makedict' command used to accept.
-dicttool makedict $@
+dicttool_aosp makedict $@
diff --git a/tools/dicttool/src/android/inputmethod/latin/dicttool/AdditionalCommandList.java b/tools/dicttool/src/android/inputmethod/latin/dicttool/AdditionalCommandList.java
new file mode 100644
index 000000000..8d4eb751b
--- /dev/null
+++ b/tools/dicttool/src/android/inputmethod/latin/dicttool/AdditionalCommandList.java
@@ -0,0 +1,22 @@
+/**
+ * Copyright (C) 2012 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.
+ */
+
+package com.android.inputmethod.latin.dicttool;
+
+public class AdditionalCommandList {
+ public static void populate() {
+ }
+}
diff --git a/tools/dicttool/src/android/inputmethod/latin/dicttool/CommandList.java b/tools/dicttool/src/android/inputmethod/latin/dicttool/CommandList.java
new file mode 100644
index 000000000..d16b069fe
--- /dev/null
+++ b/tools/dicttool/src/android/inputmethod/latin/dicttool/CommandList.java
@@ -0,0 +1,26 @@
+/**
+ * Copyright (C) 2012 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.
+ */
+
+package com.android.inputmethod.latin.dicttool;
+
+public class CommandList {
+ public static void populate() {
+ Dicttool.addCommand("info", Info.class);
+ Dicttool.addCommand("compress", Compress.Compressor.class);
+ Dicttool.addCommand("uncompress", Compress.Uncompressor.class);
+ Dicttool.addCommand("makedict", Makedict.class);
+ }
+}
diff --git a/tools/dicttool/src/android/inputmethod/latin/dicttool/Dicttool.java b/tools/dicttool/src/android/inputmethod/latin/dicttool/Dicttool.java
index c14ce7b88..bf417fb5a 100644
--- a/tools/dicttool/src/android/inputmethod/latin/dicttool/Dicttool.java
+++ b/tools/dicttool/src/android/inputmethod/latin/dicttool/Dicttool.java
@@ -32,10 +32,11 @@ public class Dicttool {
static HashMap<String, Class<? extends Command>> sCommands =
new HashMap<String, Class<? extends Command>>();
static {
- sCommands.put("info", Info.class);
- sCommands.put("compress", Compress.Compressor.class);
- sCommands.put("uncompress", Compress.Uncompressor.class);
- sCommands.put("makedict", Makedict.class);
+ CommandList.populate();
+ AdditionalCommandList.populate();
+ }
+ public static void addCommand(final String commandName, final Class<? extends Command> cls) {
+ sCommands.put(commandName, cls);
}
private static Command getCommandInstance(final String commandName) {