I'm converting our build from Ant to Gradle. Our first step is to add the Gradle build files so we can start using Gradle as our build tool. This lets us use our existing build scripts to build using Ant and convert them to Gradle over time. I want to simply have Gradle call the existing Ant build files. Our projects are all NetBeans projects, which have build.xml and nbproject/build-impl.xml files. Some of the projects require NetBeans build properties, which can be found at ~/.netbeans/6.5.1/build.properties. I currently have build.gradle which contains only this:
ant.importBuild 'build.xml'
I can build the project using Ant like this:
ant -Duser.properties.file=/home/me/.netbeans/6.5.1/build.properties dist
However, when I build with Gradle, Ant complains it cannot find the properties set in build.properties. I've tried setting the Ant property, but it doesn't seem to get picked up:
ant.properties['user.properties.file'] = '/home/me/.netbeans/6.5/build.properties'
I've also tried setting a system property:
systemProperties 'user.properties.file': '/home/me/.netbeans/6.5/build.properties'
but this doesn't work either. Ideally I'd like to set this property in ~/.gradle/gradle.properties as just about all of our projects need it.
How can I set this property in Gradle and have Ant pick it up when called from Gradle?