-
Notifications
You must be signed in to change notification settings - Fork 243
/
build.xml
115 lines (103 loc) · 4.09 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<project name="agiletickets" default="war" xmlns:ivy="antlib:org.apache.ivy.ant">
<property file="build.properties" />
<!-- paths -->
<path id="lib.path.id">
<fileset dir="${lib.dir}" />
<fileset dir="lib/provided" />
</path>
<path id="test.path.id">
<fileset dir="lib/test" />
<path refid="lib.path.id" />
<pathelement location="${test.build.dir}" />
<pathelement location="${build.dir}" />
</path>
<!-- =================================
target: resolve
================================= -->
<target name="resolve" description="--> retrieve dependencies with ivy">
<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" />
<delete dir="${ivy.lib.dir}" includes="**/*.*" excludes="local/*.*" />
<ivy:retrieve pattern="${ivy.lib.dir}/[conf]/[artifact]-[revision](-[classifier]).[ext]" log="quiet" />
<mkdir dir="${lib.dir}" />
<delete dir="${lib.dir}" includes="**/*.*" />
<copy todir="${lib.dir}" flatten="true">
<fileset dir="${ivy.lib.dir}">
<include name="default/*.jar" />
<include name="local/*.jar" />
</fileset>
</copy>
</target>
<!-- =================================
target: compile
================================= -->
<target name="compile" depends="resolve" description="--> compile">
<mkdir dir="${build.dir}" />
<delete dir="${build.dir}" includes="**/*.*" />
<javac srcdir="${src.dir}" destdir="${build.dir}" classpathref="lib.path.id" debug="on" />
<copy todir="${build.dir}">
<fileset dir="${resources.dir}">
<include name="**/*.*" />
</fileset>
</copy>
</target>
<!-- =================================
target: compile test
================================= -->
<target name="compile-test" depends="compile" description="--> compile test">
<mkdir dir="${test.build.dir}" />
<delete dir="${test.build.dir}" includes="**/*.*" />
<javac srcdir="${test.src.dir}" destdir="${test.build.dir}" classpathref="test.path.id" debug="on" />
<copy todir="${test.build.dir}">
<fileset dir="${test.resources.dir}">
<include name="**/*.*" />
</fileset>
</copy>
</target>
<!-- =================================
target: run tests
================================= -->
<target name="test" depends="compile-test" description="--> run all tests">
<mkdir dir="${output.dir}/test-results" />
<junit haltonfailure="yes">
<batchtest fork="yes" todir="${output.dir}/test-results">
<fileset dir="${test.src.dir}">
<include name="**/*Test.java"/>
<exclude name="**/EstabelecimentoTest.java"/>
</fileset>
</batchtest>
<formatter type="brief" usefile="false" />
<formatter type="xml" />
<classpath refid="test.path.id" />
</junit>
</target>
<!-- =================================
target: war
================================= -->
<target name="war" description="--> generate war file" depends="test">
<war destfile="${output.dir}/${project.name}.war">
<zipfileset dir="${webapp.dir}" />
</war>
</target>
<!-- =================================
target: jetty.run
================================= -->
<target name="jetty.run" description="--> run jetty server" depends="compile">
<path id="jetty.path.id">
<fileset dir="lib/jetty" />
</path>
<taskdef classpathref="jetty.path.id" resource="tasks.properties" loaderref="jetty.loader" />
<jetty tempDirectory="${output.dir}/jetty-temp">
<webApp name="${project.name}" warfile="${webapp.dir}" contextpath="/" scanIntervalSeconds="3" />
</jetty>
</target>
<!-- =================================
target: report
================================= -->
<target name="report" depends="resolve" description="--> generates a report of dependencies">
<mkdir dir="${output.dir}/reports" />
<ivy:report todir="${output.dir}/reports" />
</target>
</project>