This might be more of a groovy question rather than a gradle question - not
sure.
One problem with the choice of Groovy as the build script language is it's
not interpreted. This means if your build references an artifact that the
build itself is building, you are in an awkward situation when the artifact
hasn't ever been built - even if you aren't calling the task that depends on
the missing artifact.
I think that a possible solution to this issues is if groovy (or gradle)
allowed sections of the script to not be compiled until that part of the
script is actually executed.
something like this (<{ code }> signifies don't compile ahead of time):
task cleanDB {
description = "Clean the db"
<{
com.blah.DBUtil.cleanDB()
}>
}
So DBUtil.cleanDB() isn't compiled until cleanDB task is executed. This
would allow tasks to be included in the build scripts that reference
artifacts that the build script builds. If that makes sense.
Does this idea make any sense? I don't even know if it's possible....
phil