Skip to content

Instantly share code, notes, and snippets.

@bendisposto
Last active October 7, 2017 05:45
Show Gist options
  • Save bendisposto/7835d20760a765a60b9d to your computer and use it in GitHub Desktop.
Save bendisposto/7835d20760a765a60b9d to your computer and use it in GitHub Desktop.
apply plugin: 'java'
sourceSets.main.java.srcDir('.')
sourceSets.main.output.classesDir('bin')
repositories { mavenCentral(); }
def java(String x) {
def arguments = x.split(" ")
def t = arguments.tail() as List
new ByteArrayOutputStream().withStream { os ->
javaexec {
main = arguments.head()
classpath = sourceSets.main.runtimeClasspath
args = t
standardOutput = os
}
os.toString();
}
}
ext {
java = this.&java
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment