Skip to content
Permalink
Browse files

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

When using this plugin on a Windows master delegating to a Unix slave
File.separator resolves to "\\" resulting in erroneous paths.

Signed-off-by: Dave Brown <d.brown@bigdavedev.com>
  • Loading branch information...
bigdavedev committed Jan 20, 2015
1 parent edfbb3d commit 28f76bb7acfd96a16a1eb5626b2527ad9b96856f
@@ -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 28f76bb

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