forked from woodybrood/fitnessedotorg
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.xml
100 lines (87 loc) · 2.93 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
<project name="Fitnesse" default="all" basedir="."
xmlns:ivy="antlib:org.apache.ivy.ant">
<!--
Push to <user>@fitnesse.org/fitnessedotorg.git. That's all.
-->
<property environment="env" />
<property name="env.FITNESSE_PORT" value="8080" />
<property name="background" value="true" />
<property name="main.class" value="fitnesseMain.FitNesseMain" />
<target name="run" depends="unit_test" description="Start FitNesse.org site">
<java classpathref="classpath" classname="${main.class}" fork="true" spawn="${background}">
<arg value="-p" />
<arg value="${env.FITNESSE_PORT}" />
</java>
</target>
<target name="shutdown" depends="ps" if="pid" description="Stop server">
<echo message="Killing ${main.class} on PID ${pid}" />
<exec executable="kill" osfamily="unix">
<arg value="${pid}" />
</exec>
</target>
<target name="ps">
<exec executable="jps">
<arg value="-l"/>
<redirector outputproperty="pid">
<outputfilterchain>
<linecontains>
<contains value="${main.class}"/>
</linecontains>
<replacestring from=" ${main.class}"/>
</outputfilterchain>
</redirector>
</exec>
</target>
<target name="compile" depends="resolve">
<mkdir dir="classes" />
<javac srcdir="src" destdir="classes" classpathref="classpath" debug="true" source="1.8" target="1.8" includeantruntime="false" />
</target>
<target name="unit_test" depends="compile" description="run the unit tests">
<mkdir dir="test-results" />
<junit forkmode="once" fork="yes" printsummary="yes" haltonfailure="yes" haltonerror="yes" dir="${basedir}">
<classpath refid="classpath" />
<formatter type="xml" usefile="true" />
<formatter type="plain" usefile="false" />
<batchtest todir="test-results">
<fileset dir="src">
<include name="**/*Test.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="clean">
<delete dir="classes" />
</target>
<target name="resolve" depends="ivy-init">
<ivy:resolve />
<ivy:cachepath pathid="lib.classpath" />
<path id="classpath">
<pathelement path="classes" />
<path refid="lib.classpath" />
</path>
</target>
<!--
Dependency management boilerplate
-->
<property name="maven.central.url" value="https://repo1.maven.org/maven2" />
<available file="antlib/ivy.jar" type="file" property="have.ivy.jar"/>
<condition property="ivy.download.not.required">
<and>
<istrue value="${have.ivy.jar}" />
</and>
</condition>
<target name="ivy-init" depends="ivy-download">
<path id="ivy.class.path">
<fileset dir="antlib">
<include name="*.jar"/>
</fileset>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant"
classpathref="ivy.class.path" />
</target>
<target name="ivy-download" unless="ivy.download.not.required">
<mkdir dir="antlib" />
<get src="${maven.central.url}/org/apache/ivy/ivy/2.5.0/ivy-2.5.0.jar" dest="antlib/ivy.jar" usetimestamp="true" verbose="true" />
</target>
</project>