diff options
author | Raphael <raphael@google.com> | 2011-12-16 15:49:43 -0800 |
---|---|---|
committer | Raphael <raphael@google.com> | 2011-12-16 16:56:28 -0800 |
commit | d09ef044f4f0d6dbcb98d152c9d2ee4f21c5cb0a (patch) | |
tree | 1dfe63736f645ac3dd9b19b2bcdda7f50df08f3a /sdkmanager/app | |
parent | d5f733212db0aaa7b80d0f9d7184f8cc6943503d (diff) | |
download | sdk-d09ef044f4f0d6dbcb98d152c9d2ee4f21c5cb0a.zip sdk-d09ef044f4f0d6dbcb98d152c9d2ee4f21c5cb0a.tar.gz sdk-d09ef044f4f0d6dbcb98d152c9d2ee4f21c5cb0a.tar.bz2 |
SDK Manager: list/update sdk --all
This renames the list/update sdk --obsolete flag
to --all (-a shortcut) to better reflect what the
code actually does.
SDK Bug: 23004
Change-Id: Ide60f3de97767283e7574a92d4ec96b0e5d4fd86
Diffstat (limited to 'sdkmanager/app')
-rw-r--r-- | sdkmanager/app/src/com/android/sdkmanager/Main.java | 52 | ||||
-rw-r--r-- | sdkmanager/app/src/com/android/sdkmanager/SdkCommandLine.java | 27 |
2 files changed, 60 insertions, 19 deletions
diff --git a/sdkmanager/app/src/com/android/sdkmanager/Main.java b/sdkmanager/app/src/com/android/sdkmanager/Main.java index 06dea46..0129766 100644 --- a/sdkmanager/app/src/com/android/sdkmanager/Main.java +++ b/sdkmanager/app/src/com/android/sdkmanager/Main.java @@ -371,29 +371,45 @@ public class Main { } private void displayRemoteSdkListNoUI() { - boolean force = mSdkCommandLine.getFlagForce(); - boolean useHttp = mSdkCommandLine.getFlagNoHttps(); - boolean obsolete = mSdkCommandLine.getFlagObsolete(); + boolean force = mSdkCommandLine.getFlagForce(); + boolean useHttp = mSdkCommandLine.getFlagNoHttps(); + boolean all = mSdkCommandLine.getFlagAll(); boolean extended = mSdkCommandLine.getFlagExtended(); String proxyHost = mSdkCommandLine.getParamProxyHost(); String proxyPort = mSdkCommandLine.getParamProxyPort(); - SdkUpdaterNoWindow upd = new SdkUpdaterNoWindow(mOsSdkFolder, mSdkManager, mSdkLog, - force, useHttp, proxyHost, proxyPort); - upd.listRemotePackages(obsolete, extended); + boolean obsolete = mSdkCommandLine.getFlagObsolete(); + all |= obsolete; + + SdkUpdaterNoWindow upd = new SdkUpdaterNoWindow( + mOsSdkFolder, + mSdkManager, + mSdkLog, + force, + useHttp, + proxyHost, + proxyPort); + upd.listRemotePackages(all, extended); + + if (obsolete) { + mSdkLog.printf("Note: Flag --obsolete is deprecated and will be removed in the next version.\n Please use --all instead.\n"); + } } /** * Updates the whole SDK without any UI, just using console output. */ private void updateSdkNoUI() { - boolean force = mSdkCommandLine.getFlagForce(); - boolean useHttp = mSdkCommandLine.getFlagNoHttps(); - boolean dryMode = mSdkCommandLine.getFlagDryMode(); - boolean obsolete = mSdkCommandLine.getFlagObsolete(); + boolean force = mSdkCommandLine.getFlagForce(); + boolean useHttp = mSdkCommandLine.getFlagNoHttps(); + boolean dryMode = mSdkCommandLine.getFlagDryMode(); + boolean all = mSdkCommandLine.getFlagAll(); String proxyHost = mSdkCommandLine.getParamProxyHost(); String proxyPort = mSdkCommandLine.getParamProxyPort(); + boolean obsolete = mSdkCommandLine.getFlagObsolete(); + all |= obsolete; + // Check filter types. Pair<String, ArrayList<String>> filterResult = checkFilterValues(mSdkCommandLine.getParamFilter()); @@ -402,9 +418,19 @@ public class Main { errorAndExit(filterResult.getFirst()); } - SdkUpdaterNoWindow upd = new SdkUpdaterNoWindow(mOsSdkFolder, mSdkManager, mSdkLog, - force, useHttp, proxyHost, proxyPort); - upd.updateAll(filterResult.getSecond(), obsolete, dryMode); + SdkUpdaterNoWindow upd = new SdkUpdaterNoWindow( + mOsSdkFolder, + mSdkManager, + mSdkLog, + force, + useHttp, + proxyHost, + proxyPort); + upd.updateAll(filterResult.getSecond(), all, dryMode); + + if (obsolete) { + mSdkLog.printf("Note: Flag --obsolete is deprecated and will be removed in the next version.\n Please use --all instead.\n"); + } } /** diff --git a/sdkmanager/app/src/com/android/sdkmanager/SdkCommandLine.java b/sdkmanager/app/src/com/android/sdkmanager/SdkCommandLine.java index e334e62..0390580 100644 --- a/sdkmanager/app/src/com/android/sdkmanager/SdkCommandLine.java +++ b/sdkmanager/app/src/com/android/sdkmanager/SdkCommandLine.java @@ -79,7 +79,7 @@ class SdkCommandLine extends CommandLineProcessor { public static final String KEY_PROXY_PORT = "proxy-port"; //$NON-NLS-1$ public static final String KEY_PROXY_HOST = "proxy-host"; //$NON-NLS-1$ public static final String KEY_DRY_MODE = "dry-mode"; //$NON-NLS-1$ - public static final String KEY_OBSOLETE = "obsolete"; //$NON-NLS-1$ + public static final String KEY_ALL = "all"; //$NON-NLS-1$ public static final String KEY_EXTENDED = "extended"; //$NON-NLS-1$ public static final String KEY_SNAPSHOT = "snapshot"; //$NON-NLS-1$ public static final String KEY_COMPACT = "compact"; //$NON-NLS-1$ @@ -259,8 +259,13 @@ class SdkCommandLine extends CommandLineProcessor { null); define(Mode.BOOLEAN, false, - VERB_LIST, OBJECT_SDK, "o", KEY_OBSOLETE, //$NON-NLS-1$ - "Lists all packages (including obsolete and installed ones)", + VERB_LIST, OBJECT_SDK, "a", KEY_ALL, //$NON-NLS-1$ + "Lists all available packages (including obsolete and installed ones)", + false); + + define(Mode.BOOLEAN, false, + VERB_LIST, OBJECT_SDK, "o", "obsolete", //$NON-NLS-1$ + "Deprecated. Please use --all instead.", false); define(Mode.BOOLEAN, false, @@ -301,8 +306,13 @@ class SdkCommandLine extends CommandLineProcessor { null); define(Mode.BOOLEAN, false, - VERB_UPDATE, OBJECT_SDK, "o", KEY_OBSOLETE, //$NON-NLS-1$ - "Installs obsolete packages.", + VERB_UPDATE, OBJECT_SDK, "a", KEY_ALL, //$NON-NLS-1$ + "Includes all packages (such as obsolete and non-dependent ones.)", + false); + + define(Mode.BOOLEAN, false, + VERB_UPDATE, OBJECT_SDK, "p", "obsolete", //$NON-NLS-1$ + "Deprecated. Please use --all instead.", false); define(Mode.BOOLEAN, false, @@ -533,7 +543,12 @@ class SdkCommandLine extends CommandLineProcessor { /** Helper to retrieve the --obsolete flag. */ public boolean getFlagObsolete() { - return ((Boolean) getValue(null, null, KEY_OBSOLETE)).booleanValue(); + return ((Boolean) getValue(null, null, "obsolete")).booleanValue(); + } + + /** Helper to retrieve the --all flag. */ + public boolean getFlagAll() { + return ((Boolean) getValue(null, null, KEY_ALL)).booleanValue(); } /** Helper to retrieve the --extended flag. */ |