It there any way to avoid duplication in configuration between two similar tasks of the same type?
For example, I'd like to create a debugSomething
task, with the same configuration as runSomething
below but with the addition of a remote debugger argument to the jvmArgs:
task runSomething(dependsOn: jar, type: JavaExec, group: "Run") {
jvmArgs "-Xmx1024m", "-XX:MaxPermSize=128m"
main = "com.some.Main"
classpath = sourceSets.main.runtimeClasspath
}