You could use the JavaExec task. I do the same in the Aluminum build (
http://code.google.com/p/aluminumproject/source/browse/build.gradle): the
createAluDocs task of the root project depends on the build task of its
aludoc subproject.

2011/3/24 phil swenson <[email protected]>

> 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
>

Reply via email to