views:

246

answers:

3

I wrote some Groovy code, and I'd like to integrate it with the existing Java code. We'd like to be able to keep our ant scripts, and only add the needed Groovy functionality. Will Gant allow us to keep our existing scripts?

+1  A: 

According to the Gant site, no:

Gant is a tool for scripting Ant tasks using Groovy instead of XML to specify the logic. A Gant specification is a Groovy script ...

A Gant build script uses Groovy script, not XML, but it uses the Ant tasks. Therefore if you have any custom Ant tasks you will still be able to use those.

Jared Oberhaus
so any build script wrote so far will continue to work?
Geo
According to what their website says, any Ant build script that you wrote will not work. You can always execute Ant from a Gant script and execute them that way, but as a first class citizen your build.xml and friends are not for Gant.
Jared Oberhaus
+1  A: 

Perhaps you could give more detail about what you want to do. You can call normal Ant scripts from Gant and vice-versa.

You can also use the groovy ant task to run arbitrary Groovy in your normal (or Gant-flavored) ant builds.

Paul King
A: 

The following doesn't answer the question with respect to Gant, but it might help with the problem:

Gradle is a Groovy-build tool. It is more sophisticated than Gant. I've blogged on this here.

From the Gradle FAQ (here):

Gradle can import any Ant build script. Gradle integrates deeply with an Ant build. Every Ant target is represented as a Gradle task. This task can be further enhanced in your Gradle build script.

Michael Easter