-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.xml
236 lines (203 loc) · 10.9 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<project name="FitNesse-Cucumber Test system" default="all" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<description>
Execute Cucumber tests from FitNesse.
</description>
<property file="${user.home}/.sonatype.properties"/>
<property file="version.info"/>
<property environment="env"/>
<property name="src.dir" location="src"/>
<property name="test.src.dir" location="test"/>
<property name="steps.src.dir" location="stepsrc"/>
<property name="classes.dir" location="classes"/>
<property name="test.classes.dir" location="test-classes"/>
<property name="steps.classes.dir" location="steps-classes"/>
<property name="fitnesseRoot" value="FitNesseRoot"/>
<property name="results.dir" location="test-results"/>
<property name="dist.dir" location="dist"/>
<property name="javadoc.dir" location="javadoc"/>
<property name="lib.dir" location="lib"/>
<property name="antlib.dir" location="antlib"/>
<property name="port" value="8002"/>
<target name="all" depends="test" description=""/>
<target name="build" depends="clean, compile" description="clean, then compile the source"/>
<target name="run" depends="test-compile, classpath-page" description="Start FitNesse from the command line">
<java classpathref="classpath" classname="fitnesseMain.FitNesseMain" fork="true" failonerror="true">
<arg value="-v" />
<arg value="-p" />
<arg value="${port}" />
</java>
</target>
<target name="classpath-page" depends="steps-compile" description="Create classpath file">
<pathconvert pathsep="${line.separator}" property="pageContent" refid="fitnesse.classpath">
<map from="" to="!path "/>
</pathconvert>
<mkdir dir="FitNesseRoot/CucumberClassPath" />
<echo file="FitNesseRoot/CucumberClassPath/content.txt">Generated classpath for Cucumber tests:${line.separator}${line.separator}${pageContent}</echo>
</target>
<target name="retrieve" depends="resolve" description="Copy dependencies to lib/, mainly for Acceptance tests and IDE's">
<ivy:retrieve pattern="${lib.dir}/[artifact].[ext]" type="jar" conf="default,test" />
</target>
<target name="dependencies" depends="resolve" description="Generate a dependencies graph">
<ivy:report conf="*" todir="dependencies" />
</target>
<!--
Bundling
-->
<target name="jar" depends="compile" description="generate the jar file">
<mkdir dir="${dist.dir}" />
<delete file="${dist.dir}/fitnesse-cucumber.jar" />
<jar jarfile="${dist.dir}/fitnesse-cucumber.jar" basedir="${classes.dir}">
<include name="**" />
<service type="fitnesse.plugins.PluginFeatureFactory"
provider="org.fitnesse.cucumber.Plugin"/>
</jar>
</target>
<target name="standalone-jar" depends="jar" description="generate the standalone jar file">
<ivy:cachefileset setid="standalone.jar.fileset" conf="standalone" />
<!-- Create a temporary file, so we can remove all META-INF stuff when packaging the real thing -->
<zip destfile="${dist.dir}/.standalone-jar-dependencies.tmp">
<zipgroupfileset refid="standalone.jar.fileset" />
</zip>
<jar destfile="${dist.dir}/fitnesse-cucumber-standalone.jar">
<zipfileset src="${dist.dir}/fitnesse-cucumber.jar" />
<zipfileset src="${dist.dir}/.standalone-jar-dependencies.tmp" excludes="META-INF/**" />
</jar>
<delete file="${dist.dir}/.standalone-jar-dependencies.tmp" />
</target>
<target name="sources-jar">
<jar jarfile="${dist.dir}/fitnesse-cucumber-sources.jar" basedir="src">
<include name="**" />
</jar>
</target>
<target name="javadoc-jar" depends="compile">
<mkdir dir="${javadoc.dir}" />
<javadoc sourcepath="${src.dir}" destdir="${javadoc.dir}" classpathref="classpath" />
<jar jarfile="${dist.dir}/fitnesse-cucumber-javadoc.jar" basedir="${javadoc.dir}" />
</target>
<target name="compile" depends="resolve" description="compile the source (make)">
<mkdir dir="${classes.dir}" />
<javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="classpath" debug="true" source="1.7" target="1.7" includeantruntime="false" />
</target>
<target name="steps-compile" depends="compile" description="compile the source (make)">
<mkdir dir="${steps.classes.dir}" />
<javac srcdir="${steps.src.dir}" destdir="${steps.classes.dir}" classpathref="classpath" debug="true" source="1.7" target="1.7" includeantruntime="false" />
</target>
<target name="test-compile" depends="compile,steps-compile" description="compile the source (make)">
<mkdir dir="${test.classes.dir}" />
<javac srcdir="${test.src.dir}" destdir="${test.classes.dir}" classpathref="test.classpath" debug="true" source="1.7" target="1.7" includeantruntime="false" />
</target>
<target name="clean" description="delete everything in the classes directory">
<delete dir="${classes.dir}" />
<delete dir="${test.classes.dir}" />
<delete dir="${steps.classes.dir}" />
<delete dir="${results.dir}" />
<delete dir="${dist.dir}" />
<delete dir="${javadoc.dir}" />
</target>
<target name="test" depends="test-compile" description="run the unit tests">
<mkdir dir="${results.dir}" />
<junit forkmode="once" fork="yes" printsummary="no" haltonfailure="yes" haltonerror="yes" dir="${basedir}">
<classpath refid="test.classpath" />
<formatter type="xml" usefile="true" />
<formatter type="plain" usefile="false" />
<batchtest todir="${results.dir}">
<fileset dir="${test.src.dir}">
<include name="**/*Test.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="release" depends="clean, test, pom" />
<target name="resolve" depends="ivy-init">
<ivy:resolve />
<ivy:cachepath pathid="default.lib.classpath" conf="default"/>
<ivy:cachepath pathid="test.lib.classpath" conf="default,test" />
<path id="classpath">
<pathelement path="${classes.dir}" />
<path refid="default.lib.classpath" />
</path>
<path id="test.classpath">
<pathelement path="${classes.dir}" />
<pathelement path="${steps.classes.dir}" />
<pathelement path="${test.classes.dir}" />
<path refid="test.lib.classpath" />
</path>
<path id="fitnesse.classpath">
<pathelement path="${steps.classes.dir}" />
</path>
</target>
<target name="pom" depends="resolve">
<ivy:deliver deliverpattern="${dist.dir}/ivy.xml" pubrevision="${version}" status="release" />
<ivy:makepom ivyfile="${dist.dir}/ivy.xml" templatefile="pom.xml.template" pomfile="${dist.dir}/fitnesse-cucumber.pom" conf="standalone,default,test">
<mapping conf="standalone" scope="compile" />
<mapping conf="test" scope="test" />
</ivy:makepom>
</target>
<target name="snapshot-pom" depends="resolve">
<ivy:deliver deliverpattern="${dist.dir}/ivy.xml" pubrevision="${version}-SNAPSHOT" status="release" />
<ivy:makepom ivyfile="${dist.dir}/ivy.xml" templatefile="pom.xml.template" pomfile="${dist.dir}/fitnesse-cucumber.pom" conf="standalone,default,test">
<mapping conf="standalone" scope="compile" />
<mapping conf="test" scope="test" />
</ivy:makepom>
</target>
<target name="snapshot" depends="snapshot-pom,jar,standalone-jar,sources-jar,javadoc-jar" description="Publish a snapshot to oss.sonatype.org">
<fail unless="upload.user" message="supply upload.user on the command line"/>
<fail unless="upload.password" message="supply upload.password on the command line"/>
<fail unless="pgp.password" message="supply pgp.password on the command line"/>
<ivy:settings id="ivy.publish.instance"
file="ivysettings-sonatype.xml" />
<ivy:publish resolver="sonatype-nexus-snapshots"
settingsref="ivy.publish.instance"
pubrevision="${version}-SNAPSHOT"
publishivy="false"
overwrite="true" conf="default">
<ivy:artifacts pattern="${dist.dir}/[artifact](-[classifier]).[ext]" />
</ivy:publish>
</target>
<target name="publish" depends="pom,jar,standalone-jar,sources-jar,javadoc-jar" description="Publish a release to oss.sonatype.org">
<fail unless="upload.user" message="supply upload.user on the command line"/>
<fail unless="upload.password" message="supply upload.password on the command line"/>
<fail unless="pgp.password" message="supply pgp.password on the command line"/>
<ivy:settings id="ivy.publish.instance"
file="ivysettings-sonatype.xml" />
<ivy:publish resolver="sonatype-nexus-staging"
settingsref="ivy.publish.instance"
pubrevision="${version}"
publishivy="false"
overwrite="true" conf="default">
<ivy:artifacts pattern="${dist.dir}/[artifact](-[classifier]).[ext]" />
</ivy:publish>
</target>
<!--
Dependency management boilerplate
-->
<property name="maven.central.url" value="http://repo2.maven.org/maven2" />
<available file="${antlib.dir}/ivy.jar" type="file" property="have.ivy.jar"/>
<available file="${antlib.dir}/bcprov.jar" type="file" property="have.bcprov.jar"/>
<available file="${antlib.dir}/bcpg.jar" type="file" property="have.bcpg.jar"/>
<condition property="ivy.download.not.required">
<and>
<istrue value="${have.ivy.jar}" />
<istrue value="${have.bcprov.jar}" />
<istrue value="${have.bcpg.jar}" />
</and>
</condition>
<target name="ivy-init" depends="ivy-download">
<path id="ivy.class.path">
<fileset dir="${antlib.dir}">
<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.dir}" />
<get src="${maven.central.url}/org/apache/ivy/ivy/2.3.0/ivy-2.3.0.jar" dest="${antlib.dir}/ivy.jar" usetimestamp="true" verbose="true" />
<!-- The following libs are used for signing artifacts
when deployed to Maven Central. -->
<get src="${maven.central.url}/org/bouncycastle/bcprov-jdk16/1.46/bcprov-jdk16-1.46.jar" dest="${antlib.dir}/bcprov.jar" usetimestamp="true" verbose="true" />
<get src="${maven.central.url}/org/bouncycastle/bcpg-jdk16/1.46/bcpg-jdk16-1.46.jar" dest="${antlib.dir}/bcpg.jar" usetimestamp="true" verbose="true" />
</target>
</project>