Merge "Rename dicttool to dicttool_aosp and split commands" into jb-mr1-dev

main
Jean Chalard 2012-08-08 02:15:20 -07:00 committed by Android (Google) Code Review
commit 8d7e3a51f0
7 changed files with 57 additions and 8 deletions

View File

@ -24,7 +24,7 @@ LOCAL_SRC_FILES := $(LOCAL_TOOL_SRC_FILES) \
$(filter-out $(addprefix %/, $(notdir $(LOCAL_TOOL_SRC_FILES))), $(LOCAL_MAIN_SRC_FILES)) \ $(filter-out $(addprefix %/, $(notdir $(LOCAL_TOOL_SRC_FILES))), $(LOCAL_MAIN_SRC_FILES)) \
$(call all-java-files-under,tests) $(call all-java-files-under,tests)
LOCAL_JAR_MANIFEST := etc/manifest.txt LOCAL_JAR_MANIFEST := etc/manifest.txt
LOCAL_MODULE := dicttool LOCAL_MODULE := dicttool_aosp
LOCAL_JAVA_LIBRARIES := junit LOCAL_JAVA_LIBRARIES := junit
LOCAL_MODULE_TAGS := eng LOCAL_MODULE_TAGS := eng

View File

@ -16,5 +16,5 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := eng LOCAL_MODULE_TAGS := eng
LOCAL_PREBUILT_EXECUTABLES := dicttool makedict LOCAL_PREBUILT_EXECUTABLES := dicttool_aosp makedict_aosp
include $(BUILD_HOST_PREBUILT) include $(BUILD_HOST_PREBUILT)

View File

@ -33,7 +33,7 @@ progdir=`pwd`
prog="${progdir}"/`basename "${prog}"` prog="${progdir}"/`basename "${prog}"`
cd "${oldwd}" cd "${oldwd}"
jarfile=dicttool.jar jarfile=dicttool_aosp.jar
frameworkdir="$progdir" frameworkdir="$progdir"
if [ ! -r "$frameworkdir/$jarfile" ] if [ ! -r "$frameworkdir/$jarfile" ]
then then

View File

@ -15,4 +15,4 @@
# Dicttool supports making the dictionary using the 'makedict' command and # Dicttool supports making the dictionary using the 'makedict' command and
# the same arguments that the old 'makedict' command used to accept. # the same arguments that the old 'makedict' command used to accept.
dicttool makedict $@ dicttool_aosp makedict $@

View File

@ -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() {
}
}

View File

@ -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);
}
}

View File

@ -32,10 +32,11 @@ public class Dicttool {
static HashMap<String, Class<? extends Command>> sCommands = static HashMap<String, Class<? extends Command>> sCommands =
new HashMap<String, Class<? extends Command>>(); new HashMap<String, Class<? extends Command>>();
static { static {
sCommands.put("info", Info.class); CommandList.populate();
sCommands.put("compress", Compress.Compressor.class); AdditionalCommandList.populate();
sCommands.put("uncompress", Compress.Uncompressor.class); }
sCommands.put("makedict", Makedict.class); public static void addCommand(final String commandName, final Class<? extends Command> cls) {
sCommands.put(commandName, cls);
} }
private static Command getCommandInstance(final String commandName) { private static Command getCommandInstance(final String commandName) {