aboutsummaryrefslogtreecommitdiffstats
path: root/sdkmanager
diff options
context:
space:
mode:
authorRaphael <raphael@google.com>2011-12-20 21:21:39 -0800
committerRaphael <raphael@google.com>2012-01-05 11:54:36 -0800
commit09c6e56052a136ce9f82876d3199a527d9cba678 (patch)
tree738bde9dc0d5aab1390afc1cb5533fdfa5083423 /sdkmanager
parentc000db8d112f4143249fa79a24c6ddb2ffc122f3 (diff)
downloadsdk-09c6e56052a136ce9f82876d3199a527d9cba678.zip
sdk-09c6e56052a136ce9f82876d3199a527d9cba678.tar.gz
sdk-09c6e56052a136ce9f82876d3199a527d9cba678.tar.bz2
Move CommandLineProcessor from sdkmanager to sdklib as CommandLineParser
Change-Id: I4413efea2887436d167ce44db6f0cd711bdf8fdd
Diffstat (limited to 'sdkmanager')
-rw-r--r--sdkmanager/app/src/com/android/sdkmanager/SdkCommandLine.java3
-rw-r--r--sdkmanager/libs/sdklib/src/com/android/sdklib/util/CommandLineParser.java (renamed from sdkmanager/app/src/com/android/sdkmanager/CommandLineProcessor.java)9
-rw-r--r--sdkmanager/libs/sdklib/tests/src/com/android/sdklib/util/CommandLineParserTest.java (renamed from sdkmanager/app/tests/com/android/sdkmanager/CommandLineProcessorTest.java)9
3 files changed, 11 insertions, 10 deletions
diff --git a/sdkmanager/app/src/com/android/sdkmanager/SdkCommandLine.java b/sdkmanager/app/src/com/android/sdkmanager/SdkCommandLine.java
index 0390580..b1325ee 100644
--- a/sdkmanager/app/src/com/android/sdkmanager/SdkCommandLine.java
+++ b/sdkmanager/app/src/com/android/sdkmanager/SdkCommandLine.java
@@ -19,6 +19,7 @@ package com.android.sdkmanager;
import com.android.sdklib.ISdkLog;
import com.android.sdklib.SdkManager;
import com.android.sdklib.repository.SdkRepoConstants;
+import com.android.sdklib.util.CommandLineParser;
import java.util.Arrays;
@@ -26,7 +27,7 @@ import java.util.Arrays;
/**
* Specific command-line flags for the {@link SdkManager}.
*/
-class SdkCommandLine extends CommandLineProcessor {
+class SdkCommandLine extends CommandLineParser {
/*
* Steps needed to add a new action:
diff --git a/sdkmanager/app/src/com/android/sdkmanager/CommandLineProcessor.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/util/CommandLineParser.java
index e60fba3..ae17813 100644
--- a/sdkmanager/app/src/com/android/sdkmanager/CommandLineProcessor.java
+++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/util/CommandLineParser.java
@@ -14,10 +14,9 @@
* limitations under the License.
*/
-package com.android.sdkmanager;
+package com.android.sdklib.util;
import com.android.sdklib.ISdkLog;
-import com.android.sdklib.util.LineUtil;
import java.util.HashMap;
import java.util.Map.Entry;
@@ -35,7 +34,7 @@ import java.util.Map.Entry;
* To use, call {@link #parseArgs(String[])} and then
* call {@link #getValue(String, String, String)}.
*/
-class CommandLineProcessor {
+public class CommandLineParser {
/*
* Steps needed to add a new action:
@@ -105,7 +104,7 @@ class CommandLineProcessor {
*
* @see #mActions
*/
- public CommandLineProcessor(ISdkLog logger, String[][] actions) {
+ public CommandLineParser(ISdkLog logger, String[][] actions) {
mLog = logger;
mActions = actions;
@@ -616,7 +615,7 @@ class CommandLineProcessor {
* The mode of an argument specifies the type of variable it represents,
* whether an extra parameter is required after the flag and how to parse it.
*/
- static enum Mode {
+ public static enum Mode {
/** Argument value is a Boolean. Default value is a Boolean. */
BOOLEAN {
@Override
diff --git a/sdkmanager/app/tests/com/android/sdkmanager/CommandLineProcessorTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/util/CommandLineParserTest.java
index 2f70278..6f0af81 100644
--- a/sdkmanager/app/tests/com/android/sdkmanager/CommandLineProcessorTest.java
+++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/util/CommandLineParserTest.java
@@ -14,23 +14,24 @@
* limitations under the License.
*/
-package com.android.sdkmanager;
+package com.android.sdklib.util;
import com.android.sdklib.ISdkLog;
import com.android.sdklib.StdSdkLog;
+import com.android.sdklib.util.CommandLineParser;
import junit.framework.TestCase;
-public class CommandLineProcessorTest extends TestCase {
+public class CommandLineParserTest extends TestCase {
private StdSdkLog mLog;
/**
- * A mock version of the {@link CommandLineProcessor} class that does not
+ * A mock version of the {@link CommandLineParser} class that does not
* exits and captures its stdout/stderr output.
*/
- public static class MockCommandLineProcessor extends CommandLineProcessor {
+ public static class MockCommandLineProcessor extends CommandLineParser {
private boolean mExitCalled;
private boolean mHelpCalled;
private String mStdOut = "";