-
Notifications
You must be signed in to change notification settings - Fork 23
/
build.xml
98 lines (85 loc) · 3.59 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
<project name="build" default="compile">
<description>
The basic build file for the GrammarViz system. I have collected tasks from other files in here because
Travis CI runs only "ant test"
</description>
<!-- Always make environment variables available with the "env." prefix. -->
<property environment="env" />
<!-- Make sure we're running a Java 7 or better. -->
<condition property="java.7.available">
<or>
<contains string="${java.version}" substring="1.7" />
<contains string="${java.version}" substring="1.8" />
</or>
</condition>
<fail message="This package requires Java 7+." unless="java.7.available" />
<!-- Make sure we're running Ant 1.8. -->
<condition property="ant.1.8.available">
<contains string="${ant.version}" substring="1.8" />
</condition>
<condition property="ant.available" value="yes">
<isset property="ant.1.8.available" />
</condition>
<fail message="This package requires Ant 1.8." unless="ant.available" />
<!-- Basic properties for this system. -->
<property name="system.name" value="grammarviz" />
<property name="majorVersionNumber" value="2" />
<property name="minorVersionNumber" value="0" />
<tstamp>
<format property="DAYSTAMP" pattern="Mdd" />
</tstamp>
<property name="version" value="${majorVersionNumber}.${minorVersionNumber}.${DAYSTAMP}" />
<!-- Basic directory structure. -->
<property name="src.dir" location="${basedir}/src" />
<property name="lib.dir" location="${basedir}/lib" />
<property name="build.dir" location="${basedir}/build" />
<property name="junit.dir" location="${build.dir}/junit" />
<!-- The compile classpath -->
<path id="compile.classpath">
<fileset file="${lib.dir}/junit/junit-4.10.jar" />
<fileset dir="${lib.dir}/time" />
<fileset dir="${lib.dir}/logger" />
</path>
<!-- The Travis CI-specific system test, so far I have only JUnit here. -->
<target name="test" depends="junit.tool" description="Run JUnit tests.">
<fail if="junit.failed">JUnit test case(s) failed.</fail>
</target>
<!-- This is how we roll tests -->
<target name="junit.tool" depends="compile" description="Run JUnit tests.">
<mkdir dir="${junit.dir}" />
<!-- Run the tests, which are all classes whose name starts with 'Test'. -->
<!-- Note that emma is forking in its JUnit as well. -->
<junit printsummary="withOutAndErr" haltonfailure="${junit.haltonfailure}" fork="yes" failureproperty="junit.failed">
<classpath>
<pathelement location="${build.dir}/classes" />
<path refid="compile.classpath" />
</classpath>
<sysproperty key="user.dir" value="${basedir}" />
<formatter type="xml" />
<batchtest todir="${junit.dir}">
<fileset dir="${src.dir}" includes="**/Test*.java" />
</batchtest>
</junit>
</target>
<!-- The source code compilation -->
<target name="compile" description="Compiles the code.">
<!-- Now compile the code into build/classes -->
<mkdir dir="${build.dir}/classes" />
<javac srcdir="${src.dir}" destdir="${build.dir}/classes" source="1.7" target="1.7" debug="on" includeAntRuntime="no">
<classpath refid="compile.classpath" />
<compilerarg value="-Xlint:all" />
<!-- <compilerarg value="-Werror" /> -->
</javac>
</target>
<!-- Cleans-up the thing -->
<target name="clean" description="Delete build/ directory and top-level jar files.">
<delete>
<fileset dir="${basedir}" includes="*.jar" />
</delete>
<delete dir="${build.dir}" />
</target>
<!-- The windowZ specific task -->
<target name="convertLineEndings" description="Makes line endings compatible with host platform.">
<fixcrlf srcdir="${basedir}" includes="*.build.xml" />
</target>
</project>