forked from eclipse/xtext
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xtext-build.ant
305 lines (276 loc) · 14.7 KB
/
xtext-build.ant
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
<?xml version="1.0" encoding="UTF-8"?>
<!-- ======================================================================
20.01.2012 09:55:02
Local build
Executes xtext buckminster build on local machine
dhuebner
====================================================================== -->
<project name="xtext-build" default="run-buckminster-build">
<description>
Executes xtext buckminster build on local machine
</description>
<pathconvert targetos="unix" property="WORKSPACE">
<path location="${user.home}/buckminster-builds/xtext" />
</pathconvert>
<pathconvert targetos="unix" property="build.root">
<path location="${WORKSPACE}/buildroot" />
</pathconvert>
<pathconvert targetos="unix" property="checkout.location">
<path location="${ant.file}/../../../../../" />
</pathconvert>
<import file="common.ant" as="common" />
<!-- Debug session suspend on start? -->
<property name="suspend.debug" value="n" />
<!-- Locations -->
<!-- Buckminster headless to use. Will be auto-installed if location is empty. See http://www.eclipse.org/buckminster/downloads.html -->
<pathProperty name="buckminster.home" location="${user.home}/buckminster" />
<pathProperty name="build.properties" location="${releng.project}/releng/xtext-build.properties" />
<pathProperty name="temp.commands.location" location="${ant.file}/.." />
<!-- Against which platform to build (Helios,Stable,Latest)-->
<property name="ECLIPSE.TARGET.ALIAS" value="Stable" />
<property name="WITH.MWE2" value="false" />
<property name="SWTBOT" value="false" />
<property name="DEV.BUILD" value="false" />
<property name="JAVA8" value="false" />
<!--
Steps:
Set API Baseline
Materialize target platform
Import xtext/xtend projects from ${checkout.location}
Zip examples
Compile java (build workspace)
* Compile xtend (optional, off by default)
Package (create p2 repository and zips)
-->
<target name="run-buckminster-build" depends="common.cleanup">
<fail unless="buckminster.home" message="buckminster.home must be specified." />
<antcall target="-buckminster-resolve" />
<antcall target="buckminster-zip_examples-compile" />
<!-- Enable to bootstrap re-compile Xtend files
<antcall target="compile-xtend" />
-->
<antcall target="buckminster-package" />
<antcall target="git-deploy" />
</target>
<target name="resolve-and-compile-all" depends="common.cleanup">
<antcall target="-buckminster-resolve" />
<fail unless="buckminster.home" message="buckminster.home must be specified." />
<echo message="eclipse.download: ${eclipse.download}" />
<property name="commands.file" location="${temp.commands.location}/resolve-and-compile-all-cmd.txt" />
<echo file="${commands.file}" append="false">
resolve "${releng.project}/releng/tests/xtext-test.mspec"
resolve "${releng.project}/releng/tests-xtend/xtend-test.mspec"
build
</echo>
<echo message="build.properties: ${build.properties}" />
<run_buckminster commandsfile="${commands.file}" propertiesfile="${build.properties}" />
</target>
<target name="run-buckminster-build-dev" depends="common.cleanup">
<fail unless="buckminster.home" message="buckminster.home must be specified." />
<antcall target="-buckminster-resolve" />
<antcall target="buckminster-dev-bootstrap" />
</target>
<target name="run-buckminster-tests" depends="common.cleanup">
<fail unless="buckminster.home" message="buckminster.home must be specified." />
<echo message="IMPORTANT: Populating an empty target platform may took over 10 minutes." />
<echo message="eclipse.download: ${eclipse.download}" />
<property name="commands.file" location="${temp.commands.location}/xtext-tests-cmd.txt" />
<echo file="${commands.file}" append="false">
importtargetdefinition -A "${releng.project}/releng/tests/tests-eclipseserver.target
resolve "${releng.project}/releng/tests/xtext-test.mspec"
resolve "${releng.project}/releng/tests-xtend/xtend-test.mspec"
build
#Xtext bootstrap
#junit --stderr --stdout --launch "org.eclipse.xtext.junit4.tests/xtext.junit4.tests.launch" --flatXML --output "${WORKSPACE}/build-result/test-results/xtend.core.tests.fast.xml"
#Xtend tests
#junit --stderr --stdout --launch "org.eclipse.xtend.tests.java8/xtend.core.tests.java8.fast (xtend).launch" --flatXML --output "${WORKSPACE}/build-result/test-results//org.eclipse.xtend.core.tests.java8/xtend.core.tests.java8.fast.xml"
junit --launch "org.eclipse.xtext.xtext.ui.graph.tests/xtext.xtext.ui.graph.tests.launch" --flatXML --output "${WORKSPACE}/build-result/test-results/tests.fast.launch.xml"
</echo>
<echo message="build.properties: ${build.properties}" />
<run_buckminster commandsfile="${commands.file}" propertiesfile="${build.properties}" />
</target>
<target name="run-buckminster-all-tests" depends="common.cleanup">
<fail unless="buckminster.home" message="buckminster.home must be specified." />
<echo message="IMPORTANT: Populating an empty target platform may took over 10 minutes." />
<echo message="eclipse.download: ${eclipse.download}" />
<property name="commands.file" location="${temp.commands.location}/xtext-tests-cmd.txt" />
<echo file="${commands.file}" append="false">
importtargetdefinition -A "${releng.project}/releng/tests/tests-eclipseserver.target
resolve "${releng.project}/releng/tests/xtext-test.mspec"
resolve "${releng.project}/releng/tests-xtend/xtend-test.mspec"
build
junit --launch "org.eclipse.xtend.core.tests/xtend.core.tests.fast.launch" --flatXML --output "${WORKSPACE}/build-result/test-results/xtend.core.tests.fast.xml"
junit --launch "org.eclipse.xtend.core.tests/xtend.core.tests.fast (xtend).launch" --flatXML --output "${WORKSPACE}/build-result/test-results/xtend.core.tests.fast.xtend.xml"
junit --launch "org.eclipse.xtext.xbase.tests/xtext.xbase.tests.fast.launch" --flatXML --output "${WORKSPACE}/build-result/test-results/xtext.xbase.tests.fast.xml"
junit --launch "org.eclipse.xtext.xbase.tests/xtext.xbase.tests.fast (xtend).launch" --flatXML --output "${WORKSPACE}/build-result/test-results/xtext.xbase.tests.fast.xtend.xml"
junit --launch "org.eclipse.xtend.ide.tests/xtend.ide.tests.fast.launch" --flatXML --output "${WORKSPACE}/build-result/test-results/xtend.ide.tests.fast.xml"
junit --launch "org.eclipse.xtend.ide.tests/xtend.ide.tests.fast (xtend).launch" --flatXML --output "${WORKSPACE}/build-result/test-results/xtend.ide.tests.fast.xtend.xml"
junit --launch "org.eclipse.xtext.xtext.ui.graph.tests/xtext.xtext.ui.graph.tests.launch" --flatXML --output "${WORKSPACE}/build-result/test-results/tests.fast.launch.xml"
</echo>
<echo message="build.properties: ${build.properties}" />
<run_buckminster commandsfile="${commands.file}" propertiesfile="${build.properties}" />
</target>
<target name="run-buckminster-swtbot" depends="common.cleanup">
<fail unless="buckminster.home" message="buckminster.home must be specified." />
<ant antfile="${checkout.location}/features/org.eclipse.xtext.build.feature/packaging.ant" target="resolve.variables">
<property name="xtext.p2.repository" value="https://hudson.eclipse.org/xtext/job/xtext-xtend/lastSuccessfulBuild/artifact/build-result/p2.repository/" />
<property name="eclipse.tp" value="file://${releng.project}/releng/mirroring/Kepler/final" />
<property name="src.file" value="${releng.project}/releng/tests/swtbot-tests-buildserver.target" />
<property name="dest.file" value="${releng.project}/releng/tests/swtbot-tests-buildserver-resolved.target" />
</ant>
<antcall target="buckminster-swtbot-tests">
<param name="SWTBOT">true</param>
</antcall>
</target>
<target name="run-buckminster-mwe2-generator-tests" depends="common.cleanup">
<antcall target="-buckminster-resolve">
<param name="WITH.MWE2">true</param>
</antcall>
<property name="commands.file" location="${temp.commands.location}/mwe2-generator-cmd.txt" />
<echo file="${commands.file}" append="false">
resolve "${releng.project}/releng/tests/xtext-test.mspec"
build
launch --stderr --stdout --launch "org.eclipse.xtext.language-generator/GenerateAllLanguages.mwe2.launch"
build
junit --launch "org.eclipse.xtext.tests/xtext.tests.launch" --flatXML --output "${WORKSPACE}/xtext.test.results/xtext.tests.xml"
</echo>
<echo message="build.properties: ${build.properties}" />
<run_buckminster commandsfile="${commands.file}" propertiesfile="${build.properties}" />
</target>
<target name="-buckminster-resolve">
<echo message="IMPORTANT: Populating an empty target platform may took over 10 minutes." />
<echo message="eclipse.download: ${eclipse.download}" />
<property name="commands.file" location="${temp.commands.location}/resolve-cmd.txt" />
<echo file="${commands.file}" append="false">
setpref targetPlatformPath="${build.root}/target.platform"
#setpref org.eclipse.buckminster.core.maxParallelResolutions=1
#setpref org.eclipse.buckminster.core.maxParallelMaterializations=1
importprefs -F "${releng.project}/releng/buckminster.workspace.epf"
# Xtext api baseline
importtargetdefinition "${releng.project}/api-baseline/api-baseline.target"
addbaseline -A "api-baseline"
# Xtext TP and sources
resolve "${releng.project}/releng/xtext-platform.mspec"
resolve "${releng.project}/releng/xtext.cquery"
</echo>
<echo message="build.properties: ${build.properties}" />
<run_buckminster commandsfile="${commands.file}" propertiesfile="${build.properties}" />
</target>
<target name="buckminster-dev-bootstrap">
<property name="DEV.BUILD" value="true" />
<property name="commands.file" location="${temp.commands.location}/compile-dev-cmd.txt" />
<property name="buckminster.workspace" value="${build.root}/buckminster.dev.workspace" />
<echo file="${commands.file}" append="false">
resolve "${releng.project}/releng/xtext-platform.mspec"
build
junit --stderr --stdout --launch "org.eclipse.xtext.releng/releng/bootstrap-dev-build.launch" --flatXML --output "${WORKSPACE}/build-result/test-results/builder-dev-run.result.xml"
</echo>
<echo message="build.properties: ${build.properties}" />
<run_buckminster commandsfile="${commands.file}" propertiesfile="${build.properties}" />
</target>
<target name="buckminster-zip_examples-compile">
<property name="commands.file" location="${temp.commands.location}/zip_examples-compile-cmd.txt" />
<echo file="${commands.file}" append="false">
perform "org.eclipse.xtext.build#zip.examples"
build
</echo>
<echo message="build.properties: ${build.properties}" />
<run_buckminster commandsfile="${commands.file}" propertiesfile="${build.properties}" />
</target>
<target name="compile-xtend">
<property name="commands.file" location="${temp.commands.location}/compile-xtend-cmd.txt" />
<echo file="${commands.file}" append="false">
junit --stderr --stdout --launch "org.eclipse.xtext.releng/releng/bootstrap-build.launch" --flatXML --output "${WORKSPACE}/build-result/test-results/builder-run.result.xml"
</echo>
<echo message="build.properties: ${build.properties}" />
<run_buckminster commandsfile="${commands.file}" propertiesfile="${build.properties}" />
</target>
<target name="buckminster-package">
<property name="commands.file" location="${temp.commands.location}/package-cmd.txt" />
<echo file="${commands.file}" append="false">
#perform "org.eclipse.xtext.releng#create.javadoc"
perform "org.eclipse.xtext.build#build"
perform "org.eclipse.xtext.releng#setup.promoter"
</echo>
<echo message="build.properties: ${build.properties}" />
<run_buckminster commandsfile="${commands.file}" propertiesfile="${build.properties}" />
<echo message=" " />
<echo message="Updatesite output in: ${build.root}/buckminster.workspace/output/org.eclipse.xtext.build_*-eclipse.feature/zips/" />
</target>
<macrodef name="git">
<attribute name="command" />
<attribute name="dir" default="" />
<attribute name="logTheError" default="false" />
<element name="args" optional="true" />
<sequential>
<echo>git @{command}</echo>
<exec executable="git" dir="@{dir}" failonerror="true"
logError="@{logTheError}">
<arg value="@{command}" />
<args/>
</exec>
</sequential>
</macrodef>
<target name="git-deploy">
<property name="p2.location.output" location="${build.root}/buckminster.workspace/output" />
<dirset dir="${p2.location.output}" id="dirBuckminsterFeatureBuildID">
<include name="org.eclipse.xtext.build_*-eclipse.feature"/>
</dirset>
<property name="p2.location.feature" refid="dirBuckminsterFeatureBuildID" />
<property name="p2.location.root" location="${p2.location.output}/${p2.location.feature}" />
<echo message="p2.location.root = ${p2.location.root}" />
<property name="p2.location.site" location="${p2.location.root}/site.p2" />
<property name="p2.location.git" location="${p2.location.root}/xtext" />
<echo message="P2 Updatesite at: ${p2.location.site}" />
<delete dir="${p2.location.git}" failonerror="false" />
<mkdir dir="${p2.location.git}"/>
<git command="init" dir="${p2.location.git}" />
<git command="checkout" dir="${p2.location.git}">
<args>
<arg value="-b"/>
<arg value="gh-pages" />
</args>
</git>
<copy todir="${p2.location.git}">
<fileset dir="${p2.location.site}" />
</copy>
<git command="add" dir="${p2.location.git}">
<args>
<arg value="." />
</args>
</git>
<git command="commit" dir="${p2.location.git}">
<args>
<arg value="-am 'git deployment of local build to p2 repository on github'" />
</args>
</git>
<git command="remote" dir="${p2.location.git}">
<args>
<arg value="add"/>
<arg value="origin" />
<arg value="https://github.com/timeraider4u/xtext.git" />
</args>
</git>
<git command="push" dir="${p2.location.git}" logTheError="true" >
<args>
<arg value="-f" />
<arg value="--progress" />
<arg value="--set-upstream" />
<arg value="origin" />
<arg value="gh-pages" />
</args>
</git>
</target>
<target name="buckminster-swtbot-tests">
<echo message="eclipse.download: ${eclipse.download}" />
<property name="commands.file" location="${temp.commands.location}/swtbot-cmd.txt" />
<echo file="${commands.file}" append="false">
importtargetdefinition -A "${releng.project}/releng/tests/swtbot-tests-buildserver-resolved.target
resolve "${releng.project}/releng/tests-xtend/xtend-test.mspec"
build
junit --launch "org.eclipse.xtend.ide.swtbot.tests/xtend.ide.tests.slow (SWTBot).launch" --flatXML --output "${WORKSPACE}/xtend.test.results/xtend.ide.swtbot.tests.slow.xml"
</echo>
<echo message="build.properties: ${build.properties}" />
<run_buckminster commandsfile="${commands.file}" propertiesfile="${build.properties}" />
</target>
</project>