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, w
I've been searching for something similar with a difference that I don't want to share the config among all the tasks of the same type, but only for some of them.
I've tried something like stated in the accepted answer, it wasn't working well though. I'll try again then.
As I've got here, I don't mind to share, there is (at least now) a better, Gradle's built-in way to achieve the thing which was asked here. It goes like:
tasks.withType(JavaExec) {
jvmArgs "-Xmx1024m", "-XX:MaxPermSize=128m"
main = "com.some.Main"
classpath = sourceSets.main.runtimeClasspath
}
This way all the tasks of JavaExec
type will receive the default config which can obviously be altered by any specific task of the same type.