aboutsummaryrefslogtreecommitdiffstats
path: root/sdkmanager/libs
diff options
context:
space:
mode:
authorRaphael <raphael@google.com>2011-11-13 21:23:17 -0800
committerRaphael <raphael@google.com>2011-11-14 13:46:13 -0800
commitefe1af451d561571ea8e29bbe90ccaa3b66461e4 (patch)
tree0649f79afaea2160c5aad1df626956e829295a49 /sdkmanager/libs
parent97f3e04a77af30ab32c8e22f5240c89326620867 (diff)
downloadsdk-efe1af451d561571ea8e29bbe90ccaa3b66461e4.zip
sdk-efe1af451d561571ea8e29bbe90ccaa3b66461e4.tar.gz
sdk-efe1af451d561571ea8e29bbe90ccaa3b66461e4.tar.bz2
SDK: Switch from android.bat to android.exe
Change-Id: I549340bdaaf78d6d314992ad2b91e9b45f97d2c2
Diffstat (limited to 'sdkmanager/libs')
-rw-r--r--sdkmanager/libs/sdklib/src/com/android/sdklib/SdkConstants.java4
-rwxr-xr-xsdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/LocalSdkParser.java17
2 files changed, 14 insertions, 7 deletions
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/SdkConstants.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/SdkConstants.java
index e335411..545da62 100644
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/SdkConstants.java
+++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/SdkConstants.java
@@ -413,13 +413,13 @@ public final class SdkConstants {
- /** Returns the appropriate name for the 'android' command, which is 'android.bat' for
+ /** Returns the appropriate name for the 'android' command, which is 'android.exe' for
* Windows and 'android' for all other platforms. */
public static String androidCmdName() {
String os = System.getProperty("os.name"); //$NON-NLS-1$
String cmd = "android"; //$NON-NLS-1$
if (os.startsWith("Windows")) { //$NON-NLS-1$
- cmd += ".bat"; //$NON-NLS-1$
+ cmd += ".exe"; //$NON-NLS-1$
}
return cmd;
}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/LocalSdkParser.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/LocalSdkParser.java
index efc736a..18b8cc5 100755
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/LocalSdkParser.java
+++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/LocalSdkParser.java
@@ -34,7 +34,6 @@ import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
import java.util.Properties;
-import java.util.Set;
/**
* Scans a local SDK to find which packages are currently installed.
@@ -417,16 +416,24 @@ public class LocalSdkParser {
// We're not going to check that all tools are present. At the very least
// we should expect to find android and an emulator adapted to the current OS.
- Set<String> names = new HashSet<String>();
+ boolean hasEmulator = false;
+ boolean hasAndroid = false;
+ String android1 = SdkConstants.androidCmdName();
+ String android2 = android1.indexOf('.') == -1 ? null : android1.replace(".exe", ".bat");
File[] files = toolFolder.listFiles();
if (files != null) {
for (File file : files) {
- names.add(file.getName());
+ String name = file.getName();
+ if (SdkConstants.FN_EMULATOR.equals(name)) {
+ hasEmulator = true;
+ }
+ if (android1.equals(name) || (android2 != null && android2.equals(name))) {
+ hasAndroid = true;
+ }
}
}
- if (!names.contains(SdkConstants.androidCmdName()) ||
- !names.contains(SdkConstants.FN_EMULATOR)) {
+ if (!hasAndroid || !hasEmulator) {
return null;
}