Issues with migrating Ant build to Gradle


(Jonathan Zinger) #1

Hi,

I’ve been trying to migrate my old Ant build script to Gradle. However I’ve been coming up with one issue so far:

My old code one of the targets references ant.home, which doesn’t exist. Is there anyway to handle this without changing the Ant script?

Best regards, Jonathan


(Benjamin Muschko) #2

You could probably override the System property “ant.home” in your Gradle build script.

What exactly are you referencing with this property in your Ant build? I’d try to do without it by changing the Ant script.


(Jonathan Zinger) #3

Specifically ant-launcher.jar, which does ship with Gradle so I could change the build file and point to it. But I don’t think that is necessary the best choice of action since I don’t think it’s the best way to handle this.

Funny thing is ANT_HOME is set on my system yet Gradle doesn’t seem to pick it up, is it possible that it is caused by the Ant task forking?


(Benjamin Muschko) #4

Would you mind posting the Ant target that uses “ant.home”? I don’t think Gradle really cares about ANT_HOME.


(Jonathan Zinger) #5
<java classname="org.apache.tools.ant.launch.Launcher" fork="true" failonerror="true">
      <jvmarg value="-Xmx256M" />
      <classpath>
        <pathelement location="${ant.home}/lib/ant-launcher.jar" />
      </classpath>
      <jvmarg value="-Dant.library.dir=${ant.home}/lib" />