forked from unclebob/fitnesse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
181 lines (157 loc) · 7.04 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<project name="Fitnesse" default="all" basedir=".">
<description>
Fitnesse is a wiki wrapper for fit, an acceptance test framework.
</description>
<property environment="env" />
<property name="env.FITNESSE_TEST_PORT" value="8080" />
<property name="src" location="src" />
<property name="src2" location="srcFitServerTests" />
<property name="classes" location="classes" />
<property name="fitnesseRoot" value="FitNesseRoot" />
<property name="fitnesseRootZip" value="FitNesseRoot.zip" />
<property name="zipDir" location="dist/fitnesse" />
<property name="results.dir" location="test-results" />
<path id="classpath">
<pathelement path="classes" />
<fileset dir="lib">
<include name="*.jar" />
<exclude name="dummy.jar" />
</fileset>
</path>
<target name="all" depends="unit_tests" description="Run this target any time you change code or acceptance tests. It will clean, then compile the source, run all the unit test and fitnesse acceptance tests." />
<target name="build" depends="clean, compile" description="clean, then compile the source" />
<target name="unit_tests" depends="clean, unit_test" description="builds code from scratch, runs all the unit tests" />
<target name="jar" depends="build, createUpdateLists" description="generate the jar file">
<mkdir dir="dist" />
<delete file="dist/fitnesse.jar" />
<jar jarfile="dist/fitnesse.jar" basedir="classes">
<include name="**/*.class" />
<exclude name="**/*Test.class" />
<exclude name="**/*TestSuite.class" />
<include name="Resources/**" />
<include name="tasks.properties" />
<fileset dir="classes" includes="**/SystemUnderTest.class,**/MySystemUnderTest.class" />
<zipfileset src="lib/htmlparser.jar" />
<zipfileset src="lib/json.jar" />
<zipfileset src="lib/velocity-1.6.2-dep.jar" />
<manifest>
<attribute name="Built-By" value="Object Mentor, Inc." />
<attribute name="Main-Class" value="fitnesseMain.FitNesseMain" />
</manifest>
</jar>
<delete dir="classes/Resources" />
</target>
<target name="createUpdateLists" depends="copyResources" description="creates two lists of files to be udpated">
<java classpath="classes" classname="fitnesse.updates.UpdateFileList" failonerror="true">
<arg value="-baseDirectory:classes/Resources" />
<arg value="-doNotReplace:FitNesseRoot/files/css/fitnesse.css" />
<arg value="-doNotReplace:FitNesseRoot/files/css/fitnesse_print.css" />
<arg value="-doNotReplace:FitNesseRoot/FrontPage/content.txt" />
<arg value="-doNotReplace:FitNesseRoot/FrontPage/properties.xml" />
<arg value="FitNesseRoot/files/images" />
<arg value="FitNesseRoot/files/css" />
<arg value="FitNesseRoot/files/javascript" />
<arg value="FitNesseRoot/files/html" />
<arg value="FitNesseRoot/files/templates" />
<arg value="FitNesseRoot/FitNesse" />
<arg value="FitNesseRoot/FrontPage" />
<arg value="FitNesseRoot/PageFooter" />
<arg value="FitNesseRoot/PageHeader" />
</java>
<copy todir="classes/Resources">
<fileset dir=".">
<include name="updateList" />
<include name="updateDoNotCopyOverList" />
</fileset>
</copy>
</target>
<target name="copyResources" description="copy images, css, and other resources into the classes directory">
<delete dir="classes/Resources" />
<mkdir dir="classes/Resources" />
<copy todir="classes/Resources/FitNesseRoot/files">
<fileset dir="FitNesseRoot/files">
<include name="images/**" />
<include name="css/*.css" />
<include name="javascript/**/*.js" />
<include name="html/**" />
<include name="templates/**" />
<exclude name="juUnitTestLink.js" />
<exclude name="**/unused/**" />
</fileset>
</copy>
<copy todir="classes/Resources/FitNesseRoot">
<fileset dir="FitNesseRoot">
<include name="FitNesse/**" />
<include name="FrontPage/**" />
<include name="PageHeader/**" />
<include name="PageFooter/**" />
<exclude name="**/*.zip" />
</fileset>
</copy>
</target>
<target name="compile" depends="init, stamp-version" description="compile the source (make)">
<javac srcdir="src" destdir="classes" classpathref="classpath" debug="true" source="1.6" target="1.6" />
<copy file="extra/ant/tasks.properties" todir="classes" />
</target>
<target name="stamp-version">
<delete file="pom.xml" />
<delete file="src/fitnesse/FitNesseVersion.java" />
<delete file="FitNesseRoot/FrontPage/content.txt" />
<tstamp />
<filter token="version" value="${DSTAMP}" />
<copy filtering="true" file="templates/pom.xml.template" tofile="pom.xml" />
<copy filtering="true" file="templates/FitNesseVersion.java.template" tofile="src/fitnesse/FitNesseVersion.java" />
<copy filtering="true" file="templates/FrontPage.content.txt.template" tofile="FitNesseRoot/FrontPage/content.txt" />
</target>
<target name="clean" description="delete everything in the classes directory">
<delete dir="classes" />
<mkdir dir="classes" />
<delete dir="test-results" />
</target>
<target name="unit_test" depends="compile" description="run the unit tests">
<junit forkmode="once" fork="yes" printsummary="no" 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" />
<exclude name="**/ShutdownResponderTest.java" />
<exclude name="**/QueryTableBaseTest.java" />
<exclude name="**/Test.java" />
<exclude name="**/SystemUnderTest.java" />
<exclude name="**/MySystemUnderTest.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="init">
<mkdir dir="classes" />
<mkdir dir="test-results" />
</target>
<target name="load_fitnesse_taskdef">
<taskdef classpathref="classpath" resource="tasks.properties" />
</target>
<target name="execute_fitnesse_tests" depends="load_fitnesse_taskdef" description="Executes the Fitnesse Acceptance Test Suite. This target starts fitnesse, executes the Accetpance test suite, publishes the test results and stops fitnesse">
<run-fitnesse-tests wikidirectoryrootpath="${basedir}" suitepage="FitNesse.SuiteAcceptanceTests" fitnesseport="${env.FITNESSE_TEST_PORT}" resultsdir="test-results" resultsxmlpage="fit-results.xml" classpathref="classpath" />
</target>
<target name="release" depends="unit_tests, acceptance_tests" />
<target name="release_xml" depends="unit_tests, acceptance_tests_xml" />
<target name="release_jar" depends="unit_tests, jar"/>
<target name="acceptance_tests_xml" depends="jar">
<java jar="dist/fitnesse.jar" failonerror="true" fork="true" output="fitnesse-results.xml">
<arg value="-c" />
<arg value="FitNesse.SuiteAcceptanceTests?suite&format=xml" />
<arg value="-p" />
<arg value="9234" />
</java>
</target>
<target name="acceptance_tests" depends="jar">
<java jar="dist/fitnesse.jar" failonerror="true" fork="true">
<arg value="-c" />
<arg value="FitNesse.SuiteAcceptanceTests?suite&format=text" />
<arg value="-p" />
<arg value="9234" />
</java>
</target>
</project>