Skip to content
Permalink
Browse files

Merge pull request #7 from ndeloof/master

JENKINS-18235 set PATH with GRAILS_HOME/bin
  • Loading branch information...
ndeloof committed Jun 18, 2013
2 parents b64d732 + 250c534 commit 2de4edb57d19ea700392464e5cc65876e0fbfea7
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/main/java/com/g2one/hudson/grails/GrailsBuilder.java
@@ -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;
@@ -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);
@@ -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());

0 comments on commit 2de4edb

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