I have a Gradle project that used the Groovy plugin.
The folder structure of the gradle project is:
src
main
groovy
com
acme
runner
resources
build.gradle
I have a task that uses JavaExec
that calls the main method for the Simple Class
defined in Simple.groovy
as below:
task runScript(type: JavaExec) {
description 'Run Groovy script'
// Set main property to name of Groovy script class.
main = 'com.acme.runner.Simple'
// Set classpath for running the Groovy script.
classpath = sourceSets.main.runtimeClasspath
}
I would like to define a task calls another method in the Simple class
is this possible and does it have the be a static method? Thanks.