blob: be0ff05068077b598a892e47c3751ca3e336e789 [file] [log] [blame]
david_williamsc3b4f452007-09-30 08:28:17 +00001<project
2 name="Publish Build"
3 default="default"
4 basedir=".">
david_williams0c366d32006-12-10 07:08:39 +00005
david_williamsb1d22d62007-09-23 01:09:44 +00006 <!-- Properties that must be passed to this script:
7 buildDirectory: Path to perform the build in. (A working directory)
8 buildType: Type of build (nightly, integration etc.)
9 buildId: Build name
10 buildLabel: <buildType>-<buildName>-<timestamp>
11 -->
david_williamsc3b4f452007-09-30 08:28:17 +000012
david_williamsb1d22d62007-09-23 01:09:44 +000013 <property environment="env" />
david_williamsc3b4f452007-09-30 08:28:17 +000014
david_williams403beae2007-12-09 02:10:40 +000015 <property
david_williamsc3b4f452007-09-30 08:28:17 +000016 name="resultDir"
17 value="${buildDirectory}/${buildLabel}" />
david_williamsb1d22d62007-09-23 01:09:44 +000018 <!--name of generated index page-->
david_williamsc3b4f452007-09-30 08:28:17 +000019 <property
20 name="indexFileName"
21 value="index.php" />
22
23 <property
24 name="templateDir"
david_williams68fed022008-01-10 07:28:12 +000025 value="${wtp.builder.home}/distribution/${build.distribution}.site" />
david_williamsc3b4f452007-09-30 08:28:17 +000026 <property
27 name="resultingIndex"
28 value="${resultDir}/${indexFileName}" />
29
30 <echo
31 level="debug"
32 message="resultDir: ${resultDir}" />
33 <echo
34 level="debug"
35 message="templateDir: ${templateDir}" />
36 <echo
37 level="debug"
38 message="resultingIndex: ${resultingIndex}" />
39
david_williams0c366d32006-12-10 07:08:39 +000040
41
david_williamsb1d22d62007-09-23 01:09:44 +000042 <target name="default">
david_williamsc3b4f452007-09-30 08:28:17 +000043 <copy
44 overwrite="true"
david_williams68fed022008-01-10 07:28:12 +000045 file="${wtp.builder.home}/distribution/${build.distribution}.site/templateFiles/${indexTemplateFilename}"
david_williamsc3b4f452007-09-30 08:28:17 +000046 tofile="${resultingIndex}" />
david_williamsb1d22d62007-09-23 01:09:44 +000047 <antcall target="countFiles" />
48 <antcall target="generateCompileIndex" />
49 <antcall target="generateJUnitTestsIndex" />
50 <antcall target="getStaticFiles" />
51 </target>
52
david_williamsc3b4f452007-09-30 08:28:17 +000053 <target name="generateCompileIndex">
david_williamsb1d22d62007-09-23 01:09:44 +000054
david_williamsc3b4f452007-09-30 08:28:17 +000055
56 <!--
57 <taskdef name="indexResults" classname="org.eclipse.wtp.releng.tools.ResultsSummaryGenerator" />
david_williamsb1d22d62007-09-23 01:09:44 +000058 -->
59
60 <!--
61 isBuildTested: true|false should JUnit plugin test results be used to generate index page
62 dropTokenList: comma separated list of strings which should be replaced by the fileName attribute settings in the testManifest.xml.
63 xmlDirectoryName: path to directory containing JUnit plugin test results in xml format (see doc is org.eclipse.test).
64 dropDirectoryName: path to directory containing the result of the build.
65 testResultsTemplateFileName: path to template file used to generate page with links to JUnit test results
66 testResultsHtmlFileName: name of file which will be generated with links to JUnit test results
67 dropHtmlFileName: name of generated index page
68 hrefTestResultsTargetPath: relative path from index page to directory containing JUnit html test results
69 hrefCompileLogsTargetPath: relative path from index page directory containing compilelogs
70 testManifestFileName: name of xml file containing descriptions of zip types and log files
71
72
73
74 -->
david_williams8e80ae22008-01-11 03:26:46 +000075 <property
76 file="${buildDirectory}/maps/${env.RELENG}/maps/dependencies.properties" />
david_williamsc3b4f452007-09-30 08:28:17 +000077
david_williamsb1d22d62007-09-23 01:09:44 +000078 <!-- create tables of test plugin compiles first -->
david_williams5d9c9862007-11-19 04:42:55 +000079 <summarizeResults
80 isBuildTested="false"
david_williamsc3b4f452007-09-30 08:28:17 +000081 includeAll="true"
82 dropTokenList="${dropTokenList}"
83 xmlDirectoryName=""
84 dropDirectoryName="${resultDir}"
85 testResultsTemplateFileName="${templateDir}/templateFiles/testCompileResults.php.template"
86 testResultsHtmlFileName="testCompileResults.php"
87 hrefTestResultsTargetPath=""
88 hrefCompileLogsTargetPath="testcompilelogs"
89 compileLogsDirectoryName="${resultDir}/testcompilelogs" />
david_williams5d9c9862007-11-19 04:42:55 +000090
91 <xslt
92 basedir="${resultDir}/testcompilelogs"
93 destdir="${resultDir}/testcompilelogs"
david_williamsc3b4f452007-09-30 08:28:17 +000094 includes="**/*.bin.xml"
david_williams5d9c9862007-11-19 04:42:55 +000095 scanincludeddirectories="true"
96 style="compilerXMLOutputToHTML.xsl"
97 force="true" />
98
david_williamsb1d22d62007-09-23 01:09:44 +000099 <!-- create table of code plugins compiles -->
david_williamsc3b4f452007-09-30 08:28:17 +0000100 <summarizeResults
101 isBuildTested="false"
102 includeAll="true"
103 dropTokenList="${dropTokenList}"
104 xmlDirectoryName=""
105 dropDirectoryName="${resultDir}"
106 testResultsTemplateFileName="${templateDir}/templateFiles/compileResults.php.template"
107 testResultsHtmlFileName="compileResults.php"
108 hrefTestResultsTargetPath="testResults/html"
109 hrefCompileLogsTargetPath="compilelogs"
110 compileLogsDirectoryName="${resultDir}/compilelogs" />
david_williamsb1d22d62007-09-23 01:09:44 +0000111
112
david_williamsc3b4f452007-09-30 08:28:17 +0000113 <xslt
114 basedir="${resultDir}/compilelogs"
115 destdir="${resultDir}/compilelogs"
116 includes="**/*.bin.xml"
117 scanincludeddirectories="true"
118 style="compilerXMLOutputToHTML.xsl"
119 force="true" />
david_williamsb1d22d62007-09-23 01:09:44 +0000120
121 <tstamp>
david_williamsc3b4f452007-09-30 08:28:17 +0000122 <format
123 property="TODAY"
124 pattern="MMMM d, yyyy" />
david_williamsb1d22d62007-09-23 01:09:44 +0000125 </tstamp>
126
127 <!-- Insert Build Type descriptor -->
128 <antcall target="${buildType}" />
129
david_williams5d9c9862007-11-19 04:42:55 +0000130 <antcall target="writeData" />
david_williamsb1d22d62007-09-23 01:09:44 +0000131
david_williamsb1d22d62007-09-23 01:09:44 +0000132 <!-- Update timestamp on file to permit overwrite through Ant copy task -->
133 <touch file="${resultingIndex}" />
134 </target>
david_williamsc3b4f452007-09-30 08:28:17 +0000135
136 <target
137 name="generateJUnitTestsIndex"
138 depends="checkIfTested"
139 if="doTests">
david_williamsb1d22d62007-09-23 01:09:44 +0000140
141 <!--
142 isBuildTested: true|false should JUnit plugin test results be used to generate index page
143 dropTokenList: comma separated list of strings which should be replaced by the fileName attribute settings in the testManifest.xml.
144 xmlDirectoryName: path to directory containing JUnit plugin test results in xml format (see doc is org.eclipse.test).
145 dropDirectoryName: path to directory containing the result of the build.
146 testResultsTemplateFileName: path to template file used to generate page with links to JUnit test results
147 testResultsHtmlFileName: name of file which will be generated with links to JUnit test results
148 dropHtmlFileName: name of generated index page
149 hrefTestResultsTargetPath: relative path from index page to directory containing JUnit html test results
150 hrefCompileLogsTargetPath: relative path from index page directory containing compilelogs
151 testManifestFileName: name of xml file containing descriptions of zip types and log files
152
153
154
155 -->
david_williams5d9c9862007-11-19 04:42:55 +0000156 <property
david_williamsa71ad9c2008-01-11 04:02:52 +0000157 file="${buildDirectory}/maps/${env.RELENG}/maps/dependencies.properties" />
david_williamsb1d22d62007-09-23 01:09:44 +0000158
159 <!-- create table of test plugin compiles first -->
160 <!-- set isBuildTested to true for the "compile only" results -->
161
david_williamsc3b4f452007-09-30 08:28:17 +0000162 <summarizeResults
163 isBuildTested="true"
164 dropTokenList="${dropTokenList}"
165 dropDirectoryName="${resultDir}"
166 xmlDirectoryName="${resultDir}/testResults/xml"
167 testResultsTemplateFileName="${templateDir}/templateFiles/testResults.php.template"
168 testResultsHtmlFileName="testResults.php"
169 hrefTestResultsTargetPath="testResults/html"
170 compileLogsDirectoryName="" />
171
david_williamsb1d22d62007-09-23 01:09:44 +0000172
173 <tstamp>
david_williamsc3b4f452007-09-30 08:28:17 +0000174 <format
175 property="TODAY"
176 pattern="MMMM d, yyyy" />
david_williamsb1d22d62007-09-23 01:09:44 +0000177 </tstamp>
178
179 <!-- Insert Build Type descriptor -->
180 <antcall target="${buildType}" />
181
david_williams5d9c9862007-11-19 04:42:55 +0000182 <antcall target="writeData" />
david_williamsb1d22d62007-09-23 01:09:44 +0000183
david_williamsb1d22d62007-09-23 01:09:44 +0000184 <!-- Update timestamp on file to permit overwrite through Ant copy task -->
185 <touch file="${resultingIndex}" />
186 </target>
187
188
189 <target name="getStaticFiles">
190 <!--get static files required in the buildLabel directory-->
191 <copy todir="${resultDir}">
192 <fileset dir="${templateDir}/staticDropFiles" />
193 </copy>
194
195 <!--copy buildnotes from plugin directories-->
196 <mkdir dir="${resultDir}/buildnotes" />
david_williamsc3b4f452007-09-30 08:28:17 +0000197 <copy
198 todir="${resultDir}/buildnotes"
199 flatten="true">
200 <fileset
201 dir="${buildDirectory}/plugins"
202 includes="**/buildnotes_*.html" />
david_williams403beae2007-12-09 02:10:40 +0000203 <fileset
david_williams5d9c9862007-11-19 04:42:55 +0000204 dir="${buildDirectory}/features"
205 includes="**/buildnotes_*.html" />
david_williamsb1d22d62007-09-23 01:09:44 +0000206 </copy>
david_williamsb1d22d62007-09-23 01:09:44 +0000207
david_williamsc3b4f452007-09-30 08:28:17 +0000208
209 <copy
210 file="${templateDir}/staticDropFiles/logIndex.php"
211 tofile="${resultDir}/testResults/consolelogs/full/logIndex.php" />
212 <copy
213 file="${templateDir}/staticDropFiles/logIndex.php"
214 tofile="${resultDir}/testResults/consolelogs/testLogs/logIndex.php" />
215 <copy
216 file="${templateDir}/staticDropFiles/logIndex.php"
217 tofile="${resultDir}/testResults/consolelogs/testSysErrorLogs/logIndex.php" />
218
219
220 </target>
221
222 <target name="updateSite">
223
224
225 <!-- get our authored, tokenized site.xml file -->
226 <copy
david_williams68fed022008-01-10 07:28:12 +0000227 file="${wtp.builder.home}/distribution/${build.distribution}.site/templateFiles/siteWTP.xml"
david_williamsc3b4f452007-09-30 08:28:17 +0000228 tofile="${buildDirectory}/${buildLabel}/updateSite/site.xml"
229 overwrite="true"
230 failonerror="true" />
231 <!-- get the ${buildDirectory}/finalPluginsVersions.properties, and
232 read as properties -->
233 <!-- substitute property value for tokens -->
234 <replace
235 file="${buildDirectory}/${buildLabel}/updateSite/site.xml"
236 propertyfile="${buildDirectory}/finalFeaturesVersions.properties">
237 <replacefilter
238 token="@org.eclipse.wst@"
239 property="org.eclipse.wst" />
240 <replacefilter
241 token="@org.eclipse.wst.sdk@"
242 property="org.eclipse.wst.sdk" />
243 <replacefilter
244 token="@org.eclipse.jst@"
245 property="org.eclipse.jst" />
246 <replacefilter
247 token="@org.eclipse.jst.sdk@"
248 property="org.eclipse.jst.sdk" />
249
250 <replacefilter
251 token="@org.eclipse.jpt.feature@"
252 property="org.eclipse.jpt.feature" />
253 <replacefilter
254 token="@org.eclipse.jpt_sdk.feature@"
255 property="org.eclipse.jpt_sdk.feature" />
david_williamsb1d22d62007-09-23 01:09:44 +0000256 </replace>
257
258 </target>
259
260 <target name="countFiles">
261 <!--
david_williamsc3b4f452007-09-30 08:28:17 +0000262 files.count is a file that should exist in the drop directory with a count of the zip files in the same directory.
david_williamsb1d22d62007-09-23 01:09:44 +0000263 It is required to generate a link to the build on the downloads page.
264 -->
265
david_williamsc3b4f452007-09-30 08:28:17 +0000266 <countBuildFiles
267 sourceDirectory="${resultDir}"
268 filterString=".zip,.tar.gz"
269 outputFile="${resultDir}/files.count" />
david_williamsb1d22d62007-09-23 01:09:44 +0000270
271 </target>
272
273 <!--Build type descriptors-->
274 <target name="I">
david_williamsc3b4f452007-09-30 08:28:17 +0000275 <replace
276 file="${resultingIndex}"
277 token="%wtpandprereqs%"
278 value=" " />
279 <replace
280 file="${resultingIndex}"
281 token="@type@"
282 value="Integration" />
david_williamsb1d22d62007-09-23 01:09:44 +0000283 </target>
284
285 <target name="S">
david_williamsc3b4f452007-09-30 08:28:17 +0000286 <replace
287 file="${resultingIndex}"
288 token="%wtpandprereqs%"
289 value=" " />
290 <replace
291 file="${resultingIndex}"
292 token="@type@"
293 value="Stable" />
david_williamsb1d22d62007-09-23 01:09:44 +0000294 </target>
295
296 <target name="N">
david_williamsc3b4f452007-09-30 08:28:17 +0000297 <replace
298 file="${resultingIndex}"
299 token="%wtpandprereqs%"
300 value=" " />
301 <replace
302 file="${resultingIndex}"
303 token="@type@"
304 value="Nightly" />
david_williamsb1d22d62007-09-23 01:09:44 +0000305 </target>
306
307 <target name="M">
david_williamsc3b4f452007-09-30 08:28:17 +0000308 <replace
309 file="${resultingIndex}"
310 token="%wtpandprereqs%"
311 value=" " />
312 <replace
313 file="${resultingIndex}"
314 token="@type@"
315 value="Maintenance" />
david_williamsb1d22d62007-09-23 01:09:44 +0000316 </target>
317
318 <target name="R">
david_williamsc3b4f452007-09-30 08:28:17 +0000319 <replace
320 file="${resultingIndex}"
321 token="%wtpandprereqs%"
322 value=" " />
323 <replace
324 file="${resultingIndex}"
325 token="@type@"
326 value="Release" />
david_williamsb1d22d62007-09-23 01:09:44 +0000327 </target>
328
329
330 <target name="T">
david_williamsc3b4f452007-09-30 08:28:17 +0000331 <replace
332 file="${resultingIndex}"
333 token="%wtpandprereqs%"
334 value=" " />
335 <replace
336 file="${resultingIndex}"
337 token="@type@"
338 value="Test" />
david_williamsb1d22d62007-09-23 01:09:44 +0000339 </target>
david_williamsc3b4f452007-09-30 08:28:17 +0000340
david_williamsb1d22d62007-09-23 01:09:44 +0000341 <target name="P">
david_williamsc3b4f452007-09-30 08:28:17 +0000342 <replace
343 file="${resultingIndex}"
344 token="%wtpandprereqs%"
345 value=" " />
346 <replace
347 file="${resultingIndex}"
348 token="@type@"
349 value="Patches" />
david_williamsb1d22d62007-09-23 01:09:44 +0000350 </target>
david_williamsc3b4f452007-09-30 08:28:17 +0000351
david_williamsb1d22d62007-09-23 01:09:44 +0000352 <target name="checkIfTested">
david_williamsc3b4f452007-09-30 08:28:17 +0000353 <echo
354 level="debug"
355 message="isBuildTested: ${isBuildTested}" />
david_williamsb1d22d62007-09-23 01:09:44 +0000356 <condition property="doTests">
david_williamsc3b4f452007-09-30 08:28:17 +0000357 <equals
358 arg1="${isBuildTested}"
359 arg2="true"
360 trim="true"
361 casesensitive="false" />
david_williamsb1d22d62007-09-23 01:09:44 +0000362 </condition>
363 </target>
david_williamsc3b4f452007-09-30 08:28:17 +0000364
david_williams0c366d32006-12-10 07:08:39 +0000365
david_williams5d9c9862007-11-19 04:42:55 +0000366 <target name="writeData">
367 <!-- Insert Build Date -->
368 <replace
369 file="${resultingIndex}"
370 token="@date@"
371 value="${TODAY}" />
372
373 <!-- Insert Build Name -->
374 <replace
375 file="${resultingIndex}"
376 token="@build@"
377 value="${buildLabel}" />
378
379 <replace
380 file="${resultingIndex}"
381 token="@buildBranch@"
382 value="${buildBranch}" />
383
384 <!-- Insert PreRequsites -->
385
386 <replace
387 file="${resultingIndex}"
388 token="@eclipseFile@"
389 value="${eclipse.file.linux-gtk-x86}" />
390 <replace
391 file="${resultingIndex}"
392 token="@eclipseURL@"
393 value="${eclipse.url}/${eclipse.file.linux-gtk-x86}" />
394 <replace
395 file="${resultingIndex}"
396 token="@eclipseBuildURL@"
397 value="${eclipse.url}" />
398
399 <replace
400 file="${resultingIndex}"
401 token="@eclipsefilelinux@"
402 value="${eclipse.file.linux-gtk-x86}" />
403 <replace
404 file="${resultingIndex}"
405 token="@eclipsefilewindows@"
406 value="${eclipse.file.win32-win32-x86}" />
407 <replace
408 file="${resultingIndex}"
409 token="@eclipsefilemacos@"
410 value="${eclipse.file.macosx-carbon-ppc}" />
411 <replace
412 file="${resultingIndex}"
413 token="@eclipseBuildHome@"
414 value="${eclipse.build.home}" />
415 <replace
416 file="${resultingIndex}"
417 token="@eclipse.mirror.prefixuri@"
418 value="${eclipse.mirror.prefixuri}" />
419
420 <replace
421 file="${resultingIndex}"
422 token="@testURL@"
423 value="${eclipseTestFramework.url}/${eclipseTestFramework.file}" />
424 <replace
425 file="${resultingIndex}"
426 token="@testFile@"
427 value="${eclipseTestFramework.file}" />
428
429 <replace
430 file="${resultingIndex}"
431 token="@emfFile@"
432 value="${emf.file}" />
433 <replace
434 file="${resultingIndex}"
435 token="@emfURL@"
436 value="${emf.url}/${emf.file}" />
437 <replace
438 file="${resultingIndex}"
439 token="@emfBuildHome@"
440 value="${emf.build.home}" />
441 <replace
442 file="${resultingIndex}"
443 token="@emf.mirror.prefixuri@"
444 value="${emf.mirror.prefixuri}" />
445
446
447
448 <replace
449 file="${resultingIndex}"
450 token="@gefFile@"
451 value="${gef.file}" />
452 <replace
453 file="${resultingIndex}"
454 token="@gefURL@"
455 value="${gef.url}/${gef.file}" />
456 <replace
457 file="${resultingIndex}"
458 token="@gefBuildHome@"
459 value="${gef.build.home}" />
460 <replace
461 file="${resultingIndex}"
462 token="@gef.mirror.prefixuri@"
463 value="${gef.mirror.prefixuri}" />
464
465 <replace
466 file="${resultingIndex}"
467 token="@eclipserelengFile@"
468 value="${eclipsereleng.file}" />
469 <replace
470 file="${resultingIndex}"
471 token="@eclipserelengURL@"
472 value="${eclipsereleng.url}/${eclipsereleng.file}" />
473
474 <replace
475 file="${resultingIndex}"
476 token="@orbitthirdpartyzipFile@"
477 value="${orbitthirdpartyzip.file}" />
478 <replace
479 file="${resultingIndex}"
480 token="@orbitthirdpartyzipURL@"
481 value="${orbitthirdpartyzip.url}/${orbitthirdpartyzip.file}" />
482 <replace
483 file="${resultingIndex}"
484 token="@orbitthirdpartyzipBuildHome@"
485 value="${orbitthirdpartyzip.build.home}" />
486 <replace
487 file="${resultingIndex}"
488 token="@orbitthirdpartyzip.mirror.prefixuri@"
489 value="${orbitthirdpartyzip.mirror.prefixuri}" />
490
491
492 <!-- no longer used. Post 1.5.5 -->
493 <replace
494 file="${resultingIndex}"
495 token="@jemFile@"
496 value="${jem.file}" />
497 <replace
498 file="${resultingIndex}"
499 token="@jemURL@"
500 value="${jem.url}/${jem.file}" />
501 <replace
502 file="${resultingIndex}"
503 token="@jemBuildHome@"
504 value="${jem.build.home}" />
505 <replace
506 file="${resultingIndex}"
507 token="@jem.mirror.prefixuri@"
508 value="${jem.mirror.prefixuri}" />
509 <!--
510 these token/s should not exist in maintenance stream, but
511 do no harm done, so in the interests of keeping builder
512 streams in sync, we'll leave them here as place hold
513 -->
514 <replace
515 file="${resultingIndex}"
516 token="@dtpFile@"
517 value="${dtp.file}" />
518 <replace
519 file="${resultingIndex}"
520 token="@dtpURL@"
521 value="${dtp.url}/${dtp.file}" />
522 <replace
523 file="${resultingIndex}"
524 token="@dtpBuildHome@"
525 value="${dtp.build.home}" />
526 <replace
527 file="${resultingIndex}"
528 token="@dtp.mirror.prefixuri@"
529 value="${dtp.mirror.prefixuri}" />
530
531 </target>
532
533
david_williams0c366d32006-12-10 07:08:39 +0000534</project>