forked from RestExpress/Syntaxe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
126 lines (111 loc) · 4.28 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
116
117
118
119
120
121
122
123
124
125
126
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="build-all" name="Syntaxe">
<property environment="env"/>
<property file="build.properties"/>
<property name="dir.src.java" value="${basedir}/src/java"/>
<property name="dir.src.test" value="${basedir}/test/java"/>
<property name="dir.build" value="${basedir}/out"/>
<property name="dir.compile" value="${dir.build}/classes/main"/>
<property name="dir.compile.test" value="${dir.build}/classes/test"/>
<property name="dir.lib" value="${basedir}/lib"/>
<property name="dir.dist" value="${basedir}/dist"/>
<property name="dir.test.results" value="${dir.build}/junit"/>
<property name="dir.test.report" value="${dir.test.results}/report"/>
<path id="compile.classpath">
<pathelement location="${dir.compile}"/>
<fileset dir="${dir.lib}">
<include name="**/*.jar"/>
</fileset>
</path>
<path id="runtime.classpath">
<pathelement location="${dir.compile}"/>
<fileset dir="${dir.lib}">
<include name="**/*.jar"/>
<exclude name="**/sources/*"/>
</fileset>
</path>
<path id="unit_test.classpath">
<path refid="runtime.classpath"/>
<pathelement location="${dir.compile.test}"/>
</path>
<target name="_init">
<mkdir dir="${dir.compile}"/>
<mkdir dir="${dir.compile.test}"/>
<mkdir dir="${dir.dist}"/>
</target>
<target name="clean">
<delete dir="${dir.build}"/>
<delete dir="${dir.dist}"/>
</target>
<!-- ======================================================================
target: compile
====================================================================== -->
<target name="compile" depends="_init">
<javac destdir="${dir.compile}"
failonerror="yes"
fork="yes"
source="${javac.source}"
debug="${javac.debug}">
<classpath>
<path refid="compile.classpath"/>
</classpath>
<src>
<pathelement location="${dir.src.java}"/>
</src>
</javac>
<javac destdir="${dir.compile.test}"
failonerror="yes"
fork="yes"
source="${javac.source}"
debug="${javac.debug}">
<classpath>
<path refid="compile.classpath"/>
</classpath>
<src>
<pathelement location="${dir.src.test}"/>
</src>
</javac>
</target>
<!-- ======================================================================
target: build
====================================================================== -->
<target name="build" depends="compile, unit-test"/>
<!-- ======================================================================
target: build-all
====================================================================== -->
<target name="build-all" depends="clean, compile, unit-test"/>
<!-- ======================================================================
target: unit-test
====================================================================== -->
<target name="unit-test" depends="_init, compile" description="--> Execute Syntaxe unit tests">
<delete dir="${dir.test.results}"/>
<mkdir dir="${dir.test.results}"/>
<junit printsummary="true">
<classpath refid="unit_test.classpath"/>
<formatter type="xml" usefile="true"/>
<batchtest errorproperty="test.failure" failureproperty="test.failure" fork="yes" todir="${dir.test.results}">
<fileset dir="${dir.src.test}">
<include name="**/*Test.java"/>
<include name="**/*TestCase.java"/>
</fileset>
</batchtest>
</junit>
<mkdir dir="${dir.test.report}"/>
<junitreport todir="${dir.test.report}">
<report format="frames" todir="${dir.test.report}"/>
<fileset dir="${dir.test.results}"/>
</junitreport>
<fail if="test.failure" message="Unit-Tests failed."/>
</target>
<!-- ======================================================================
target: release
====================================================================== -->
<target name="release" depends="_init, compile" description="Release a distro">
<jar destfile="${dir.dist}/${ant.project.name}-${version}.jar">
<fileset dir="${dir.compile}"/>
</jar>
<jar destfile="${dir.dist}/${ant.project.name}-${version}-src.jar">
<fileset dir="${dir.src.java}"/>
</jar>
</target>
</project>