Hi,

I've added an Ant plugin, which allows a build script to import an Ant build, so that the targets of the Ant build become usable as tasks in the Gradle project. Some things you can do:
- Gradle tasks can depend on Ant targets
- Ant targets can depend on Gradle tasks
- You can add behaviour to Ant targets, using doFirst() or doLast() (or pretty much any other method of Task)
- You can enable/disable Ant targets or add dependencies

Here's how you use the plugin:

usePlugin 'ant'
importAntBuild 'some-build-file.xml'

You can see some examples at: http://gradle.org/latest/docs/userguide/ant.html#N10C8E

Some questions and loose ends:

I'm not sure about the method name importAntBuild(). Perhaps it should be something declarative, like extendsAntBuild()?

Or should the ant build file be something more fundamental to the project, such that it is specified when the project is declared, just like the Gradle build file is? Would a maven plugin work the same way? Could you mix the Ant and Maven plugins in the same project? Perhaps projects should be typed, so that a given project is either a Gradle project, or an Ant project, or a Maven project?

Also, should we provide a DSL for accessing the properties of the Ant project? Currently you set and get properties using:

ant.project.setProperty('someProp', 'value')
println ant.project.properties.someProp

Maybe something like this would be better?

ant.someProp = 'value'
println ant.someProp

It might be possible to also have the Ant properties synchronised with the Gradle properties, so that you can set it in Gradle or Ant and it is available in the other context.


Adam


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to