-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
220 lines (174 loc) · 9.84 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
<?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 support-qaf@infostretch.com
-->
<project basedir="." default="build" 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="meta.dir" value="${basedir}/META-INF" />
<property name="debuglevel" value="source,lines,vars" />
<property name="target" value="1.6" />
<property name="source" value="1.6" />
<property file="build.properties" />
<path id="build.classpath">
<fileset dir="${lib.dir}">
<include name="*.jar" />
<include name="**/*.jar" />
</fileset>
</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>
</target>
<target name="init" depends="resolve">
<mkdir dir="${bin.dir}" />
<mkdir dir="${dist.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 depends="init" name="compile">
<echo level="info">--- compile (start) ---</echo>
<!--
<taskdef classpathref="build.classpath" resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties" />
<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>
-->
<javac source="${source}" target="${target}" verbose="true" srcdir="${src.dir}" destdir="${bin.dir}" debug="false" classpathref="build.classpath">
</javac>
<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="package compiled class into jar">
<mkdir dir="${dist.dir}" />
<jar destfile="${dist.dir}/qaf-perfecto-support.jar" basedir="${bin.dir}">
<metainf dir="." includes="LICENSE.txt" />
<metainf dir="." includes="${dist.dir}/pom.xml,${dist.dir}/pom.properties" />
<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>
<service type="org.testng.ITestNGListener">
<provider classname="com.qmetry.qaf.automation.support.perfecto.PerfectoReportiumConnector" />
</service>
</jar>
</target>
<target name="gendoc" depends="init" description="generate documentation">
<delete dir="${dist.dir}/docs" />
<mkdir dir="${dist.dir}/docs" />
<javadoc sourcepath="${src.dir}" destdir="${dist.dir}/docs" />
<jar compress="true" destfile="${dist.dir}/qaf-perfecto-support-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-perfecto-support-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="publish2" depends="build">
<!-- 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-perfecto-support.pom" />
<!-- 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-perfecto-support" pattern="${dist.dir}/[artifact].[ext]" ext="pom" type="pom" />
<artifact name="qaf-perfecto-support-sources" pattern="${dist.dir}/[artifact].[ext]" ext="jar" type="source" />
<artifact name="qaf-perfecto-support-javadoc" pattern="${dist.dir}/[artifact].[ext]" ext="zip" type="javadoc" />
</ivy:publish>
</target>
<target name="publish" depends="build">
<!-- 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-perfecto-support.pom">
<mapping conf="*,default" scope="compile" />
</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-perfecto-support" pattern="${dist.dir}/[artifact].[ext]" ext="pom" type="pom" version="${release.num}" />
<artifact name="qaf-perfecto-support-sources" pattern="${dist.dir}/[artifact].[ext]" ext="jar" classifier="sources" type="sources" version="${release.num}" />
<artifact name="qaf-perfecto-support-javadoc" pattern="${dist.dir}/[artifact].[ext]" ext="jar" classifier="javadoc" type="javadoc" version="${release.num}" />
</ivy:publish>
</target>
</project>