Pregunta

I'm porting an Ant build.xml to Gradle. I wanted to use Gradle's AntBuilder to do something like

task mytask << { ant { jar(..) { ... } } }

I am having some trouble with the syntax and can't figure out where AntBuilder is documented. The Gradle user guide just points to the API [1] which is pretty useless. As it doesn't document any of ant-tasks supported by AntBuilder (e.g. jar, copy, etc.).

Googling I found another person asking the same question [2] but no one answered.

[1] http://www.gradle.org/docs/current/groovydoc/org/gradle/api/AntBuilder.html [2] http://groovy.329449.n5.nabble.com/Where-s-the-documentation-for-Antbuilder-tt2857050.html#none

¿Fue útil?

Solución

AntBuilder is documented in the "Using Ant from Gradle" chapter of the Gradle User Guide. That said, here are some further pointers:

  • Gradle's AntBuilder is (virtually) the same as Groovy's AntBuilder. The syntax is a mechanical translation of the Ant XML syntax. To get started, check out the samples in the full Gradle distribution.

  • AntBuilder can be used with any Ant task. For information on a particular Ant task, check its documentation.

  • Third-party Ant tasks (i.e. Ant tasks that don't ship with Ant) have to be defined beforehand exactly as in Ant. For details, see the user guide chapter.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top