Skip to content

Commit

Permalink
FIx JENKINS-19326
Browse files Browse the repository at this point in the history
  • Loading branch information
gboissinot committed Aug 26, 2013
1 parent 3552b0e commit 179a31c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Expand Up @@ -15,6 +15,10 @@ public PostBuildScriptLog(TaskListener listener) {
this.listener = listener;
}

public TaskListener getListener() {
return listener;
}

public void info(String message) {
listener.getLogger().println("[PostBuildScript] - " + message);
}
Expand Down
Expand Up @@ -115,7 +115,7 @@ public FilePath invoke(File ws, VirtualChannel channel) throws IOException, Inte
}


public boolean performGroovyScript(FilePath workspace, final String scriptContent) {
public boolean performGroovyScript(final FilePath workspace, final String scriptContent) {

if (scriptContent == null) {
throw new NullPointerException("The script content object must be set.");
Expand All @@ -126,6 +126,9 @@ public Boolean call() throws Throwable {
final String groovyExpressionResolved = Util.replaceMacro(scriptContent, EnvVars.masterEnvVars);
log.info(String.format("Evaluating the groovy script: \n %s", scriptContent));
GroovyShell shell = new GroovyShell();
shell.setVariable("workspace", new File(workspace.getRemote()));
shell.setVariable("log", log);
shell.setVariable("out", log.getListener().getLogger());
shell.evaluate(groovyExpressionResolved);
return true;
}
Expand Down

0 comments on commit 179a31c

Please sign in to comment.