I’m trying to experiment with migrating a messy set of Ant scripts to Gradle. Just importing the “build.xml” failed, because I already had a “build” task defined. I then tried to follow the steps in http://www.kellyrob99.com/blog/2011/09/18/using-gradle-to-bootstrap-your-legacy-ant-builds/ for hacking around task conflicts.
For background, I have a “build.xml” which imports another build script in an external directory, which was provided to us (this is from ATG, which you don’t really need to know).
In my “build.xml”, I have the following: ------------------
<property name="global.dir" value="${store.root.dir}"/>
<import file="${global.dir}/buildtools/common.xml"/>
That “common.xml” file has some taskdefs, which I’m to understand don’t transfer well when importing Ant build scripts into Gradle. So, I’m stepping through them now.
The first one I have to deal with in the “common.xml” file is this: ----------------
<taskdef resource="net/sf/antcontrib/antcontrib.properties"
classpath="${buildtools.dir}/lib/ant-contrib.jar"/>
In my “commonBuild.gradle” file, I’ve added the following for this: ---------------------------
out.println "storeRootDir[" + storeRootDir + "]"
ant.taskdef(resource: 'net/sf/antcontrib/antcontrib.properties') {
classpath {
fileset(dir: storeRootDir + '/buildtools/lib', includes: 'ant-contrib.jar')
}
}
When I run the build, I see this: -------------------------
storeRootDir[C:/ATG/ATG10.2/CommerceReferenceStore/Store]
[ant:taskdef] Could not load definitions from resource net/sf/antcontrib/antcontrib.properties. It could not be found.
I’ve verified that “C:/ATG/ATG10.2/CommerceReferenceStore/Store/buildtools/lib/ant-contrib.jar” has “net/sf/antcontrib/antcontrib.properties”.
What might I be doing wrong?