-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
97 lines (81 loc) · 3.2 KB
/
Copy pathbuild.xml
File metadata and controls
97 lines (81 loc) · 3.2 KB
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
<?xml version="1.0" encoding="UTF-8"?>
<project name="${project.name}" default="dist" basedir=".">
<description>
build file
</description>
<property file="build.properties" />
<property name="src" location="src/main/java" />
<property name="lib" location="src/main/resources" />
<property name="build" location="target/main/classes" />
<property name="dist" location="target" />
<property name="src.test" location="src/test/java" />
<property name="lib.test" location="src/test/resources" />
<property name="build.test" location="target/test/classes" />
<property name="report.test" location="target/test/report" />
<path id="classpath.compile">
<fileset dir="${lib}">
<include name="**/*.jar" />
</fileset>
</path>
<path id="classpath.runtime">
<path refid="classpath.compile" />
<pathelement location="${build}" />
</path>
<path id="classpath.testing">
<path refid="classpath.runtime" />
<fileset dir="${lib.test}">
<include name="**/*.jar" />
</fileset>
<pathelement location="${build.test}" />
</path>
<target name="init">
<tstamp />
</target>
<target name="compile" depends="init" description="compile the source">
<mkdir dir="${build}" />
<javac srcdir="${src}" destdir="${build}" classpathref="classpath.compile" includeantruntime="yes">
<compilerarg value="-Xlint" />
<compilerarg value="-XDignore.symbol.file" />
</javac>
</target>
<target name="dist" depends="compile" description="generate the distribution">
<mkdir dir="${dist}" />
<jar jarfile="${dist}/${project.name}-${DSTAMP}.jar" basedir="${build}">
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="${main.class}" />
</manifest>
</jar>
</target>
<target name="clean" description="clean up">
<delete dir="${dist}" />
</target>
<target name="run" depends="compile" description="run application">
<java fork="true" classname="${main.class}" classpathref="classpath.runtime" />
</target>
<target name="compile-tests" depends="compile" description="compile unit tests">
<mkdir dir="${build.test}" />
<javac srcdir="${src.test}" destdir="${build.test}" classpathref="classpath.testing" includeantruntime="yes" />
</target>
<target name="junit" depends="compile-tests" description="run unit tests">
<mkdir dir="${report.test}" />
<junit printsummary="yes" haltonfailure="yes" showoutput="yes">
<classpath>
<path refid="classpath.testing" />
</classpath>
<formatter type="xml" />
<batchtest fork="yes" todir="${report.test}">
<fileset dir="${src.test}" includes="**/*Test.java" />
</batchtest>
</junit>
</target>
<target name="junitreport" depends="junit" description="generate unit test reports">
<junitreport todir="${report.test}">
<fileset dir="${report.test}" includes="Test-*.xml" />
<report todir="${report.test}" />
</junitreport>
</target>
<target name="antstructure" description="generate incomplete dtd">
<antstructure output="project.dtd" />
</target>
</project>