blob: 5441e5e4362b8da0c94fcfb0994177aea8cd75c5 [file] [log] [blame]
david_williams26f3a5f2008-03-07 22:56:23 +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
23 <property
24 name="templateDir"
25 value="${wtp.builder.home}/distribution/${build.distribution}.site" />
26 <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
40
41
42 <target name="default">
43 <copy
44 overwrite="true"
45 file="${wtp.builder.home}/distribution/${build.distribution}.site/templateFiles/${indexTemplateFilename}"
46 tofile="${resultingIndex}" />
47 <antcall target="countFiles" />
48 <antcall target="generateCompileIndex" />
49 <antcall target="generateJUnitTestsIndex" />
50 <antcall target="getStaticFiles" />
51 </target>
52
53 <target name="generateCompileIndex">
54
55
56 <!--
57 <taskdef name="indexResults" classname="org.eclipse.wtp.releng.tools.ResultsSummaryGenerator" />
58 -->
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 -->
75 <property
76 file="${buildDirectory}/maps/${env.RELENG}/maps/dependencies.properties" />
77
78 <!-- create tables of test plugin compiles first -->
79 <summarizeResults
80 isBuildTested="false"
81 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" />
90
91 <xslt
92 basedir="${resultDir}/testcompilelogs"
93 destdir="${resultDir}/testcompilelogs"
94 includes="**/*.bin.xml"
95 scanincludeddirectories="true"
96 style="compilerXMLOutputToHTML.xsl"
97 force="true" />
98
99 <!-- create table of code plugins compiles -->
100 <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" />
111
112
113 <xslt
114 basedir="${resultDir}/compilelogs"
115 destdir="${resultDir}/compilelogs"
116 includes="**/*.bin.xml"
117 scanincludeddirectories="true"
118 style="compilerXMLOutputToHTML.xsl"
119 force="true" />
120
121 <tstamp>
122 <format
123 property="TODAY"
124 pattern="MMMM d, yyyy" />
125 </tstamp>
126
127 <!-- Insert Build Type descriptor -->
128 <antcall target="${buildType}" />
129
130 <antcall target="writeData" />
131
132 <!-- Update timestamp on file to permit overwrite through Ant copy task -->
133 <touch file="${resultingIndex}" />
134 </target>
135
136 <target
137 name="generateJUnitTestsIndex"
138 depends="checkIfTested"
139 if="doTests">
140
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 -->
156 <property
157 file="${buildDirectory}/maps/${env.RELENG}/maps/dependencies.properties" />
158
159 <!-- create table of test plugin compiles first -->
160 <!-- set isBuildTested to true for the "compile only" results -->
161
162 <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
172
173 <tstamp>
174 <format
175 property="TODAY"
176 pattern="MMMM d, yyyy" />
177 </tstamp>
178
179 <!-- Insert Build Type descriptor -->
180 <antcall target="${buildType}" />
181
182 <antcall target="writeData" />
183
184 <!-- 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" />
197 <copy
198 todir="${resultDir}/buildnotes"
199 flatten="true">
200 <fileset
201 dir="${buildDirectory}/plugins"
202 includes="**/buildnotes_*.html" />
203 <fileset
204 dir="${buildDirectory}/features"
205 includes="**/buildnotes_*.html" />
206 </copy>
207
208
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
227 file="${wtp.builder.home}/distribution/${build.distribution}.site/templateFiles/siteWTP.xml"
228 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" />
256 </replace>
257
258 </target>
259
260 <target name="countFiles">
261 <!--
262 files.count is a file that should exist in the drop directory with a count of the zip files in the same directory.
263 It is required to generate a link to the build on the downloads page.
264 -->
265
266 <countBuildFiles
267 sourceDirectory="${resultDir}"
268 filterString=".zip,.tar.gz"
269 outputFile="${resultDir}/files.count" />
270
271 </target>
272
273 <!--Build type descriptors-->
274 <target 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
285 <target 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
296 <target 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
307 <target 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
318 <target 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
329
330 <target name="T">
331 <replace
332 file="${resultingIndex}"
333 token="%wtpandprereqs%"
334 value=" " />
335 <replace
336 file="${resultingIndex}"
337 token="@type@"
338 value="Test" />
339 </target>
340
341 <target name="P">
342 <replace
343 file="${resultingIndex}"
344 token="%wtpandprereqs%"
345 value=" " />
346 <replace
347 file="${resultingIndex}"
348 token="@type@"
349 value="Patches" />
350 </target>
351
352 <target name="checkIfTested">
353 <echo
354 level="debug"
355 message="isBuildTested: ${isBuildTested}" />
356 <condition property="doTests">
357 <equals
358 arg1="${isBuildTested}"
359 arg2="true"
360 trim="true"
361 casesensitive="false" />
362 </condition>
363 </target>
364
365
366 <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="@eclipse.fspath.prefix@"
423 value="${eclipse.fspath.prefix}" />
424
425 <replace
426 file="${resultingIndex}"
427 token="@testURL@"
428 value="${eclipseTestFramework.url}/${eclipseTestFramework.file}" />
429 <replace
430 file="${resultingIndex}"
431 token="@testFile@"
432 value="${eclipseTestFramework.file}" />
433
434 <replace
435 file="${resultingIndex}"
436 token="@emfFile@"
437 value="${emf.file}" />
438 <replace
439 file="${resultingIndex}"
440 token="@emfURL@"
441 value="${emf.url}/${emf.file}" />
442 <replace
443 file="${resultingIndex}"
444 token="@emfBuildHome@"
445 value="${emf.build.home}" />
446 <replace
447 file="${resultingIndex}"
448 token="@emf.mirror.prefixuri@"
449 value="${emf.mirror.prefixuri}" />
450
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
468
469 <replace
470 file="${resultingIndex}"
471 token="@gefFile@"
472 value="${gef.file}" />
473 <replace
474 file="${resultingIndex}"
475 token="@gefURL@"
476 value="${gef.url}/${gef.file}" />
477 <replace
478 file="${resultingIndex}"
479 token="@gefBuildHome@"
480 value="${gef.build.home}" />
481 <replace
482 file="${resultingIndex}"
483 token="@gef.mirror.prefixuri@"
484 value="${gef.mirror.prefixuri}" />
485
486 <replace
487 file="${resultingIndex}"
488 token="@eclipserelengFile@"
489 value="${eclipsereleng.file}" />
490 <replace
491 file="${resultingIndex}"
492 token="@eclipserelengURL@"
493 value="${eclipsereleng.url}/${eclipsereleng.file}" />
494
495 <replace
496 file="${resultingIndex}"
497 token="@orbitthirdpartyzipFile@"
498 value="${orbitthirdpartyzip.file}" />
499 <replace
500 file="${resultingIndex}"
501 token="@orbitthirdpartyzipURL@"
502 value="${orbitthirdpartyzip.url}/${orbitthirdpartyzip.file}" />
503 <replace
504 file="${resultingIndex}"
505 token="@orbitthirdpartyzipBuildHome@"
506 value="${orbitthirdpartyzip.build.home}" />
507 <replace
508 file="${resultingIndex}"
509 token="@orbitthirdpartyzip.mirror.prefixuri@"
510 value="${orbitthirdpartyzip.mirror.prefixuri}" />
511
512
513 <!-- no longer used. Post 1.5.5 -->
514 <replace
515 file="${resultingIndex}"
516 token="@jemFile@"
517 value="${jem.file}" />
518 <replace
519 file="${resultingIndex}"
520 token="@jemURL@"
521 value="${jem.url}/${jem.file}" />
522 <replace
523 file="${resultingIndex}"
524 token="@jemBuildHome@"
525 value="${jem.build.home}" />
526 <replace
527 file="${resultingIndex}"
528 token="@jem.mirror.prefixuri@"
529 value="${jem.mirror.prefixuri}" />
530 <!--
531 these token/s should not exist in maintenance stream, but
532 do no harm done, so in the interests of keeping builder
533 streams in sync, we'll leave them here as place hold
534 -->
535 <replace
536 file="${resultingIndex}"
537 token="@dtpFile@"
538 value="${dtp.file}" />
539 <replace
540 file="${resultingIndex}"
541 token="@dtpURL@"
542 value="${dtp.url}/${dtp.file}" />
543 <replace
544 file="${resultingIndex}"
545 token="@dtpBuildHome@"
546 value="${dtp.build.home}" />
547 <replace
548 file="${resultingIndex}"
549 token="@dtp.mirror.prefixuri@"
550 value="${dtp.mirror.prefixuri}" />
551
552 </target>
553
554
555</project>