I'm trying to migrate from ant to gradle. First phase of this is to move all dependecies to gradle.build and still build war via ant.
In ant building task looks like that:
<fileset id="project-libraries" dir="${project.libs.path}">
<include name="*jar"/>
</fileset>
<path id="master-classpath">
<fileset refid="project-libraries"/>
<fileset refid="tomcat"/>
<fileset refid="hibernate-tools"/>
<fileset refid="findbug"/>
<pathelement path="${build.dir}"/>
</path>
<target name="build" description="Build the application">
<javac destdir="${build.dir}" target="${javac.version}" source="${javac.version}" nowarn="true" deprecation="false" optimize="false" failonerror="true" encoding="utf-8" debug="on">
<src refid="src.dir.set"/>
<classpath refid="master-classpath${master-classpath-version}"/>
<compilerarg value="-Xlint:-unchecked"/>
</javac>
</target>
In Gradle I'm importing build.xml with this code:
ant.importBuild('build.xml') { antTargetName ->
'ant_' + antTargetName
}
The problem is that ant task (./gradlew ant_build
) doesn't have dependencies from Gradle (dependencies { ... }
). How can I put them into classpath (without modifying ant build)?