-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
72 lines (59 loc) · 2.72 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
61
62
63
64
65
66
67
68
69
70
71
72
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="osm-watch" default="war">
<property name="ivy.install.version" value="2.0.0-beta1"/>
<property name="ivy.jar.dir" value="${basedir}/ivy"/>
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar"/>
<property name="build.dir" value="build"/>
<property name="lib.dir" value="lib"/>
<property name="clib.dir" value="lib/core"/>
<property name="dist.dir" value="dist"/>
<property name="src.dir" value="src/main/java"/>
<property name="build.war.tmp" value="build/war-tmp"/>
<property name="war.file" value="osm-watch.war" />
<property name="jar.file" value="osm-watch-standalone.jar" />
<target name="download-ivy" unless="skip.download">
<mkdir dir="${ivy.jar.dir}"/>
<echo message="installing ivy..."/>
<get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" dest="${ivy.jar.file}" usetimestamp="true"/>
</target>
<target name="install-ivy" depends="download-ivy" description="--> install ivy">
<path id="ivy.lib.path">
<fileset dir="${ivy.jar.dir}" includes="*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
</target>
<target name="resolve" depends="install-ivy" description="--> retrieve dependencies with ivy">
<ivy:retrieve pattern="${lib.dir}/[conf]/[artifact]-[revision].[ext]" />
</target>
<path id="lib.path.id">
<fileset dir="${clib.dir}" />
</path>
<target name="compile" depends="resolve">
<mkdir dir="${build.dir}/classes" />
<javac srcdir="${src.dir}" destdir="${build.dir}/classes" classpathref="lib.path.id" debug="true" />
</target>
<target name="war" depends="compile">
<delete dir="${build.war.tmp}" />
<mkdir dir="${build.war.tmp}" />
<copy todir="${build.war.tmp}">
<fileset dir="src/main/webapp" />
</copy>
<mkdir dir="${build.war.tmp}/WEB-INF/lib" />
<copy todir="${build.war.tmp}/WEB-INF/lib">
<fileset dir="${clib.dir}" />
</copy>
<copy todir="${build.war.tmp}/WEB-INF/classes">
<fileset dir="${build.dir}/classes" />
</copy>
<copy todir="${build.war.tmp}/WEB-INF/classes/META-INF">
<fileset dir="src/main/java/META-INF" />
</copy>
<copy todir="${build.war.tmp}/WEB-INF/classes">
<fileset file="src/main/java/log4j.properties" />
</copy>
<mkdir dir="${dist.dir}" />
<war destfile="${dist.dir}/${war.file}" basedir="${build.war.tmp}" />
</target>
<!-- Big jar with everything -->
<target name="jar" depends="war">
</target>
</project>