I’m now planning to migrate my project from Ant to Gradle. And I’d like to convert the ant to Gradle completely.
Previously, I used the FMPP Ant task in ant build.xml to generate it. More details in : The Ant Task - FMPP
<target name="build"> <fmpp sourceRoot="src" outputRoot="out" data="tdd(data/style.tdd), birds:csv(data/birds.csv)" /> </target>
Now I want to use Gradle to do it. I found a way to use the ant.task in gradle like freemarker - Using fmpp in gradle to generate java files - Stack Overflow .
task generateFmppSources(dependsOn: ":unix4j-tools:compileJava") << { println "Generating sources...." ant.taskdef(name:'fmpp', classname:'fmpp.tools.AntTask', classpath:configurations.pmd.asPath); ant.fmpp configuration:"src/main/resources/codegen/config.fmpp", sourceRoot:"src/main/resources/codegen/templates", outputRoot:"target/generated-sources/main/java"; }
Is there any other way to do it in Gradle? I mean in a true Gradle way. No more Ant.
Thank you.