Permalink
Browse files

Merge pull request #44 from bigdavedev/master

[FIXED JENKINS-23134] Replace File.separator with "/".

Fixes inability to launch Android tools on Unix slaves from a Windows master.
  • Loading branch information...
orrc committed Jan 22, 2015
2 parents a0589ce + 28f76bb commit 98d2a53130cb7165b80e08b2496822ec20bbda68
@@ -4,6 +4,6 @@

public class DefaultToolLocator implements ToolLocator {
public String findInSdk(AndroidSdk androidSdk, Tool tool) {
return File.separator + "tools" + File.separator;
return "/tools/";
}
}
@@ -4,7 +4,7 @@
import java.io.File;

public class PlatformToolLocator implements ToolLocator {
private static final String BUILD_TOOLS_PATH = File.separator + "build-tools" + File.separator;
private static final String BUILD_TOOLS_PATH = "/build-tools/";

public String findInSdk(AndroidSdk androidSdk, Tool tool) throws SdkInstallationException {
if (tool == Tool.AAPT) {
@@ -15,14 +15,14 @@ public String findInSdk(AndroidSdk androidSdk, Tool tool) throws SdkInstallation
return getFirstInstalledBuildToolsDir(subDirs);
}
}
return File.separator + "platform-tools" + File.separator;
return "/platform-tools/";

}

private String getFirstInstalledBuildToolsDir(String[] buildToolsDirs) throws SdkInstallationException {
if (buildToolsDirs.length == 0) {
throw new SdkInstallationException("Please install at least one set of build-tools.");
}
return BUILD_TOOLS_PATH + buildToolsDirs[0] + File.separator;
return BUILD_TOOLS_PATH + buildToolsDirs[0] + "/";
}
}

0 comments on commit 98d2a53

Please sign in to comment.