blob: 5f6697cf4307a66a7a48c63b3abee859fc703943 [file] [log] [blame]
david_williams88cbf012009-01-12 21:53:05 +00001<project
2 name="Publish Build"
3 default="default"
4 basedir=".">
5
6 <!-- 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 -->
12
13 <property environment="env" />
14
15 <property
16 name="resultDir"
17 value="${buildDirectory}/${buildLabel}" />
18 <!--name of generated index page-->
19 <property
20 name="indexFileName"
21 value="index.php" />
22 <property
23 name="templateDir"
24 value="${wtp.builder.home}/distribution/${build.distribution}.site" />
25 <property
26 name="resultingIndex"
27 value="${resultDir}/${indexFileName}" />
28 <echo
29 level="debug"
30 message="resultDir: ${resultDir}" />
31 <echo
32 level="debug"
33 message="templateDir: ${templateDir}" />
34 <echo
35 level="debug"
36 message="resultingIndex: ${resultingIndex}" />
37
38
39
40 <target name="default">
41 <copy
42 overwrite="true"
43 file="${wtp.builder.home}/distribution/${build.distribution}.site/templateFiles/${indexTemplateFilename}"
44 tofile="${resultingIndex}" />
45 <antcall target="countFiles" />
46 <antcall target="generateCompileIndex" />
47 <antcall target="generateJUnitTestsIndex" />
48 <antcall target="getStaticFiles" />
49 </target>
50
51 <target name="generateCompileIndex">
52
53
54 <!--
55 <taskdef name="indexResults" classname="org.eclipse.wtp.releng.tools.ResultsSummaryGenerator" />
56 -->
57
58 <!--
59 isBuildTested: true|false should JUnit plugin test results be used to generate index page
60 dropTokenList: comma separated list of strings which should be replaced by the fileName attribute settings in the testManifest.xml.
61 xmlDirectoryName: path to directory containing JUnit plugin test results in xml format (see doc is org.eclipse.test).
62 dropDirectoryName: path to directory containing the result of the build.
63 testResultsTemplateFileName: path to template file used to generate page with links to JUnit test results
64 testResultsHtmlFileName: name of file which will be generated with links to JUnit test results
65 dropHtmlFileName: name of generated index page
66 hrefTestResultsTargetPath: relative path from index page to directory containing JUnit html test results
67 hrefCompileLogsTargetPath: relative path from index page directory containing compilelogs
68 testManifestFileName: name of xml file containing descriptions of zip types and log files
69
70
71
72 -->
73 <property
74 file="${buildDirectory}/maps/${env.RELENG}/maps/dependencies.properties" />
75
76 <!-- create tables of test plugin compiles first -->
77 <antcall
78 target="generateCompileOutput">
79 <param
80 name="outputDirectory"
81 value="${resultDir}/testcompilelogs" />
82 </antcall>
83
84 <!-- create table of code plugins compiles -->
85 <summarizeResults
86 isBuildTested="false"
87 includeAll="true"
88 dropTokenList="${dropTokenList}"
89 xmlDirectoryName=""
90 dropDirectoryName="${resultDir}"
91 testResultsTemplateFileName="${templateDir}/templateFiles/compileResults.php.template"
92 testResultsHtmlFileName="compileResults.php"
93 hrefTestResultsTargetPath="testResults/html"
94 hrefCompileLogsTargetPath="compilelogs"
95 compileLogsDirectoryName="${resultDir}/compilelogs" />
96 <xslt
97 basedir="${resultDir}/compilelogs"
98 destdir="${resultDir}/compilelogs"
99 includes="**/*.bin.xml"
100 scanincludeddirectories="true"
101 style="compilerXMLOutputToHTML.xsl"
102 force="true" />
103 <tstamp>
104 <format
105 property="TODAY"
106 pattern="MMMM d, yyyy" />
107 </tstamp>
108
109 <!-- Insert Build Type descriptor -->
110 <antcall
111 target="${buildType}" />
112 <antcall
113 target="writeData" />
114
115 <!-- Update timestamp on file to permit overwrite through Ant copy task -->
116 <touch
117 file="${resultingIndex}" />
118 </target>
119 <target
120 name="generateCompileOutput"
121 depends="checkIfCompileLogs"
122 if="doCompileLogs">
123 <summarizeResults
124 isBuildTested="false"
125 includeAll="true"
126 dropTokenList="${dropTokenList}"
127 xmlDirectoryName=""
128 dropDirectoryName="${resultDir}"
129 testResultsTemplateFileName="${templateDir}/templateFiles/testCompileResults.php.template"
130 testResultsHtmlFileName="testCompileResults.php"
131 hrefTestResultsTargetPath=""
132 hrefCompileLogsTargetPath="testcompilelogs"
133 compileLogsDirectoryName="${outputDirectory}" />
134 <xslt
135 basedir="${outputDirectory}"
136 destdir="${outputDirectory}"
137 includes="**/*.bin.xml"
138 scanincludeddirectories="true"
139 style="compilerXMLOutputToHTML.xsl"
140 force="true" />
141 </target>
142 <target
143 name="generateJUnitTestsIndex"
144 depends="checkIfTested"
145 if="doTests">
146
147 <!--
148 isBuildTested: true|false should JUnit plugin test results be used to generate index page
149 dropTokenList: comma separated list of strings which should be replaced by the fileName attribute settings in the testManifest.xml.
150 xmlDirectoryName: path to directory containing JUnit plugin test results in xml format (see doc is org.eclipse.test).
151 dropDirectoryName: path to directory containing the result of the build.
152 testResultsTemplateFileName: path to template file used to generate page with links to JUnit test results
153 testResultsHtmlFileName: name of file which will be generated with links to JUnit test results
154 dropHtmlFileName: name of generated index page
155 hrefTestResultsTargetPath: relative path from index page to directory containing JUnit html test results
156 hrefCompileLogsTargetPath: relative path from index page directory containing compilelogs
157 testManifestFileName: name of xml file containing descriptions of zip types and log files
158
159
160
161 -->
162 <property
163 file="${buildDirectory}/maps/${env.RELENG}/maps/dependencies.properties" />
164
165 <!-- create table of test plugin compiles first -->
166 <!-- set isBuildTested to true for the "compile only" results -->
167 <summarizeResults
168 isBuildTested="true"
169 dropTokenList="${dropTokenList}"
170 dropDirectoryName="${resultDir}"
171 xmlDirectoryName="${resultDir}/testResults/xml"
172 testResultsTemplateFileName="${templateDir}/templateFiles/testResults.php.template"
173 testResultsHtmlFileName="testResults.php"
174 hrefTestResultsTargetPath="testResults/html"
175 compileLogsDirectoryName="" />
176 <tstamp>
177 <format
178 property="TODAY"
179 pattern="MMMM d, yyyy" />
180 </tstamp>
181
182 <!-- Insert Build Type descriptor -->
183 <antcall
184 target="${buildType}" />
185 <antcall
186 target="writeData" />
187
188 <!-- Update timestamp on file to permit overwrite through Ant copy task -->
189 <touch
190 file="${resultingIndex}" />
191 </target>
192 <target
193 name="getStaticFiles">
194 <!--get static files required in the buildLabel directory-->
195 <copy
196 todir="${resultDir}">
197 <fileset
198 dir="${templateDir}/staticDropFiles" />
199 </copy>
200
201 <!--copy buildnotes from plugin directories-->
202 <mkdir
203 dir="${resultDir}/buildnotes" />
204 <copy
205 todir="${resultDir}/buildnotes"
206 flatten="true">
207 <fileset
208 dir="${buildDirectory}/plugins"
209 includes="**/buildnotes_*.html" />
210 <fileset
211 dir="${buildDirectory}/features"
212 includes="**/buildnotes_*.html" />
213 </copy>
214 <copy
215 file="${templateDir}/staticDropFiles/logIndex.php"
216 tofile="${resultDir}/testResults/consolelogs/full/logIndex.php" />
217 <copy
218 file="${templateDir}/staticDropFiles/logIndex.php"
219 tofile="${resultDir}/testResults/consolelogs/testLogs/logIndex.php" />
220 <copy
221 file="${templateDir}/staticDropFiles/logIndex.php"
222 tofile="${resultDir}/testResults/consolelogs/testSysErrorLogs/logIndex.php" />
223 </target>
224 <target
225 name="updateSite">
226
227
228 <!-- get our authored, tokenized site.xml file -->
229 <copy
230 file="${wtp.builder.home}/distribution/${build.distribution}.site/templateFiles/siteWTP.xml"
231 tofile="${buildDirectory}/${buildLabel}/updateSite/site.xml"
232 overwrite="true"
233 failonerror="true" />
234 <!-- get the ${buildDirectory}/finalPluginsVersions.properties, and
235 read as properties -->
236 <!-- substitute property value for tokens -->
237 <replace
238 file="${buildDirectory}/${buildLabel}/updateSite/site.xml"
239 propertyfile="${buildDirectory}/finalFeaturesVersions.properties">
240 <replacefilter
241 token="@org.eclipse.wst@"
242 property="org.eclipse.wst" />
243 <replacefilter
244 token="@org.eclipse.wst.sdk@"
245 property="org.eclipse.wst.sdk" />
246 <replacefilter
247 token="@org.eclipse.jst@"
248 property="org.eclipse.jst" />
249 <replacefilter
250 token="@org.eclipse.jst.sdk@"
251 property="org.eclipse.jst.sdk" />
252 <replacefilter
253 token="@org.eclipse.jpt.feature@"
254 property="org.eclipse.jpt.feature" />
255 <replacefilter
256 token="@org.eclipse.jpt_sdk.feature@"
257 property="org.eclipse.jpt_sdk.feature" />
258 </replace>
259 </target>
260 <target
261 name="countFiles">
262 <!--
263 files.count is a file that should exist in the drop directory with a count of the zip files in the same directory.
264 It is required to generate a link to the build on the downloads page.
265 -->
266 <countBuildFiles
267 sourceDirectory="${resultDir}"
268 filterString=".zip,.tar.gz"
269 outputFile="${resultDir}/files.count" />
270 </target>
271
272 <!--Build type descriptors-->
273 <target
274 name="I">
275 <replace
276 file="${resultingIndex}"
277 token="%wtpandprereqs%"
278 value=" " />
279 <replace
280 file="${resultingIndex}"
281 token="@type@"
282 value="Integration" />
283 </target>
284 <target
285 name="S">
286 <replace
287 file="${resultingIndex}"
288 token="%wtpandprereqs%"
289 value=" " />
290 <replace
291 file="${resultingIndex}"
292 token="@type@"
293 value="Stable" />
294 </target>
295 <target
296 name="N">
297 <replace
298 file="${resultingIndex}"
299 token="%wtpandprereqs%"
300 value=" " />
301 <replace
302 file="${resultingIndex}"
303 token="@type@"
304 value="Nightly" />
305 </target>
306 <target
307 name="M">
308 <replace
309 file="${resultingIndex}"
310 token="%wtpandprereqs%"
311 value=" " />
312 <replace
313 file="${resultingIndex}"
314 token="@type@"
315 value="Maintenance" />
316 </target>
317 <target
318 name="R">
319 <replace
320 file="${resultingIndex}"
321 token="%wtpandprereqs%"
322 value=" " />
323 <replace
324 file="${resultingIndex}"
325 token="@type@"
326 value="Release" />
327 </target>
328 <target
329 name="T">
330 <replace
331 file="${resultingIndex}"
332 token="%wtpandprereqs%"
333 value=" " />
334 <replace
335 file="${resultingIndex}"
336 token="@type@"
337 value="Test" />
338 </target>
339 <target
340 name="P">
341 <replace
342 file="${resultingIndex}"
343 token="%wtpandprereqs%"
344 value=" " />
345 <replace
346 file="${resultingIndex}"
347 token="@type@"
348 value="Patches" />
349 </target>
350 <target
351 name="checkIfTested">
352 <echo
353 level="debug"
354 message="isBuildTested: ${isBuildTested}" />
355 <condition
356 property="doTests">
357 <equals
358 arg1="${isBuildTested}"
359 arg2="true"
360 trim="true"
361 casesensitive="false" />
362 </condition>
363 </target>
364 <target
365 name="checkIfCompileLogs">
366 <condition
367 property="doCompileLogs">
368 <available
369 file="${outputDirectory}" />
370 </condition>
371 </target>
372 <target
373 name="writeData">
374 <!-- Insert Build Date -->
375 <replace
376 file="${resultingIndex}"
377 token="@date@"
378 value="${TODAY}" />
379
380 <!-- Insert Build Name -->
381 <replace
382 file="${resultingIndex}"
383 token="@build@"
384 value="${buildLabel}" />
385 <replace
386 file="${resultingIndex}"
387 token="@buildBranch@"
388 value="${buildBranch}" />
389
390 <!-- Insert PreRequsites -->
391 <replace
392 file="${resultingIndex}"
393 token="@eclipseFile@"
394 value="${eclipse.file.linux-gtk-x86}" />
395 <replace
396 file="${resultingIndex}"
397 token="@eclipseURL@"
398 value="${eclipse.url}/${eclipse.file.linux-gtk-x86}" />
399 <replace
400 file="${resultingIndex}"
401 token="@eclipseBuildURL@"
402 value="${eclipse.url}" />
403 <replace
404 file="${resultingIndex}"
405 token="@eclipsefilelinux@"
406 value="${eclipse.file.linux-gtk-x86}" />
407 <replace
408 file="${resultingIndex}"
409 token="@eclipsefilewindows@"
410 value="${eclipse.file.win32-win32-x86}" />
411 <replace
412 file="${resultingIndex}"
413 token="@eclipsefilemacos@"
414 value="${eclipse.file.macosx-carbon-ppc}" />
415 <replace
416 file="${resultingIndex}"
417 token="@eclipseBuildHome@"
418 value="${eclipse.build.home}" />
419 <replace
420 file="${resultingIndex}"
421 token="@eclipse.mirror.prefixuri@"
422 value="${eclipse.mirror.prefixuri}" />
423 <replace
424 file="${resultingIndex}"
425 token="@eclipse.fspath.prefix@"
426 value="${eclipse.fspath.prefix}" />
427 <replace
428 file="${resultingIndex}"
429 token="@testURL@"
430 value="${eclipseTestFramework.url}/${eclipseTestFramework.file}" />
431 <replace
432 file="${resultingIndex}"
433 token="@testFile@"
434 value="${eclipseTestFramework.file}" />
435 <replace
436 file="${resultingIndex}"
437 token="@emfFile@"
438 value="${emf.file}" />
439 <replace
440 file="${resultingIndex}"
441 token="@emfURL@"
442 value="${emf.url}/${emf.file}" />
443 <replace
444 file="${resultingIndex}"
445 token="@emfBuildHome@"
446 value="${emf.build.home}" />
447 <replace
448 file="${resultingIndex}"
449 token="@emf.mirror.prefixuri@"
450 value="${emf.mirror.prefixuri}" />
451 <replace
452 file="${resultingIndex}"
453 token="@wstFile@"
454 value="${wst.file}" />
455 <replace
456 file="${resultingIndex}"
457 token="@wstURL@"
458 value="${wst.url}/${wst.file}" />
459 <replace
460 file="${resultingIndex}"
461 token="@wstBuildHome@"
462 value="${wst.build.home}" />
463 <replace
464 file="${resultingIndex}"
465 token="@wst.mirror.prefixuri@"
466 value="${wst.mirror.prefixuri}" />
467 <replace
468 file="${resultingIndex}"
469 token="@gefFile@"
470 value="${gef.file}" />
471 <replace
472 file="${resultingIndex}"
473 token="@gefURL@"
474 value="${gef.url}/${gef.file}" />
475 <replace
476 file="${resultingIndex}"
477 token="@gefBuildHome@"
478 value="${gef.build.home}" />
479 <replace
480 file="${resultingIndex}"
481 token="@gef.mirror.prefixuri@"
482 value="${gef.mirror.prefixuri}" />
483 <replace
484 file="${resultingIndex}"
485 token="@eclipserelengFile@"
486 value="${eclipsereleng.file}" />
487 <replace
488 file="${resultingIndex}"
489 token="@eclipserelengURL@"
490 value="${eclipsereleng.url}/${eclipsereleng.file}" />
491 <replace
492 file="${resultingIndex}"
493 token="@orbitthirdpartyzipFile@"
494 value="${orbitthirdpartyzip.file}" />
495 <replace
496 file="${resultingIndex}"
497 token="@orbitthirdpartyzipURL@"
498 value="${orbitthirdpartyzip.url}/${orbitthirdpartyzip.file}" />
499 <replace
500 file="${resultingIndex}"
501 token="@orbitthirdpartyzipBuildHome@"
502 value="${orbitthirdpartyzip.build.home}" />
503 <replace
504 file="${resultingIndex}"
505 token="@orbitthirdpartyzip.mirror.prefixuri@"
506 value="${orbitthirdpartyzip.mirror.prefixuri}" />
507
508
509 <!-- no longer used. Post 1.5.5 -->
510 <replace
511 file="${resultingIndex}"
512 token="@jemFile@"
513 value="${jem.file}" />
514 <replace
515 file="${resultingIndex}"
516 token="@jemURL@"
517 value="${jem.url}/${jem.file}" />
518 <replace
519 file="${resultingIndex}"
520 token="@jemBuildHome@"
521 value="${jem.build.home}" />
522 <replace
523 file="${resultingIndex}"
524 token="@jem.mirror.prefixuri@"
525 value="${jem.mirror.prefixuri}" />
526 <!--
527 these token/s should not exist in maintenance stream, but
528 do no harm done, so in the interests of keeping builder
529 streams in sync, we'll leave them here as place hold
530 -->
531 <replace
532 file="${resultingIndex}"
533 token="@dtpFile@"
534 value="${dtp.file}" />
535 <replace
536 file="${resultingIndex}"
537 token="@dtpURL@"
538 value="${dtp.url}/${dtp.file}" />
539 <replace
540 file="${resultingIndex}"
541 token="@dtpBuildHome@"
542 value="${dtp.build.home}" />
543 <replace
544 file="${resultingIndex}"
545 token="@dtp.mirror.prefixuri@"
546 value="${dtp.mirror.prefixuri}" />
547 </target>
548</project>