Skip to content

Commit

Permalink
[FIXED JENKINS-18235] set PATH with GRAILS_HOME/bin
Browse files Browse the repository at this point in the history
  • Loading branch information
ndeloof committed Jun 6, 2013
1 parent b64d732 commit 250c534
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/com/g2one/hudson/grails/GrailsBuilder.java
Expand Up @@ -15,6 +15,7 @@
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.StaplerRequest;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
Expand Down Expand Up @@ -203,6 +204,10 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListen
grailsInstallation = grailsInstallation.forEnvironment(env)
.forNode(Computer.currentComputer().getNode(), listener);
env.put("GRAILS_HOME", grailsInstallation.getHome());

String path = env.get("PATH");
path = path == null ? "" : path + (launcher.isUnix() ? ":" : ";");
env.put("PATH", path + grailsInstallation.getHome() + (launcher.isUnix() ? "/bin" : "\\bin"));
}

String jopts = env.get(JAVA_OPTS);
Expand Down Expand Up @@ -252,8 +257,7 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListen
addArgument("--refresh-dependencies", refreshDependencies, args, env, targetsAndArgs);

if (!launcher.isUnix()) {
args.prepend("cmd.exe", "/C");
args.add("&&", "exit", "%%ERRORLEVEL%%");
args = args.toWindowsCommand();
}

GrailsConsoleAnnotator gca = new GrailsConsoleAnnotator(listener.getLogger(), build.getCharset());
Expand Down

0 comments on commit 250c534

Please sign in to comment.