Skip to content

Instantly share code, notes, and snippets.

@ethankhall
Created August 18, 2016 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ethankhall/4c62e880efab24bd6a522f068be0501d to your computer and use it in GitHub Desktop.
Save ethankhall/4c62e880efab24bd6a522f068be0501d to your computer and use it in GitHub Desktop.
configurations {
groovy
}
dependencies {
groovy localGroovy()
}
project.tasks.create("generateExample", JavaExec) { task ->
def inputFile = file("input.groovy")
def outputFile = file("output.txt")
task.inputs.file(inputFile)
task.outputs.file(outputFile)
task.main = "groovy.ui.GroovyMain"
task.args = [inputFile]
task.classpath = configurations.groovy
def output = new FileOutputStream(outputFile)
task.standardOutput = output
task.errorOutput = output
}
print "Hello World"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment