-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.xml
315 lines (272 loc) · 13.7 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
<?xml version="1.0" encoding="UTF-8"?>
<!-- ======================================================================
ANT Build Script for robotframework-magik (RFM)
Copyright 2020-2023 Luiko Czub, Smallcases Software GmbH
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
====================================================================== -->
<project name="rfm" default="make_archive">
<!-- Load env and properties-->
<dirname property="rfm.basedir" file="${ant.file.rfm}"/>
<property file="${rfm.basedir}/build.properties"/>
<target name="robot_libdoc">
<echo message="============================================="/>
<echo message="create robot keyword documentation ${library_or_resource} ..."/>
<exec executable="${PYTHON.ROBOT.CALL}" failonerror="true" dir="${rfm.basedir}">
<arg line="${PYTHON.ROBOT.LIBDOC.CALL.ARGS}"/>
<arg line="-f html -v ${RFM.VERSION} ${library_or_resource} ${keywords_file}"/>
</exec>
<echo message="done."/>
<echo message="=============================================="/>
</target>
<target name="update_keywords_doc">
<echo message="============================================="/>
<echo message="Update robotframework keyword documentations ..."/>
<antcall target="rfm.robot_libdoc">
<param name="library_or_resource" value="${DIR.RFM.RESOURCES}/robot_magik_base.robot"/>
<param name="keywords_file" value="${DIR.RFM.KEYWORDS}/robot_magik_base.html"/>
</antcall>
<antcall target="rfm.robot_libdoc">
<param name="library_or_resource" value="${DIR.RFM.RESOURCES}/robot_magik_dsview.robot"/>
<param name="keywords_file" value="${DIR.RFM.KEYWORDS}/robot_magik_dsview.html"/>
</antcall>
<antcall target="rfm.robot_libdoc">
<param name="library_or_resource" value="${DIR.RFM.RESOURCES}/robot_magik_munit.robot"/>
<param name="keywords_file" value="${DIR.RFM.KEYWORDS}/robot_magik_munit.html"/>
</antcall>
<antcall target="rfm.robot_libdoc">
<param name="library_or_resource" value="${DIR.RFM.RESOURCES}/RobotMagikLauncher.py"/>
<param name="keywords_file" value="${DIR.RFM.KEYWORDS}/RobotMagikLauncher.html"/>
</antcall>
<antcall target="rfm.robot_libdoc">
<param name="library_or_resource" value="${DIR.RFM.RESOURCES}/robot_magik_session.robot"/>
<param name="keywords_file" value="${DIR.RFM.KEYWORDS}/robot_magik_session.html"/>
</antcall>
<echo message="done."/>
<echo message="=============================================="/>
</target>
<target name="clean">
<echo message="============================================="/>
<echo message="Clean rfm from *.pyc, *$py.class ..."/>
<delete>
<fileset dir="${rfm.basedir}">
<include name="**/*.pyc"/>
<include name="**/*$py.class"/>
<exclude name=".venv/**"/>
</fileset>
</delete>
<echo message="done."/>
<echo message="=============================================="/>
</target>
<target name="deploy" depends="clean">
<echo message="============================================="/>
<echo message="Deploy rfm ..."/>
<delete dir="${DIR.DEPLOY.RFM}"/>
<copy todir="${DIR.DEPLOY.RFM}" includeEmptyDirs="false">
<fileset dir="${rfm.basedir}">
<include name="resources/**.robot"/>
<include name="resources/**.py"/>
<include name="doc/*.html"/>
<include name="tests/**"/>
<include name="resources/scripts/**"/>
<include name="resources/params/**"/>
<include name="resources/magik/*.magik"/>
<include name="examples/**"/>
<include name="README.rst"/>
<include name="LICENSE-2.0.txt"/>
<include name="CHANGES.rst"/>
<include name="requirements.txt"/>
</fileset>
</copy>
<echo message="done."/>
<echo message="=============================================="/>
</target>
<target name="make_archive" depends="deploy">
<echo message="============================================="/>
<echo message="make_archive rfm ..."/>
<delete file="${ARCHIVE.ZIP.RFM}"/>
<zip destfile="${ARCHIVE.ZIP.RFM}">
<zipfileset dir="${DIR.DEPLOY.RFM}" prefix="${ARCHIVE.PREFIX.RFM}"
includes="**"
excludes="nothing/**">
</zipfileset>
</zip>
<echo message="done."/>
<echo message="=============================================="/>
</target>
<target name="make_release" depends="update_keywords_doc, make_archive">
<echo message="============================================="/>
<echo message="Make release robotframework-magik ${RFM.VERSION} ..."/>
<echo message="done."/>
<echo message="=============================================="/>
</target>
<target name="clean_test_logs">
<echo message="============================================="/>
<echo message="Clean rfm test logs ..."/>
<delete dir="${DIR.TEST.LOGS}" />
<echo message="done."/>
<echo message="=============================================="/>
</target>
<target name="extract_archive">
<echo message="============================================="/>
<echo message="extract archive rfm into test dir ..."/>
<delete dir="${DIR.TEST.RFM}/${ARCHIVE.PREFIX.RFM}"/>
<unzip src="${ARCHIVE.ZIP.RFM}" dest="${DIR.TEST.RFM}" failOnEmptyArchive="true">
</unzip>
<echo message="done."/>
<echo message="=============================================="/>
</target>
<target name="robot_version">
<exec executable="${PYTHON.ROBOT.CALL}" outputproperty="rfm.robot.version" failonerror="false" dir="${rfm.basedir}">
<arg line="${PYTHON.ROBOT.CALL.ARGS}"/>
<arg line="--version"/>
</exec>
<echo message="Robot Version: ${rfm.robot.version}" />
</target>
<target name="robot_run" >
<property name="tr_full_name" value="Examples_Default_SW"/>
<property name="tr_lname" value="examples"/>
<property name="tr_includes" value=""/>
<property name="tr_excludes" value="${ROBOT.OPTION.DEFAULT.EXCLUDE}"/>
<property name="tr_skip" value="${ROBOT.OPTION.DEFAULT.SKIP}"/>
<property name="tr_variablefile" value="--variablefile "${VARIABLEFILE.TEST.DEFAULT}""/>
<property name="tr_tests" value="examples"/>
<echo message="============================================="/>
<echo message="${rfm.robot.version}"/>
<echo message="robot run - ${tr_full_name} ..."/>
<exec executable="${PYTHON.ROBOT.CALL}" failonerror="true" dir="${DIR.TEST.RFM}/${ARCHIVE.PREFIX.RFM}">
<arg line="${PYTHON.ROBOT.CALL.ARGS}"/>
<arg line="--loglevel DEBUG --name "${tr_full_name}""/>
<arg line="${tr_includes} ${tr_excludes} ${tr_skip} ${tr_variablefile}"/>
<arg line="--outputdir ${DIR.TEST.LOGS}/${tr_lname}"/>
<arg line="${tr_tests}"/>
</exec>
<echo message="done."/>
<echo message="=============================================="/>
</target>
<target name="selftests" depends="clean_test_logs, robot_version">
<echo message="============================================="/>
<echo message="${rfm.robot.version} "/>
<echo message="Run robotframework-magik selftsests ..."/>
<antcall target="rfm.robot_run">
<param name="tr_full_name" value="Test_Archive_Content"/>
<param name="tr_lname" value="archive"/>
<param name="tr_includes" value="--include Archive*"/>
<param name="tr_skip" value="--skiponfailure HeaderTest ${ROBOT.OPTION.DEFAULT.SKIP}"></param>
<param name="tr_tests" value="tests/archive"/>
</antcall>
<antcall target="rfm.robot_run">
<param name="tr_full_name" value="DryRun_Keyword_SelfTest_and_Examples"/>
<param name="tr_lname" value="dryrun"/>
<param name="tr_includes" value="--dryrun --include Keyword* --include Example*"/>
<param name="tr_tests" value="tests examples"/>
</antcall>
<antcall target="rfm.robot_run">
<param name="tr_full_name" value="Test_Script_Content"/>
<param name="tr_lname" value="scripts"/>
<param name="tr_tests" value="tests/scripts"/>
</antcall>
<antcall target="rfm.robot_run">
<param name="tr_full_name" value="Test_Launcher_Content"/>
<param name="tr_lname" value="launcher"/>
<param name="tr_tests" value="tests/keywords/Robot_Magik_Launcher_Dummy_Tests.robot"/>
</antcall>
<antcall target="rfm.robot_run">
<param name="tr_full_name" value="Test_Nested_Aliases_Content"/>
<param name="tr_lname" value="nested_aliases"/>
<param name="tr_includes" value="--skip notReady"/>
<param name="tr_tests" value="tests/nested_aliases"/>
</antcall>
<echo message="done."/>
<echo message="=============================================="/>
</target>
<target name="robot_rebot" >
<property name="tr_new_name" value="RFM Examples ${RFM.VERSION}"/>
<property name="tr_lname" value="examples_${RFM.VERSION}"/>
<property name="tr_includes" value=""/>
<property name="tr_excludes" value=""/>
<!-- <property name="tr_skip" value="${ROBOT.OPTION.DEFAULT.SKIP}"/> -->
<property name="tr_outputdir" value="${DIR.TEST.RFM}"/>
<property name="tr_outputs_to_combine" value="${DIR.TEST.LOGS}/examples*/output.xml"/>
<echo message="============================================="/>
<echo message="${rfm.robot.version}"/>
<echo message="robot rebot - combine test reports ${tr_new_name} ..."/>
<exec executable="${PYTHON.ROBOT.CALL}" failonerror="true" dir="${DIR.TEST.RFM}/${ARCHIVE.PREFIX.RFM}">
<arg line="${PYTHON.ROBOT.REBOT.CALL.ARGS}"/>
<arg line="${tr_includes} ${tr_excludes}"/>
<!-- <arg line="${tr_skip}"/> -->
<arg line="--loglevel INFO --name "${tr_new_name}""/>
<arg line="--outputdir ${tr_outputdir} -l log-${tr_lname}.html -r report-${tr_lname}.html -o output-${tr_lname}.xml"/>
<arg line="${tr_outputs_to_combine}"/>
</exec>
<echo message="done."/>
<echo message="=============================================="/>
</target>
<target name="test_release" depends="extract_archive, selftests">
<echo message="============================================="/>
<echo message="${rfm.robot.version}"/>
<echo message="Test release robotframework-magik ${RFM.VERSION} ..."/>
<antcall target="rfm.robot_rebot">
<param name="tr_new_name" value="RFM Selftests ${RFM.VERSION}"/>
<param name="tr_lname" value="${RFM.VERSION}"/>
<param name="tr_outputdir" value="${DIR.TEST.RFM}"/>
<param name="tr_outputs_to_combine" value="${DIR.TEST.LOGS}/*/output.xml"/>
<!-- <param name="tr_skip" value="- -skiponfailure HeaderTest ${ROBOT.OPTION.DEFAULT.SKIP}"></param> -->
</antcall>
<echo message="done."/>
<echo message="=============================================="/>
</target>
<target name="test_examples" depends="extract_archive, robot_version">
<echo message="============================================="/>
<echo message="${rfm.robot.version}"/>
<echo message="Run RFM examples against several SW versions ..."/>
<delete failonerror="false">
<fileset dir="${DIR.TEST.LOGS}" includes="output-examples*.xml"/>
</delete>
<antcall target="rfm.robot_run">
<param name="tr_full_name" value="Examples_SW41"/>
<param name="tr_lname" value="examples_sw41"/>
<param name="tr_variablefile" value="--variablefile ${VARIABLEFILE.TEST.SW41}"></param>
<param name="tr_tests" value="examples"/>
</antcall>
<antcall target="rfm.robot_run">
<param name="tr_full_name" value="Examples_SW43"/>
<param name="tr_lname" value="examples_sw43"/>
<param name="tr_variablefile" value="--variablefile ${VARIABLEFILE.TEST.SW43}"></param>
<param name="tr_tests" value="examples"/>
</antcall>
<antcall target="rfm.robot_run">
<param name="tr_full_name" value="Examples_SW51"/>
<param name="tr_lname" value="examples_sw51"/>
<param name="tr_variablefile" value="--variablefile ${VARIABLEFILE.TEST.SW51}"></param>
<param name="tr_tests" value="examples"/>
</antcall>
<antcall target="rfm.robot_run">
<param name="tr_full_name" value="Examples_SW52"/>
<param name="tr_lname" value="examples_sw52"/>
<param name="tr_variablefile" value="--variablefile ${VARIABLEFILE.TEST.SW52}"></param>
<param name="tr_tests" value="examples"/>
</antcall>
<antcall target="rfm.robot_run">
<param name="tr_full_name" value="Examples_SW53"/>
<param name="tr_lname" value="examples_sw53"/>
<param name="tr_variablefile" value="--variablefile ${VARIABLEFILE.TEST.SW53}"></param>
<param name="tr_tests" value="examples"/>
</antcall>
<antcall target="rfm.robot_rebot">
<param name="tr_new_name" value="RFM Examples ${RFM.VERSION}"/>
<param name="tr_lname" value="examples_${RFM.VERSION}"/>
<param name="tr_outputdir" value="${DIR.TEST.RFM}"/>
<param name="tr_outputs_to_combine" value="${DIR.TEST.LOGS}/examples*/output.xml"/>
</antcall>
<echo message="done."/>
<echo message="=============================================="/>
</target>
</project>