Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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 28f76bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -4,6 +4,6 @@

public class DefaultToolLocator implements ToolLocator {
public String findInSdk(AndroidSdk androidSdk, Tool tool) {
return File.separator + "tools" + File.separator;
return "/tools/";
}
}
Expand Up @@ -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) {
Expand All @@ -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.