Created
April 24, 2020 14:40
-
-
Save andirady/bd64e30f3da3f02e1ba84d1b029b2549 to your computer and use it in GitHub Desktop.
Use ant+ivy to build java project without having to perform dependency resolution on every compilation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project name="test" xmlns:ivy="antlib:org.apache.ivy.ant"> | |
<property name="src.dir" value="src/main/java" /> | |
<property name="build.dir" value="build" /> | |
<property name="classes.dir" value="build/main/classes" /> | |
<target name="resolve"> | |
<ivy:cachepath pathid="lib.path.id" /> | |
<echo file="classpath.properties">compile.classpath=${toString:lib.path.id}</echo> | |
</target> | |
<target name="compileJava"> | |
<property file="classpath.properties" /> | |
<mkdir dir="${classes.dir}"/> | |
<javac srcdir="${src.dir}" destdir="${classes.dir}" classpath="${compile.classpath}"/> | |
</target> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment