-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
60 lines (52 loc) · 2.18 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<project name="AddressTagger" default="run" xmlns:ivy="antlib:org.apache.ivy.ant">
<property name="src.dir" value="src"/>
<property name="test.dir" value="test"/>
<property name="lib.dir" value="lib"/>
<property name="build.dir" value="build"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="jar.dir" value="${build.dir}/jar"/>
<property name="ivy.lib.dir" value="${build.dir}/lib"/>
<property name="ivy.jar.file" value="${lib.dir}/ivy-2.3.0.jar" />
<property name="main-class" value="com.grunick.addresstagger.AddressTaggerRunner"/>
<target name="clean" >
<delete dir="${build.dir}"/>
</target>
<target name="compile" depends="clean,resolve">
<mkdir dir="${classes.dir}"/>
<javac includeantruntime="true" srcdir="${src.dir}" destdir="${classes.dir}">
<classpath refid="project.class.path"/>
</javac>
</target>
<target name="resolve">
<mkdir dir="${ivy.lib.dir}"/>
<path id="ivy.lib.path">
<pathelement location="${ivy.jar.file}"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
<ivy:retrieve pattern="${ivy.lib.dir}/[artifact]-[type]-[revision].[ext]" type="jar"/>
</target>
<target name="jar" depends="compile">
<mkdir dir="${jar.dir}"/>
<jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}">
<zipgroupfileset dir="${lib.dir}" includes="*.jar"/>
<zipgroupfileset dir="${ivy.lib.dir}" includes="*.jar"/>
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
</jar>
</target>
<path id="project.class.path">
<fileset dir="${ivy.lib.dir}">
<include name="**/*.jar" />
</fileset>
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
</fileset>
<pathelement location="${classes.dir}"/>
</path>
<target name="run" depends="compile">
<java classname="${main-class}">
<classpath refid="project.class.path" />
</java>
</target>
</project>