I would like my gradle task to:
This is like starting a server to run integration tests, but this is not a tomcat/jetty type server, so it needs to be launch from command line and wait for server to be "ready" via the server's stdout.
I am currently able to use the exec task to run my task and get the output. So I think I can probably code in Groovy/Java to achieve what I want.
However, it seems tedious to code this seemingly common pattern. So I am wondering if there's an easier way to solve such problems without too much coding - i.e. is this a common pattern that gradle has a DSL for?
Note that I am a newbie at Gradle, so any advise around this topic would also be appreciated.
Every Gradle build proceeds through three lifecycle phases in precisely the same order. These phases are initialization, configuration, and execution. During the initialization phase, Gradle starts up and locates the build files it must process.
The work that Gradle can do on a project is defined by one or more tasks. A task represents some atomic piece of work which a build performs. This might be compiling some classes, creating a JAR, generating Javadoc, or publishing some archives to a repository.
In Gradle terms this means that you can define tasks and dependencies between tasks. Gradle guarantees that these tasks are executed in the order of their dependencies, and that each task is executed only once. These tasks form a Directed Acyclic Graph.
As far as I know, current version of Gradle (1.4) has no dedicated DSL support for starting up/shutting down external processes. You can implement it in groovy right inside build script, it should not be too difficult.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With