blob: e3394649a20760825b0262e43a343b4de6ed8697 [file] [log] [blame]
mwenzae0eceb2010-07-30 12:25:50 +00001<?xml version="1.0"?>
mwenz18308ab2010-08-02 08:39:48 +00002<project name="Graphiti">
mwenza3bacde2010-07-07 14:11:25 +00003
mwenzae0eceb2010-07-30 12:25:50 +00004 <condition property="properties.file" value="build.properties" else="local.properties">
5 <isset property="server.build" />
6 </condition>
mwenza3bacde2010-07-07 14:11:25 +00007
mwenzae0eceb2010-07-30 12:25:50 +00008 <condition property="mspec.file" value="build.mspec" else="local.mspec">
9 <isset property="server.build" />
10 </condition>
mwenza3bacde2010-07-07 14:11:25 +000011
mwenzae0eceb2010-07-30 12:25:50 +000012 <property file="${properties.file}" />
mwenza3bacde2010-07-07 14:11:25 +000013 <property environment="env" />
14
mwenzae0eceb2010-07-30 12:25:50 +000015 <condition property="build.root" value="${env.WORKSPACE}" else="${basedir}/../build">
mwenza3bacde2010-07-07 14:11:25 +000016 <isset property="env.WORKSPACE" />
17 </condition>
18
mwenzae0eceb2010-07-30 12:25:50 +000019 <condition property="buckminster.loglevel" value="${env.BUCKMINSTER_LOGLEVEL}" else="INFO">
mwenza3bacde2010-07-07 14:11:25 +000020 <isset property="env.BUCKMINSTER_LOGLEVEL" />
21 </condition>
22
mwenza3bacde2010-07-07 14:11:25 +000023 <condition property="clean.tools" value="true">
24 <equals arg1="${env.CLEAN_TOOLS}" arg2="true" />
25 </condition>
26
mwenzae0eceb2010-07-30 12:25:50 +000027 <condition property="clean.tp" value="true">
28 <equals arg1="${env.CLEAN_TP}" arg2="true" />
29 </condition>
mwenza3bacde2010-07-07 14:11:25 +000030
mwenzae0eceb2010-07-30 12:25:50 +000031 <condition property="clean.workspace" value="true">
32 <equals arg1="${env.CLEAN_WORKSPACE}" arg2="true" />
33 </condition>
mwenza3bacde2010-07-07 14:11:25 +000034
mwenzae0eceb2010-07-30 12:25:50 +000035 <condition property="clean.output" value="true">
36 <equals arg1="${env.CLEAN_OUTPUT}" arg2="true" />
37 </condition>
mwenza3bacde2010-07-07 14:11:25 +000038
mwenzae0eceb2010-07-30 12:25:50 +000039 <condition property="build.type" value="${env.BUILD_TYPE}" else="N">
40 <isset property="env.BUILD_TYPE" />
41 </condition>
mwenza3bacde2010-07-07 14:11:25 +000042
mwenzae0eceb2010-07-30 12:25:50 +000043 <condition property="build.nightly" value="true">
44 <equals arg1="${build.type}" arg2="N" />
45 </condition>
mwenza3bacde2010-07-07 14:11:25 +000046
mwenzae0eceb2010-07-30 12:25:50 +000047 <condition property="site.pack200" value="${env.SITE_PACK200}" else="true">
48 <isset property="env.SITE_PACK200" />
49 </condition>
mwenza3bacde2010-07-07 14:11:25 +000050
mwenzae0eceb2010-07-30 12:25:50 +000051 <condition property="site.signing" value="false" else="true">
52 <isset property="build.nightly" />
53 </condition>
mwenza3bacde2010-07-07 14:11:25 +000054
mwenzae0eceb2010-07-30 12:25:50 +000055 <!-- Default properties intended to be overridden by entries in the above property file -->
56 <property name="tools" location="${build.root}/tools" />
57 <property name="result" location="${build.root}/result" />
58 <property name="workspace" location="${result}/workspace" />
59 <property name="targetPlatformPath" location="${result}/tp" />
60 <property name="buckminster.output.root" location="${result}/output" />
61 <property name="buckminster.temp.root" location="${result}/temp" />
62 <property name="site.p2.dir" location="${workspace}/_temp/org.eclipse.graphiti.site_1.0.0-eclipse.feature/site.p2" />
mwenza3bacde2010-07-07 14:11:25 +000063
mwenzae0eceb2010-07-30 12:25:50 +000064 <!-- This macro executes the default application of an eclipse installation
65 that resides in the folder ${buildtools}/@app -->
66 <macrodef name="eclipse.launch">
67 <attribute name="app" />
68 <element name="args" optional="true" />
69 <sequential>
70 <!-- We assume that the eclipse installation is beneath ${buildtools} -->
71 <property name="@{app}.deploy.dir" value="${tools}/@{app}" />
mwenza3bacde2010-07-07 14:11:25 +000072
mwenzae0eceb2010-07-30 12:25:50 +000073 <!-- Find the Eclipse launcher and assing its location to the @{app}.launcher property -->
74 <pathconvert property="@{app}.launcher">
75 <first count="1">
76 <sort>
77 <fileset dir="${@{app}.deploy.dir}/plugins" includes="**/org.eclipse.equinox.launcher_*.jar" />
78 <reverse xmlns="antlib:org.apache.tools.ant.types.resources.comparators">
79 <date />
80 </reverse>
81 </sort>
82 </first>
83 </pathconvert>
mwenza3bacde2010-07-07 14:11:25 +000084
mwenzae0eceb2010-07-30 12:25:50 +000085 <!-- Launch the eclipse application -->
86 <java fork="true" jar="${@{app}.launcher}" dir="${@{app}.deploy.dir}" failonerror="true">
87 <!-- Uncomment to debug <jvmarg value="-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=y"/> -->
88 <args />
89 </java>
90 </sequential>
91 </macrodef>
mwenza3bacde2010-07-07 14:11:25 +000092
mwenzae0eceb2010-07-30 12:25:50 +000093 <macrodef name="buckminster">
94 <attribute name="command" />
95 <attribute name="workspace" default="${workspace}" />
96 <element name="globargs" optional="true" />
97 <element name="cmdargs" optional="true" />
98 <sequential>
99 <eclipse.launch app="buckminster">
100 <args>
101 <jvmarg value="-Dbugfix.288796=true" />
mwenz66a90742010-08-02 08:48:03 +0000102 <jvmarg value="-Xmx4096m" />
mwenzae0eceb2010-07-30 12:25:50 +0000103 <arg value="-data" />
104 <arg value="@{workspace}" />
105 <arg value="--loglevel" />
106 <arg value="${buckminster.loglevel}" />
107 <arg value="--displaystacktrace" />
108 <globargs />
109 <arg value="@{command}" />
110 <arg value="-P" />
111 <arg value="${properties.tmp}" />
112 <cmdargs />
113 </args>
114 </eclipse.launch>
115 </sequential>
116 </macrodef>
mwenza3bacde2010-07-07 14:11:25 +0000117
118 <target name="init.clean.tools" if="clean.tools">
mwenzae0eceb2010-07-30 12:25:50 +0000119 <antcall target="clean.tools" />
mwenza3bacde2010-07-07 14:11:25 +0000120 </target>
121
mwenzae0eceb2010-07-30 12:25:50 +0000122 <target name="init.clean.tp" if="clean.tp">
123 <antcall target="clean.tp" />
mwenza3bacde2010-07-07 14:11:25 +0000124 </target>
125
mwenzae0eceb2010-07-30 12:25:50 +0000126 <target name="init.clean.workspace" if="clean.workspace">
127 <antcall target="clean.workspace" />
128 </target>
mwenza3bacde2010-07-07 14:11:25 +0000129
mwenzae0eceb2010-07-30 12:25:50 +0000130 <target name="init.clean.output" if="clean.output">
131 <antcall target="clean.output" />
132 </target>
mwenza3bacde2010-07-07 14:11:25 +0000133
mwenzae0eceb2010-07-30 12:25:50 +0000134 <target name="init.checks" depends="init.clean.tools,init.clean.tp,init.clean.workspace,init.clean.output">
135 <echo message="Sourcing ${properties.file}" />
mwenza3bacde2010-07-07 14:11:25 +0000136 <available file="${tools}/director/director" property="director.exists" />
137 <available file="${tools}/buckminster/buckminster" property="buckminster.exists" />
mwenza3bacde2010-07-07 14:11:25 +0000138 </target>
139
140 <target name="get.director" unless="director.exists">
141 <echo message="Fetching headless director application" />
mwenz66a90742010-08-02 08:48:03 +0000142 <tempfile destdir="${java.io.tmpdir}"
mwenzae0eceb2010-07-30 12:25:50 +0000143 prefix="director-"
144 suffix=".zip"
145 property="director.zip"
146 deleteonexit="true" />
147 <get src="${eclipse.downloads}/${director.path}" dest="${director.zip}" />
mwenza3bacde2010-07-07 14:11:25 +0000148 <mkdir dir="${tools}" />
mwenzae0eceb2010-07-30 12:25:50 +0000149 <unzip src="${director.zip}" dest="${tools}" />
mwenza3bacde2010-07-07 14:11:25 +0000150 <delete file="${director.zip}" />
151 </target>
152
153 <target name="install.buckminster" unless="buckminster.exists" depends="get.director">
154 <echo message="Configuring headless buckminster with needed features" />
155 <eclipse.launch app="director">
156 <args>
157 <jvmarg value="-Declipse.p2.mirrors=false" />
mwenzae0eceb2010-07-30 12:25:50 +0000158 <!--
159 Hudson Ant property: org.eclipse.update.jarprocessor.pack200=/shared/common/ibm-java2-ppc-50/jre/bin
160 <jvmarg value="-Dorg.eclipse.update.jarprocessor.pack200=${org.eclipse.update.jarprocessor.pack200}" />
161 -->
mwenza3bacde2010-07-07 14:11:25 +0000162 <arg value="-r" />
mwenzae0eceb2010-07-30 12:25:50 +0000163 <arg value="${eclipse.downloads}/${bm.headless.path}" />
mwenza3bacde2010-07-07 14:11:25 +0000164 <arg value="-d" />
mwenzae0eceb2010-07-30 12:25:50 +0000165 <arg value="${tools}/buckminster" />
mwenza3bacde2010-07-07 14:11:25 +0000166 <arg value="-p" />
167 <arg value="Buckminster" />
168 <arg value="-i" />
169 <arg value="org.eclipse.buckminster.cmdline.product" />
170 <arg value="-i" />
171 <arg value="org.eclipse.buckminster.core.headless.feature.feature.group" />
172 <arg value="-i" />
173 <arg value="org.eclipse.buckminster.pde.headless.feature.feature.group" />
174 <arg value="-i" />
175 <arg value="org.eclipse.buckminster.cvs.headless.feature.feature.group" />
176 <arg value="-i" />
177 <arg value="org.eclipse.buckminster.emma.headless.feature.feature.group" />
178 </args>
179 </eclipse.launch>
180 </target>
181
mwenzae0eceb2010-07-30 12:25:50 +0000182 <target name="init.workspace" unless="workspace.exists">
183 <mkdir dir="${workspace}" />
184 </target>
185
mwenza3bacde2010-07-07 14:11:25 +0000186 <target name="init.build.properties">
mwenzae0eceb2010-07-30 12:25:50 +0000187 <!-- Echo relevant properties to a temporary file so that Buckminster can read them -->
mwenz66a90742010-08-02 08:48:03 +0000188 <tempfile destdir="${java.io.tmpdir}"
mwenzae0eceb2010-07-30 12:25:50 +0000189 prefix="build-"
190 suffix=".properties"
191 deleteonexit="true"
192 property="properties.tmp" />
193 <echo message="Properties file is: ${properties.tmp}" />
mwenza3bacde2010-07-07 14:11:25 +0000194 <echoproperties destfile="${properties.tmp}">
195 <!-- We don't want these. basedir in particular will cause problems if passed explicitly -->
196 <propertyset negate="true">
197 <propertyref name="basedir" />
198 <propertyref name="eclipse.home" />
199 <propertyref name="properties.tmp" />
200 <propertyref name="line.separator" />
201 <propertyref name="path.separator" />
202 <propertyref prefix="ant." />
203 <propertyref prefix="file." />
204 <propertyref prefix="java." />
205 <propertyref prefix="sun." />
206 <propertyref prefix="user." />
207 </propertyset>
208 </echoproperties>
209 </target>
mwenzae0eceb2010-07-30 12:25:50 +0000210
211 <target name="provision" depends="init.checks,init.workspace,install.buckminster,init.build.properties">
212 <echo message="Importing projects into workspace ${workspace} and binaries into target platform ${targetPlatformPath}" />
213 <buckminster command="setpref">
214 <cmdargs>
215 <arg value="targetPlatformPath=${targetPlatformPath}" />
216 </cmdargs>
217 </buckminster>
218
219 <buckminster command="import">
220 <cmdargs>
221 <arg value="-P" />
222 <arg value="${basedir}/${properties.file}" />
mwenz9554c632010-08-25 14:14:11 +0000223 <arg value="-B" />
224 <arg value="${result}/Graphiti.bom" />
mwenzae0eceb2010-07-30 12:25:50 +0000225 <arg value="${basedir}/${mspec.file}" />
226 </cmdargs>
227 </buckminster>
228 </target>
229
230 <target name="site.p2" depends="provision">
231 <echo message="Building all projects in workspace ${workspace}" />
232 <buckminster command="build">
233 <cmdargs>
234 <arg value="--thorough" />
235 </cmdargs>
236 </buckminster>
237
238 <echo message="Performing org.eclipse.graphiti.site#site.p2" />
239 <buckminster command="perform">
240 <cmdargs>
241 <arg value="org.eclipse.graphiti.site#site.p2" />
242 </cmdargs>
243 </buckminster>
244
245 <echo message="Creating human readable index.html" />
246 <unzip src="${site.p2.dir}/content.jar" dest="${site.p2.dir}" />
247 <xslt style="xsl/content2html.xsl" in="${site.p2.dir}/content.xml" out="${site.p2.dir}/index.html" />
248 <xslt style="xsl/content2xml.xsl" in="${site.p2.dir}/content.xml" out="${site.p2.dir}/index.xml" />
249 <delete file="${site.p2.dir}/content.xml" />
250 </target>
251
252 <target name="test" depends="site.p2">
mwenzd32f13b2010-08-12 09:00:02 +0000253 <echo message="Running JUnit tests for Graphiti" />
254 <buckminster command="emma">
255 <cmdargs>
256 <arg value="-l" />
tkaisera6afdd32010-08-25 13:52:51 +0000257 <arg value="-m" />
mwenzd32f13b2010-08-12 09:00:02 +0000258 <arg value="org.eclipse.graphiti.tests/AllJunitTests.launch" />
259 <arg value="-o" />
260 <arg value="${result}/testReportJunitGraphiti.xml" />
261 <arg value="--terseXML" />
262 <arg value="--flatXML" />
263 <arg value="--xml" />
264 <arg value="${result}/coverageReportJunitGraphiti.xml" />
265 <arg value="--stderr" />
266 <arg value="${result}/ErrorLogJunitGraphiti.log" />
267 <arg value="--stdout" />
268 <arg value="${result}/OutputLogJunitGraphiti.log" />
269 </cmdargs>
270 </buckminster>
271
272 <echo message="Running JUnit tests for GraphitiUI" />
273 <buckminster command="emma">
274 <cmdargs>
275 <arg value="-l" />
tkaisera6afdd32010-08-25 13:52:51 +0000276 <arg value="-m" />
mwenzd32f13b2010-08-12 09:00:02 +0000277 <arg value="org.eclipse.graphiti.ui.tests/AllJunitUiTests.launch" />
278 <arg value="-o" />
279 <arg value="${result}/testReportJunitGraphitiUi.xml" />
280 <arg value="--terseXML" />
281 <arg value="--flatXML" />
282 <arg value="--xml" />
283 <arg value="${result}/coverageReportJunitGraphitiUi.xml" />
284 <arg value="--stderr" />
285 <arg value="${result}/ErrorLogJunitGraphitiUi.log" />
286 <arg value="--stdout" />
287 <arg value="${result}/OutputLogJunitGraphitiUi.log" />
288 </cmdargs>
289 </buckminster>
290
mwenzb05d4972010-08-11 10:44:58 +0000291 <echo message="Running SWT Bot tests for Graphiti" />
tkaiserc7b9c262010-08-25 13:13:21 +0000292 <buckminster command="emma">
mwenzae0eceb2010-07-30 12:25:50 +0000293 <cmdargs>
294 <arg value="-l" />
tkaisera6afdd32010-08-25 13:52:51 +0000295 <arg value="-m" />
mwenzb05d4972010-08-11 10:44:58 +0000296 <arg value="org.eclipse.graphiti.bot.tests/AllBotTests.launch" />
mwenz15ddf582010-08-11 14:09:33 +0000297 <arg value="-o" />
298 <arg value="${result}/testReportSwtBotGraphiti.xml" />
299 <arg value="--terseXML" />
300 <arg value="--flatXML" />
tkaiserc7b9c262010-08-25 13:13:21 +0000301 <arg value="--xml" />
302 <arg value="${result}/coverageReportSwtBotGraphiti.xml" />
mwenzd32f13b2010-08-12 09:00:02 +0000303 <arg value="--stderr" />
304 <arg value="${result}/ErrorLogSwtBotGraphiti.log" />
305 <arg value="--stdout" />
306 <arg value="${result}/OutputLogSwtBotGraphiti.log" />
mwenzae0eceb2010-07-30 12:25:50 +0000307 </cmdargs>
308 </buckminster>
309 </target>
310
311 <target name="promote.sites" depends="provision">
312 <echo message="Building all projects in workspace ${workspace}" />
313 <buckminster command="build" />
314
315 <echo message="Performing org.eclipse.graphiti.releng#promote" />
316 <buckminster command="perform">
317 <cmdargs>
318 <arg value="org.eclipse.graphiti.releng#promote" />
319 </cmdargs>
320 </buckminster>
321 </target>
322
323 <target name="clean.tools">
324 <delete dir="${tools}/director" failonerror="true" quiet="true" />
325 <delete dir="${tools}/buckminster" failonerror="true" quiet="true" />
326 </target>
327
328 <target name="clean.tp">
329 <delete dir="${targetPlatformPath}" failonerror="true" quiet="true" />
330 </target>
331
332 <target name="clean.workspace">
333 <delete dir="${workspace}" failonerror="true" quiet="true" />
334 </target>
335
336 <target name="clean.output">
337 <delete dir="${buckminster.output.root}" failonerror="true" quiet="true" />
338 <delete dir="${buckminster.temp.root}" failonerror="true" quiet="true" />
339 </target>
340
341 <target name="clean.all" depends="clean.tools,clean.workspace,clean.tp,clean.output" />
342
mwenza3bacde2010-07-07 14:11:25 +0000343</project>