Can I import existing Ant builds into a Gradle build?

While migrating to Gradle, I’d like to reuse parts of my existing ant build from Gradle.

How can I do this?

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

The integration even works in both ways. You can depend on Gradle tasks in your build.xml. In addition, accessing and modifying Ant properties from your build script is now much easier.

See this section of the user guide for details.

I’m having one issue migrating one of my ant tasks to gradle. My ant target (xslt) sets the style properties to “${ant.home}/etc/changelog.xsl”. The ant.home property doesn’t seem to be available when running from gradle. Does gradle include the xsl stylesheets that come with ant? If so how can I refer to them? If not, any recommendations where these type of files should be placed in a gradle project?

Please create a new topic with an appropriate title.

Done. See