Skip to content
Permalink
Browse files

Don't look for specific emulator binaries.

Only look for the main emulator binary when validating an SDK root -
don't look for the emulator64-* binaries (only in r21+) and the -mips
and -x86 binaries (only in r12+).

This resolves JENKINS-15967.
  • Loading branch information...
jorgenpt authored and orrc committed Nov 28, 2012
1 parent c6b9d98 commit 04c6fedb0fa692ef903f21e502e93542019e70a3
@@ -18,6 +18,10 @@
EMULATOR64_ARM, EMULATOR64_MIPS, EMULATOR64_X86
};

public static Tool[] REQUIRED = new Tool[] {
AAPT, ADB, ANDROID, EMULATOR, MKSDCARD
};

public final String executable;
public final String windowsExtension;
public final boolean isPlatformTool;
@@ -43,8 +47,15 @@ public String getExecutable(boolean isUnix) {
return executable + windowsExtension;
}

public static String[] getAllRequiredExecutableVariants() {
return getAllExecutableVariants(REQUIRED);
}

public static String[] getAllExecutableVariants() {
final Tool[] tools = values();
return getAllExecutableVariants(values());
}

private static String[] getAllExecutableVariants(final Tool[] tools) {
String[] executables = new String[tools.length * 2];
for (int i = 0, n = tools.length; i < n; i++) {
executables[i*2] = tools[i].getExecutable(true);
@@ -57,4 +68,4 @@ public String getExecutable(boolean isUnix) {
public String toString() {
return executable;
}
}
}
@@ -246,7 +246,7 @@ public static ValidationResult validateAndroidHome(File sdkRoot, boolean fromWeb

// Search the possible tool directories to ensure the tools exist
int toolsFound = 0;
int expectedToolCount = Tool.values().length;
int expectedToolCount = Tool.REQUIRED.length;
if (!new File(sdkRoot, "platform-tools").exists()) {
// aapt doesn't exist in "tools" until SDK Tools r9
expectedToolCount--;
@@ -257,7 +257,7 @@ public static ValidationResult validateAndroidHome(File sdkRoot, boolean fromWeb
if (!toolsDir.isDirectory()) {
continue;
}
for (String executable : Tool.getAllExecutableVariants()) {
for (String executable : Tool.getAllRequiredExecutableVariants()) {
File toolPath = new File(toolsDir, executable);
if (toolPath.exists() && toolPath.isFile()) {
toolsFound++;

0 comments on commit 04c6fed

Please sign in to comment.
You can’t perform that action at this time.