-
Notifications
You must be signed in to change notification settings - Fork 138
/
build.xml
346 lines (289 loc) · 15.4 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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
QMetry Automation Framework provides a powerful and versatile platform to author
Automated Test Cases in Behavior Driven, Keyword Driven or Code Driven approach
Copyright 2016 Infostretch Corporation
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
You should have received a copy of the GNU General Public License along with this program in the name of LICENSE.txt in the root folder of the distribution. If not, see https://opensource.org/licenses/gpl-3.0.html
See the NOTICE.TXT file in root folder of this source files distribution
for additional information regarding copyright ownership and licenses
of other open source software / files used by QMetry Automation Framework.
For any inquiry or need additional information, please contact [email protected]
-->
<project basedir="." default="test" name="QMetryAutomationFramework" xmlns:ivy="antlib:org.apache.ivy.ant">
<!-- Sets the DSTAMP, TSTAMP, and TODAY properties in the current project -->
<tstamp>
<format property="build.timestamp" pattern="dd-MMM-yyyy HH:mm:ss" />
</tstamp>
<property name="bin.dir" value="${basedir}/bin" />
<property name="src.dir" value="${basedir}/src" />
<property name="test.dir" value="${basedir}/test" />
<property name="test.src.dir" value="${test.dir}/src" />
<property name="meta.dir" value="${basedir}/META-INF" />
<property name="debuglevel" value="source,lines,vars" />
<property name="target" value="1.7" />
<property name="source" value="1.7" />
<property file="build.properties" />
<path id="build.classpath">
<fileset dir="${lib.dir}">
<include name="*.jar" />
<include name="**/*.jar" />
</fileset>
</path>
<path id="test.classpath">
<fileset dir="${dist.dir}">
<include name="*.jar" />
<include name="**/*.jar" />
</fileset>
<path refid="build.classpath" />
</path>
<!-- IVY -->
<target name="download-ivy" unless="${skip.download}">
<mkdir dir="${ivy.jar.dir}" />
<!-- download Ivy from web site so that it can be used even without any
special installation -->
<echo message="installing ivy..." />
<get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" dest="${ivy.jar.file}" usetimestamp="true" />
</target>
<!-- ================================= target: install-ivy this target is
not necessary if you put ivy.jar in your ant lib directory if you already
have ivy in your ant lib, you can simply remove this target and the dependency
the 'go' target has on it ================================= -->
<target name="install-ivy" depends="download-ivy" description="--> install ivy">
<!-- try to load ivy here from local ivy dir, in case the user has not
already dropped it into ant's lib dir (note that the latter copy will always
take precedence). We will not fail as long as local lib dir exists (it may
be empty) and ivy is in at least one of ant's lib dir or the local lib dir. -->
<path id="ivy.lib.path">
<fileset dir="${ivy.jar.dir}" includes="*.jar" />
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path" />
</target>
<!-- ================================= target: resolve ================================= -->
<target name="resolve" description="--> retrieve dependencies with ivy" depends="install-ivy">
<ivy:resolve file="ivy.xml" />
<ivy:cachepath pathid="lib.path.id" />
<ivy:addpath topath="build.classpath">
<path refid="lib.path.id" />
</ivy:addpath>
<ivy:cachepath pathid="compile.path" conf="compile,provided" />
<ivy:cachepath pathid="test.path" conf="test,provided" />
</target>
<target name="init" depends="resolve">
<mkdir dir="${bin.dir}" />
<copy includeemptydirs="false" todir="${bin.dir}">
<fileset dir="${src.dir}">
<exclude name="**/*.java" />
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="${bin.dir}" failonerror="false" />
<delete dir="${dist.dir}" failonerror="false" />
</target>
<target name="compile" depends="init">
<taskdef classpathref="build.classpath" resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties" />
<echo level="info">--- compile (start) ---</echo>
<iajc source="${source}" target="${target}" showweaveinfo="true" verbose="true" destdir="${bin.dir}" debug="false">
<inpath location="${src.dir}">
</inpath>
<sourceroots>
<pathelement location="${src.dir}" />
</sourceroots>
<classpath refid="build.classpath">
</classpath>
</iajc>
<echo level="info">--- compile (finished) ---</echo>
</target>
<!-- ================================= target: build ================================= -->
<target name="build" depends="make-jar, gendoc,gensource" description="build framework, generate docs">
</target>
<target name="make-jar" depends="clean, compile" description="build basic version">
<mkdir dir="${dist.dir}" />
<!-- All - core + testNG + step -->
<jar destfile="${dist.dir}/qaf.jar" basedir="${bin.dir}" excludes="**/test/**,**/step/CommonStep.*" includes="**/*.*">
<metainf dir="." includes="LICENSE.txt,NOTICE.txt" />
<manifest>
<attribute name="Vendor" value="Infostretch Corp." />
<attribute name="Built-By" value="${user.name}" />
<section name="Build-Info">
<attribute name="qaf-Build-Time" value="${build.timestamp}" />
<!-- Information about the program itself -->
<attribute name="qaf-Version" value="${version-num}" />
<attribute name="qaf-Revision" value="${build-num}" />
<attribute name="qaf-Type" value="core" />
</section>
</manifest>
<metainf dir="${src.dir}" includes="**/aop.xml" />
<service type="org.testng.ITestNGListener">
<provider classname="com.qmetry.qaf.automation.testng.pro.QAFAnnotationTransformer2" />
<provider classname="com.qmetry.qaf.automation.testng.pro.QAFInvokedMethodListener2" />
<provider classname="com.qmetry.qaf.automation.testng.pro.QAFMethodInterceptor" />
<provider classname="com.qmetry.qaf.automation.testng.pro.QAFResultListener" />
<provider classname="com.qmetry.qaf.automation.testng.pro.QAFSuiteListener" />
</service>
</jar>
</target>
<target name="gendoc" depends="init" description="generate documentation">
<delete dir="${dist.dir}/docs" />
<mkdir dir="${dist.dir}/docs" />
<javadoc access="protected" sourcepath="${src.dir}" packagenames="com.qmetry.**.*" destdir="${dist.dir}/docs" verbose="true" author="true" version="true" use="true" windowtitle="QMetry Automation Framework - ${version-num}.${build-num}" overview="${basedir}/QAF-Overview.htm">
<doctitle>
<![CDATA[<h1>QMetry Automation Framework - ${version-num}.${build-num}</h1>]]>
</doctitle>
<bottom>
<![CDATA[<i>Copyright © 2000 Infostretch Corp.</i>]]>
</bottom>
<classpath refid="build.classpath" />
<tag name="todo" scope="all" description="To do:" />
<group title="qaf Properties" packages="com.qmetry.qaf.automation.keys*" />
<group title="qaf Web Driver" packages="com.qmetry.qaf.automation.ui.*" />
<group title="qaf Web Service" packages="com.qmetry.qaf.automation.ws.*" />
<group title="qaf Test-Step" packages="com.qmetry.qaf.automation.step.*" />
</javadoc>
<!--<zip destfile="${dist.dir}/qaf-javadoc.jar" basedir="${dist.dir}/docs">
</zip>-->
<jar compress="true" destfile="${dist.dir}/qaf-javadoc.jar" basedir="${dist.dir}/docs" />
<!-- <delete dir="${dist.dir}/docs">
</delete>-->
</target>
<target name="gensource" description="Generate Source" depends="init">
<jar destfile="${dist.dir}/qaf-sources.jar" basedir="${src.dir}">
<metainf dir="." includes="LICENSE" />
<manifest>
<attribute name="Vendor" value="Infostretch Corp." />
<attribute name="Built-By" value="${user.name}" />
<section name="Build-Info">
<attribute name="qaf-Build-Time" value="${build.timestamp}" />
<!-- Information about the program itself -->
<attribute name="qaf-Version" value="${version-num}" />
<attribute name="qaf-Revision" value="${build-num}" />
<attribute name="qaf-Type" value="support" />
</section>
</manifest>
</jar>
</target>
<target name="build-cucumber-report" depends="clean, compile" description="build basic version">
<mkdir dir="${dist.dir}" />
<!-- basic -->
<jar destfile="${dist.dir}/qaf-cucumber-${version-num}.${build-num}.jar" basedir="${bin.dir}" includes="**/report/**,**/cucumber/**,**/core/**, **/keys/**,**/automation/util/**">
<metainf dir="." includes="LICENSE.txt,NOTICE.txt" />
<manifest>
<attribute name="Vendor" value="Infostretch Corp." />
<attribute name="Built-By" value="${user.name}" />
<section name="Build-Info">
<attribute name="qaf-Build-Time" value="${build.timestamp}" />
<!-- Information about the program itself -->
<attribute name="qaf-Version" value="${version-num}" />
<attribute name="qaf-Revision" value="${build-num}" />
<attribute name="qaf-Type" value="cucumber-reporting-plugin" />
</section>
</manifest>
</jar>
</target>
<target name="publish" depends="init">
<!-- Determine build number from previously published revisions -->
<ivy:buildnumber resolver="local-m2-publish" organisation="${ivy.organisation}" module="${ivy.module}" revision="${release.num}" />
<!-- Resolve ivy dependencies and create a Maven POM file -->
<ivy:deliver deliverpattern="${dist.dir}/ivy.xml" pubrevision="${release.num}" status="release" />
<ivy:makepom ivyfile="${dist.dir}/ivy.xml" pomfile="${dist.dir}/qaf.pom">
<mapping conf="compile" scope="compile" />
<mapping conf="runtime" scope="runtime" />
<mapping conf="test" scope="test" />
<mapping conf="provided" scope="provided" />
</ivy:makepom>
<!-- Publish the local repo. Defaults to ~/.ivy2/local -->
<ivy:publish resolver="local-m2-publish" forcedeliver="true" publishivy="true" pubrevision="${release.num}" overwrite="true">
<artifacts pattern="${dist.dir}/[artifact].[ext]" />
<!--<artifact name="qaf-standalone" pattern="${dist.dir}/[artifact].[ext]" ext="jar" classifier="standalone" type="standalone" version="${release.num}" /> -->
<artifact name="qaf" pattern="${dist.dir}/[artifact].[ext]" ext="pom" type="pom" version="${release.num}" />
<artifact name="qaf-sources" pattern="${dist.dir}/[artifact].[ext]" ext="jar" classifier="sources" type="sources" version="${release.num}" />
<artifact name="qaf-javadoc" pattern="${dist.dir}/[artifact].[ext]" ext="jar" classifier="javadoc" type="javadoc" version="${release.num}" />
</ivy:publish>
</target>
<target name="ivy-publish-share" description="publish jar/source to maven repo mounted at ~/repo" depends="init">
<!-- Determine build number from previously published revisions -->
<ivy:buildnumber resolver="${publish.resolver}" organisation="${ivy.organisation}" module="${ivy.module}" revision="${release.num}" />
<!-- Resolve ivy dependencies and create a Maven POM file -->
<ivy:deliver deliverpattern="${dist.dir}/ivy.xml" pubrevision="${release.num}" status="${status}" />
<ivy:makepom ivyfile="${dist.dir}/ivy.xml" pomfile="${dist.dir}/${artifact.name}.pom" templatefile="pom.tmpl" >
<mapping conf="compile" scope="compile" />
<mapping conf="runtime" scope="runtime" />
<mapping conf="test" scope="test" />
<mapping conf="provided" scope="provided" />
</ivy:makepom>
<!-- Publish the local repo. Defaults to ~/.ivy2/local -->
<ivy:publish resolver="${publish.resolver}" forcedeliver="true" publishivy="false" pubrevision="${release.num}" overwrite="true" status="${status}">
<artifacts pattern="${dist.dir}/[artifact](-[classifier]).[ext]" />
<artifact name="${artifact.name}" pattern="${dist.dir}/[artifact].[ext]" ext="pom" type="pom" version="${release.num}" />
<artifact name="${artifact.name}" pattern="${dist.dir}/[artifact].[ext]" ext="jar" classifier="sources" type="sources" version="${release.num}" />
<artifact name="${artifact.name}" pattern="${dist.dir}/[artifact].[ext]" ext="jar" classifier="javadoc" type="javadoc" version="${release.num}" />
</ivy:publish>
</target>
<target name="test-compile" depends="init">
<taskdef classpathref="test.classpath" resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties" />
<echo level="info">--- test compile (start) ---</echo>
<iajc source="${source}" target="${target}" showweaveinfo="true" verbose="true" destdir="${bin.dir}" debug="false">
<inpath location="${src.dir}">
</inpath>
<sourceroots>
<pathelement location="${test.src.dir}" />
</sourceroots>
<classpath refid="test.classpath">
</classpath>
</iajc>
<echo level="info">--- test compile (finished) ---</echo>
</target>
<target name="test" depends="make-jar, test-compile">
<taskdef resource="testngtasks" classpathref="test.classpath" />
<testng classpathref="test.classpath" workingDir="${test.dir}" outputDir="${test.dir}/test-results" haltOnFailure="true" verbose="2">
<classpath location="${bin.dir}" />
<xmlfileset dir="${test.dir}/config" includes="testrun_config.xml" />
<sysproperty key="log4j.configuration" value="file:///${test.dir}/log4j.properties" />
<sysproperty key="outputDir" value="test-results" />
</testng>
</target>
<target name="make-standalone-jar" depends="clean, compile" description="generate stand-alone jar">
<delete dir="dependencies" failonerror="false" />
<mkdir dir="dependencies" />
<!-- external libraries classpath, we don't need sources and javadoc -->
<ivy:retrieve pattern="dependencies/[artifact](-[classifier]).jar" conf="compile" />
<!--
<path id="build.classpath">
<fileset dir="${basedir}/">
<include name="${lib.dir}/*.jar" />
<exclude name="${lib.dir}/*sources.jar" />
<exclude name="${lib.dir}/*javadoc.jar" />
</fileset>
</path>
-->
<jar destfile="${dist.dir}/qaf-standalone.jar" basedir="${bin.dir}" excludes="**/test/**,**/step/CommonStep.*" includes="**/*.*" duplicate="preserve">
<zipgroupfileset dir="${lib.dir}" includes="*.jar" excludes="*sources.jar,*javadoc.jar" />
<zipgroupfileset dir="dependencies" includes="*.jar" excludes="*sources.jar,*javadoc.jar" />
<metainf dir="." includes="LICENSE.txt,NOTICE.txt" />
<manifest>
<attribute name="Vendor" value="Infostretch Corp." />
<attribute name="Built-By" value="${user.name}" />
<section name="Build-Info">
<attribute name="qaf-Build-Time" value="${build.timestamp}" />
<!-- Information about the program itself -->
<attribute name="qaf-Version" value="${version-num}" />
<attribute name="qaf-Revision" value="${build-num}" />
<attribute name="qaf-Type" value="core" />
</section>
</manifest>
<metainf dir="${src.dir}" includes="**/aop.xml" />
<service type="org.testng.ITestNGListener">
<provider classname="com.qmetry.qaf.automation.testng.pro.QAFAnnotationTransformer2" />
<provider classname="com.qmetry.qaf.automation.testng.pro.QAFInvokedMethodListener2" />
<provider classname="com.qmetry.qaf.automation.testng.pro.QAFMethodInterceptor" />
<provider classname="com.qmetry.qaf.automation.testng.pro.QAFResultListener" />
<provider classname="com.qmetry.qaf.automation.testng.pro.QAFSuiteListener" />
</service>
</jar>
</target>
</project>