blob: c25f15f8c7f8cfb2156ab93e42bc66020fca0c8b [file] [log] [blame]
david_williamsd913e922006-11-13 07:24:21 +00001<project
david_williams05dbe622007-12-09 01:20:57 +00002 name="PDECustomTargets"
3 default="noDefault"
david_williams403beae2007-12-09 02:10:40 +00004 basedir=".">
5
david_williams886167e2007-12-13 04:42:37 +00006
7 <!-- = = = standard properties pattern = = = -->
8
9 <!--
10 Note to be cross-platform, "environment variables" are only appropriate for
11 some variables, e.g. ones we set, since properties are case sensitive, even if
12 the environment variables on your operating system are not, e.g. it will
13 be ${env.Path} not ${env.PATH} on Windows -->
14 <property environment="env" />
15
16 <!--
17 Let users override standard properties, if desired.
18 If directory, file, or some properties do not exist,
19 then standard properties will be used.
20 -->
21 <property
22 file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties" />
23
24 <!-- let this project specify properties, if not already set -->
25 <property file="build.properties" />
26
david_williamsa3e48362007-08-22 04:21:50 +000027
david_williams842e4192007-12-09 07:44:35 +000028 <property
29 name="cvsProtocol"
david_williamsd4b1fd32008-01-02 04:16:52 +000030 value="${env.BUILD_CVS_WRITE_PROTOCOL}" />
david_williams842e4192007-12-09 07:44:35 +000031 <property
32 name="cvsUser"
david_williamsd4b1fd32008-01-02 04:16:52 +000033 value="${env.BUILD_CVS_WRITE_USER}" />
david_williams842e4192007-12-09 07:44:35 +000034 <property
35 name="cvsServer"
david_williamsd4b1fd32008-01-02 04:16:52 +000036 value="${env.BUILD_CVS_SERVER}" />
david_williams842e4192007-12-09 07:44:35 +000037 <property
38 name="cvsRoot"
david_williamsd4b1fd32008-01-02 04:16:52 +000039 value="${env.BUILD_CVS_ROOT}" />
david_williams842e4192007-12-09 07:44:35 +000040
david_williamsd913e922006-11-13 07:24:21 +000041 <!-- ===================================================================== -->
42 <!-- Run a given ${target} on all elements being built -->
43 <!-- Add on <ant> task for each top level element being built. -->
44 <!-- ===================================================================== -->
45 <target name="allElements">
david_williams403beae2007-12-09 02:10:40 +000046 <echo
47 level="info"
48 message="Target: ${target} " />
49 <echo
50 level="debug"
51 message="basedir: ${basedir}" />
52 <echo
53 level="debug"
54 message="buildDirectory: ${buildDirectory}" />
55 <echo
56 level="debug"
57 message="baseLocation: ${baseLocation}" />
58 <echo
59 level="debug"
60 message="generic target: ${genericTargets}" />
david_williamsd913e922006-11-13 07:24:21 +000061 <ant
62 antfile="${genericTargets}"
63 target="${target}">
64 <property
65 name="type"
66 value="feature" />
67 <property
68 name="id"
david_williamseb49d082007-05-01 03:03:15 +000069 value="org.eclipse.jpt.tests" />
david_williamsd913e922006-11-13 07:24:21 +000070 </ant>
71 </target>
ndai91f5c9b2006-03-12 13:56:45 +000072
david_williamsd913e922006-11-13 07:24:21 +000073 <!-- ===================================================================== -->
74 <!-- Targets to assemble the built elements for particular configurations -->
75 <!-- These generally call the generated assemble scripts (named in -->
76 <!-- ${assembleScriptName}) but may also add pre and post processing -->
77 <!-- Add one target for each root element and each configuration -->
78 <!-- ===================================================================== -->
ndai91f5c9b2006-03-12 13:56:45 +000079
david_williamseb49d082007-05-01 03:03:15 +000080 <target name="assemble.org.eclipse.jpt.tests">
david_williamsd913e922006-11-13 07:24:21 +000081 <property
82 name="archiveName"
david_williamseb49d082007-05-01 03:03:15 +000083 value="wtp-jpt-Automated-Tests-${buildLabel}.zip" />
david_williamsd913e922006-11-13 07:24:21 +000084 <ant
85 antfile="${assembleScriptName}"
86 dir="${buildDirectory}" />
ndai91f5c9b2006-03-12 13:56:45 +000087
david_williamsd913e922006-11-13 07:24:21 +000088 </target>
ndai91f5c9b2006-03-12 13:56:45 +000089
david_williamsd913e922006-11-13 07:24:21 +000090 <target name="prePackage" />
ndai91f5c9b2006-03-12 13:56:45 +000091
92
david_williamsd913e922006-11-13 07:24:21 +000093 <target name="postPackage">
94 <property
95 name="archiveName"
david_williamseb49d082007-05-01 03:03:15 +000096 value="wtp-jpt-Automated-Tests-${buildLabel}.zip" />
david_williams0b74c592007-04-09 06:11:35 +000097
david_williamsd913e922006-11-13 07:24:21 +000098 <ant
99 antfile="${wtp.builder.home}/scripts/build/buildutilities.xml"
100 target="unpackUpdateJarsAndCreateZippedPackages">
101 <property
102 name="buildDirectory"
103 value="${buildDirectory}" />
104 <property
105 name="buildLabel"
106 value="${buildLabel}" />
107 <property
108 name="archiveName"
109 value="${archiveName}" />
110 </ant>
111
112 </target>
113
114 <!-- ===================================================================== -->
115 <!-- Check out map files from correct repository -->
116 <!-- Replace values for cvsRoot, package and mapVersionTag as desired. -->
117 <!-- ===================================================================== -->
118 <target name="checkLocal">
119 <available
120 property="mapsLocal"
david_williamsd66fa182007-11-17 03:18:04 +0000121 file="${buildDirectory}/maps/${env.RELENGDALI}" />
david_williamsd913e922006-11-13 07:24:21 +0000122 </target>
123
124 <target
125 name="getMapFiles"
126 depends="checkLocal"
127 unless="mapsLocal">
128
ndai91f5c9b2006-03-12 13:56:45 +0000129 <!-- *** change the repo info -->
david_williamsd913e922006-11-13 07:24:21 +0000130 <property
131 name="mapCvsRoot"
132 value=":${cvsProtocol}:${cvsUser}@${cvsServer}:${cvsRoot}" />
david_williams8f11ee72007-06-30 08:22:55 +0000133
134 <!-- if not otherwise set, use these default values -->
david_williamsd913e922006-11-13 07:24:21 +0000135 <property
136 name="mapVersionTag"
137 value="HEAD" />
david_williams8f11ee72007-06-30 08:22:55 +0000138 <property
139 name="releng.dali-mapVersionTag"
140 value="HEAD" />
141
142 <!-- get primary maps first, since if there happens to be
143 duplicates, the first one "wins" (such as for dependancies.properties)
144 -->
david_williams0b74c592007-04-09 06:11:35 +0000145
david_williams0085b792007-11-17 08:34:56 +0000146 <!-- get releng maps -->
david_williams0987a072007-02-20 18:27:24 +0000147 <antcall target="checkOutMaps">
148 <param
149 name="cvsPackage"
david_williams957ca732007-11-17 01:39:24 +0000150 value="${env.RELENG}" />
david_williams8f11ee72007-06-30 08:22:55 +0000151 <param
152 name="versionTagParam"
153 value="${mapVersionTag}" />
david_williams0b74c592007-04-09 06:11:35 +0000154 </antcall>
155
david_williams0987a072007-02-20 18:27:24 +0000156 <!-- get releng.dali/maps -->
157 <antcall target="checkOutMaps">
158 <param
159 name="cvsPackage"
david_williams957ca732007-11-17 01:39:24 +0000160 value="${env.RELENGDALI}" />
david_williams8f11ee72007-06-30 08:22:55 +0000161 <param
162 name="versionTagParam"
163 value="${releng.dali-mapVersionTag}" />
david_williams0987a072007-02-20 18:27:24 +0000164 </antcall>
david_williams0b74c592007-04-09 06:11:35 +0000165
david_williams0987a072007-02-20 18:27:24 +0000166 <!-- tag the map files project -->
ndai91f5c9b2006-03-12 13:56:45 +0000167 <antcall target="tagMapFiles">
david_williamsd913e922006-11-13 07:24:21 +0000168 <param
169 name="mapCvsRoot"
170 value="${mapCvsRoot}" />
ndai91f5c9b2006-03-12 13:56:45 +0000171 </antcall>
david_williamsd913e922006-11-13 07:24:21 +0000172 </target>
ndai91f5c9b2006-03-12 13:56:45 +0000173
david_williams0987a072007-02-20 18:27:24 +0000174 <!-- ===================================================================== -->
175 <!-- Check out the cvsPackage -->
176 <!-- ===================================================================== -->
177 <target name="checkOutMaps">
david_williams403beae2007-12-09 02:10:40 +0000178 <echo
179 level="info"
180 message="mapCvsRoot: ${mapCvsRoot}" />
181 <echo
182 level="info"
183 message="cvsPackage = ${cvsPackage} " />
184 <echo
185 level="info"
186 message="versionTagParam: ${versionTagParam}" />
david_williams0987a072007-02-20 18:27:24 +0000187 <cvs
188 cvsRoot="${mapCvsRoot}"
189 package="${cvsPackage}"
190 dest="${buildDirectory}/maps"
david_williamsa3e48362007-08-22 04:21:50 +0000191 tag="${versionTagParam}"
192 quiet="${env.CVS_QUIET}"
193 reallyquiet="${env.CVS_REALLY_QUIET}" />
david_williams0987a072007-02-20 18:27:24 +0000194 </target>
195
196 <!-- ===================================================================== -->
197 <!-- Tag Map Files mapCvsRoot -->
198 <!-- ===================================================================== -->
david_williams8f11ee72007-06-30 08:22:55 +0000199 <target
200 name="tagMapFiles"
david_williamsd913e922006-11-13 07:24:21 +0000201 if="tagMaps">
202 <cvs
203 cvsRoot="${mapCvsRoot}"
204 dest="${buildDirectory}/maps"
david_williamsa3e48362007-08-22 04:21:50 +0000205 command="tag v${buildType}${timestamp}"
206 quiet="${env.CVS_QUIET}"
207 reallyquiet="${env.CVS_REALLY_QUIET}" />
david_williamsd913e922006-11-13 07:24:21 +0000208 </target>
ndai91f5c9b2006-03-12 13:56:45 +0000209
david_williamsd913e922006-11-13 07:24:21 +0000210 <!-- ===================================================================== -->
211 <!-- Steps to do before setup -->
212 <!-- ===================================================================== -->
213 <target name="preSetup"></target>
ndai91f5c9b2006-03-12 13:56:45 +0000214
david_williamsd913e922006-11-13 07:24:21 +0000215 <!-- ===================================================================== -->
216 <!-- Steps to do after setup but before starting the build proper -->
217 <!-- ===================================================================== -->
218 <target name="postSetup">
219 <dirname
220 file="${ant.file}"
221 property="component.dir" />
david_williams403beae2007-12-09 02:10:40 +0000222 <echo
223 level="debug"
224 message="ant.file: ${ant.file}" />
225 <echo
226 level="debug"
227 message="component.dir: ${component.dir}" />
david_williams0b74c592007-04-09 06:11:35 +0000228
david_williams0987a072007-02-20 18:27:24 +0000229 <property
230 name="dependencies.combined"
231 value="dependencies.combined.properties" />
david_williams0b74c592007-04-09 06:11:35 +0000232
233 <!-- Combine releng and releng.dali -->
david_williams8f11ee72007-06-30 08:22:55 +0000234 <delete
david_williamsd66fa182007-11-17 03:18:04 +0000235 file="${buildDirectory}/maps/${env.RELENGDALI}/maps/${dependencies.combined}"
david_williams8f11ee72007-06-30 08:22:55 +0000236 failonerror="false" />
237 <concat
david_williamsd66fa182007-11-17 03:18:04 +0000238 destfile="${buildDirectory}/maps/${env.RELENGDALI}/maps/${dependencies.combined}">
david_williams0987a072007-02-20 18:27:24 +0000239 <fileset dir="${buildDirectory}/maps">
david_williams403beae2007-12-09 02:10:40 +0000240 <include
241 name="${env.RELENG}/maps/dependencies.properties" />
david_williams8f11ee72007-06-30 08:22:55 +0000242 <include
david_williamsc09fa6e2007-12-06 03:42:28 +0000243 name="${env.RELENGDALI}/maps/dali.dependencies.properties" />
david_williams0987a072007-02-20 18:27:24 +0000244 </fileset>
245 </concat>
david_williams0b74c592007-04-09 06:11:35 +0000246
david_williamsd913e922006-11-13 07:24:21 +0000247 <ant
248 antfile="${component.dir}/dependency.xml"
249 target="get">
250 <property
251 name="dependency.properties"
david_williamsd66fa182007-11-17 03:18:04 +0000252 value="${buildDirectory}/maps/${env.RELENGDALI}/maps/${dependencies.combined}" />
david_williamsd913e922006-11-13 07:24:21 +0000253 <property
254 name="base.install.dir"
255 value="${buildRoot}" />
256 </ant>
257 <!--fetch the additional pieces to build tests -->
258 <property
259 name="featureOnly"
260 value="false" />
261 <property
262 name="featureAndPlugins"
263 value="true" />
264 <property
265 name="featuresRecursively"
266 value="true" />
david_williams0b74c592007-04-09 06:11:35 +0000267
david_williamsd913e922006-11-13 07:24:21 +0000268 <ant
269 antfile="${genericTargets}"
270 dir="${pde.build.scripts}"
271 target="fetchElement">
272 <property
273 name="type"
274 value="feature" />
275 <property
276 name="id"
david_williamseb49d082007-05-01 03:03:15 +0000277 value="org.eclipse.jpt.feature" />
david_williamsd913e922006-11-13 07:24:21 +0000278 </ant>
279 </target>
ndai91f5c9b2006-03-12 13:56:45 +0000280
david_williamsd913e922006-11-13 07:24:21 +0000281 <!-- ===================================================================== -->
282 <!-- Steps to do before fetching the build elements -->
283 <!-- ===================================================================== -->
284 <target name="preFetch"></target>
ndai91f5c9b2006-03-12 13:56:45 +0000285
david_williamsd913e922006-11-13 07:24:21 +0000286 <!-- ===================================================================== -->
287 <!-- Steps to do after fetching the build elements -->
288 <!-- ===================================================================== -->
289 <target name="postFetch"></target>
290
291 <!-- ===================================================================== -->
292 <!-- Steps to do before generating the build scripts. -->
293 <!-- ===================================================================== -->
david_williams0b74c592007-04-09 06:11:35 +0000294 <target name="postGenerate">
david_williams8f11ee72007-06-30 08:22:55 +0000295 <customizeAccessRules
296 bundleDirectory="${buildDirectory}/plugins"
297 defaultRules="+org/eclipse/wst/**/*, +org/eclipse/jst/**/*" />
david_williams0b74c592007-04-09 06:11:35 +0000298 </target>
david_williamsd913e922006-11-13 07:24:21 +0000299 <!-- ===================================================================== -->
300 <!-- Steps to do after generating the build scripts. -->
301 <!-- ===================================================================== -->
david_williams0b74c592007-04-09 06:11:35 +0000302 <target name="preGenerate"></target>
ndai91f5c9b2006-03-12 13:56:45 +0000303
304
david_williamsd913e922006-11-13 07:24:21 +0000305 <!-- ===================================================================== -->
306 <!-- Steps to do before running the build.xmls for the elements being built. -->
307 <!-- ===================================================================== -->
david_williams8f11ee72007-06-30 08:22:55 +0000308 <target name="preProcess">
309 <replace
310 dir="${buildDirectory}/plugins"
311 value="${timestamp}"
312 token="@build@">
313 <include name="**/about.mappings" />
314 </replace>
315 </target>
ndai91f5c9b2006-03-12 13:56:45 +0000316
david_williamsd913e922006-11-13 07:24:21 +0000317 <!-- ===================================================================== -->
318 <!-- Steps to do after running the build.xmls for the elements being built. -->
319 <!-- ===================================================================== -->
david_williamsc84ab8c2006-12-11 18:50:34 +0000320 <target name="postProcess">
321 <condition property="logsAvailable">
david_williams8f11ee72007-06-30 08:22:55 +0000322 <istrue value="${javacVerbose}" />
323 </condition>
324 <antcall target="gatherLogs" />
david_williamsc84ab8c2006-12-11 18:50:34 +0000325
326 </target>
ndai91f5c9b2006-03-12 13:56:45 +0000327
328
david_williamsd913e922006-11-13 07:24:21 +0000329 <!-- ===================================================================== -->
330 <!-- Steps to do before running assemble. -->
331 <!-- ===================================================================== -->
332 <target name="preAssemble"></target>
ndai91f5c9b2006-03-12 13:56:45 +0000333
david_williamsd913e922006-11-13 07:24:21 +0000334 <!-- ===================================================================== -->
335 <!-- Steps to do after running assemble. -->
336 <!-- ===================================================================== -->
337 <target name="postAssemble"></target>
ndai91f5c9b2006-03-12 13:56:45 +0000338
david_williamsd913e922006-11-13 07:24:21 +0000339 <!-- ===================================================================== -->
340 <!-- Steps to do after the build is done. -->
341 <!-- ===================================================================== -->
342 <target name="postBuild"></target>
ndai91f5c9b2006-03-12 13:56:45 +0000343
david_williams518a8692006-04-29 19:34:27 +0000344
david_williamsd913e922006-11-13 07:24:21 +0000345 <!-- ===================================================================== -->
346 <!-- Steps to test the build results -->
347 <!-- ===================================================================== -->
348 <target
349 name="test"
350 unless="dontRunTests">
351 <property
352 name="eclipseAutomatedTestHome"
david_williamseb49d082007-05-01 03:03:15 +0000353 value="${buildDirectory}/plugins/org.eclipse.jpt.utility.tests" />
ndai91f5c9b2006-03-12 13:56:45 +0000354
david_williams403beae2007-12-09 02:10:40 +0000355 <echo
356 level="info"
357 message="Setting up tests in ${eclipseAutomatedTestHome}" />
ndai91f5c9b2006-03-12 13:56:45 +0000358
david_williamsd913e922006-11-13 07:24:21 +0000359 <copy
david_williamseb49d082007-05-01 03:03:15 +0000360 file="${buildDirectory}/${buildLabel}/wtp-jpt-${buildLabel}.zip"
361 tofile="${eclipseAutomatedTestHome}/eclipse-SDK-wtp-jpt-${buildLabel}.zip" />
david_williamsd913e922006-11-13 07:24:21 +0000362 <copy
david_williamseb49d082007-05-01 03:03:15 +0000363 file="${buildDirectory}/${buildLabel}/wtp-jpt-Automated-Tests-${buildLabel}.zip"
364 tofile="${eclipseAutomatedTestHome}/eclipse-junit-tests-wtp-jpt-${buildLabel}.zip" />
ndai91f5c9b2006-03-12 13:56:45 +0000365
david_williamsd913e922006-11-13 07:24:21 +0000366 <ant
367 antfile="${eclipseAutomatedTestHome}/test.xml"
368 target="run"
369 dir="${eclipseAutomatedTestHome}">
370 <property
371 name="os"
372 value="${baseos}" />
373 <property
374 name="ws"
375 value="${basews}" />
376 <property
377 name="arch"
378 value="${basearch}" />
379 <property
380 name="eclipse-home"
381 value="${baseLocation}" />
382 </ant>
ndai91f5c9b2006-03-12 13:56:45 +0000383
david_williamsd913e922006-11-13 07:24:21 +0000384 </target>
ndai91f5c9b2006-03-12 13:56:45 +0000385
david_williamsd913e922006-11-13 07:24:21 +0000386 <!-- ===================================================================== -->
387 <!-- Steps to do to publish the build results -->
388 <!-- ===================================================================== -->
389 <target name="publish"></target>
390
david_williams0b74c592007-04-09 06:11:35 +0000391
392
david_williamsc84ab8c2006-12-11 18:50:34 +0000393 <!-- ===================================================================== -->
394 <!-- Helper targets -->
395 <!-- ===================================================================== -->
396 <target
397 name="gatherLogs"
398 if="logsAvailable">
399 <mkdir dir="${buildDirectory}/${buildLabel}/testcompilelogs" />
david_williams403beae2007-12-09 02:10:40 +0000400 <echo
401 level="debug"
402 message="logExtension: ${logExtension}" />
david_williamsc84ab8c2006-12-11 18:50:34 +0000403 <antcall target="allElements">
404 <param
405 name="target"
406 value="gatherLogs" />
david_williams803b3cd2007-12-13 07:37:16 +0000407 <param
408 name="logExtension"
409 value="${logExtension}" />
david_williamsc84ab8c2006-12-11 18:50:34 +0000410 </antcall>
david_williamsc84ab8c2006-12-11 18:50:34 +0000411 <unzip
412 dest="${buildDirectory}/${buildLabel}/testcompilelogs"
413 overwrite="true">
david_williams8f11ee72007-06-30 08:22:55 +0000414 <fileset
415 dir="${buildDirectory}/features/org.eclipse.jpt.tests">
david_williamsc84ab8c2006-12-11 18:50:34 +0000416 <include name="**/*.log.zip" />
417 </fileset>
418 </unzip>
david_williamsc84ab8c2006-12-11 18:50:34 +0000419 </target>
420
421 <target
422 name="clean"
423 unless="noclean">
424 <antcall target="allElements">
425 <param
426 name="target"
427 value="cleanElement" />
428 </antcall>
429 </target>
david_williams0b74c592007-04-09 06:11:35 +0000430
david_williamsd913e922006-11-13 07:24:21 +0000431 <!-- ===================================================================== -->
432 <!-- Default target -->
433 <!-- ===================================================================== -->
434 <target name="noDefault">
david_williams403beae2007-12-09 02:10:40 +0000435 <echo
436 level="error"
david_williams8f11ee72007-06-30 08:22:55 +0000437 message="You must specify a target when invoking this file" />
david_williamsd913e922006-11-13 07:24:21 +0000438 </target>
ndai91f5c9b2006-03-12 13:56:45 +0000439
440</project>