Created
May 3, 2013 16:11
-
-
Save dkandalov/5510491 to your computer and use it in GitHub Desktop.
Executing command in Groovy (using Ant)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def execute(String command, List<String> parameters) { | |
def ant = new AntBuilder() | |
ant.exec(outputproperty:"cmdOut", | |
errorproperty: "cmdErr", | |
resultproperty:"cmdExit", | |
failonerror: "true", | |
executable: command) { | |
arg(line: parameters.join(" ")) | |
} | |
[exitCode: ant.project.properties.cmdExit, stderr: ant.project.properties.cmdErr, stdout: ant.project.properties.cmdOut] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment