diff options
author | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2016-11-01 17:15:33 +0300 |
---|---|---|
committer | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2016-11-01 17:15:33 +0300 |
commit | d364b76f52f6aa2fb901055d1c688a65ad2f4f2d (patch) | |
tree | 919e79165121cc72d43ca0c1ab911e8e34485d59 | |
parent | b9ebe9c4b27ab3eeb27e83c7b506db5db8d5f8fa (diff) | |
download | dokka-d364b76f52f6aa2fb901055d1c688a65ad2f4f2d.tar.gz dokka-d364b76f52f6aa2fb901055d1c688a65ad2f4f2d.tar.bz2 dokka-d364b76f52f6aa2fb901055d1c688a65ad2f4f2d.zip |
Removed path relativize for commands
-rw-r--r-- | buildSrc/src/main/groovy/org/jetbrains/CrossPlatformExec.groovy | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/buildSrc/src/main/groovy/org/jetbrains/CrossPlatformExec.groovy b/buildSrc/src/main/groovy/org/jetbrains/CrossPlatformExec.groovy index 9c6780f7..a83d6f65 100644 --- a/buildSrc/src/main/groovy/org/jetbrains/CrossPlatformExec.groovy +++ b/buildSrc/src/main/groovy/org/jetbrains/CrossPlatformExec.groovy @@ -25,7 +25,7 @@ class CrossPlatformExec extends AbstractExecTask { List<String> commandLine = this.getCommandLine(); if (!commandLine.isEmpty()) { - commandLine[0] = findCommand(workingDir, commandLine[0], windows); + commandLine[0] = findCommand(commandLine[0], windows); } if (windows) { @@ -41,7 +41,7 @@ class CrossPlatformExec extends AbstractExecTask { super.exec(); } - private static String findCommand(File workingDir, String command, boolean windows) { + private static String findCommand(String command, boolean windows) { command = normalizeCommandPaths(command); def extensions = windows ? windowsExtensions : unixExtensions; @@ -53,18 +53,16 @@ class CrossPlatformExec extends AbstractExecTask { commandFile = Paths.get(command); } - return resolveCommandFromFile(workingDir, commandFile, windows); + return resolveCommandFromFile(commandFile, windows); }; } - private static String resolveCommandFromFile(File workingDir, Path commandFile, boolean windows) { + private static String resolveCommandFromFile(Path commandFile, boolean windows) { if (!Files.isExecutable(commandFile)) { return null; } - Path cwd = Paths.get(workingDir.absolutePath).toAbsolutePath().normalize(); - - String resolvedCommand = cwd.relativize(commandFile.toAbsolutePath().normalize()); + String resolvedCommand = commandFile.toAbsolutePath().normalize(); if (!windows && !resolvedCommand.startsWith('.')) { resolvedCommand = '.' + File.separator + resolvedCommand; |