blob: 78675c4dcb8fbe9606cbe8f59650f18dc5e99a70 [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=".">
ndaib8cedc82005-09-13 18:00:32 +00005
david_williams886167e2007-12-13 04:42:37 +00006 <!-- = = = standard properties pattern = = = -->
7
8 <!--
9 Note to be cross-platform, "environment variables" are only appropriate for
10 some variables, e.g. ones we set, since properties are case sensitive, even if
11 the environment variables on your operating system are not, e.g. it will
12 be ${env.Path} not ${env.PATH} on Windows -->
david_williamsa3e48362007-08-22 04:21:50 +000013 <property environment="env" />
14
david_williams886167e2007-12-13 04:42:37 +000015 <!--
16 Let users override standard properties, if desired.
17 If directory, file, or some properties do not exist,
18 then standard properties will be used.
19 -->
20 <property
21 file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties" />
22
23 <!-- let this project specify properties, if not already set -->
24 <property file="build.properties" />
25
david_williams6eea8e02008-01-02 08:43:37 +000026 <fail unless="buildDirectory" message="buildDirectory must be set" />
27 <echo message="buildDirectory: ${buildDirectory}" />
david_williams886167e2007-12-13 04:42:37 +000028
29 <property
30 name="cvsProtocol"
david_williamsd4b1fd32008-01-02 04:16:52 +000031 value="${env.BUILD_CVS_WRITE_PROTOCOL}" />
david_williams886167e2007-12-13 04:42:37 +000032 <property
33 name="cvsUser"
david_williamsd4b1fd32008-01-02 04:16:52 +000034 value="${env.BUILD_CVS_WRITE_USER}" />
david_williams886167e2007-12-13 04:42:37 +000035 <property
36 name="cvsServer"
david_williamsd4b1fd32008-01-02 04:16:52 +000037 value="${env.BUILD_CVS_SERVER}" />
david_williams886167e2007-12-13 04:42:37 +000038 <property
39 name="cvsRoot"
david_williamsd4b1fd32008-01-02 04:16:52 +000040 value="${env.BUILD_CVS_ROOT}" />
david_williams886167e2007-12-13 04:42:37 +000041
david_williams3696f6f2005-12-30 07:59:43 +000042 <!-- ===================================================================== -->
43 <!-- Run a given ${target} on all elements being built -->
44 <!-- Add on <ant> task for each top level element being built. -->
45 <!-- ===================================================================== -->
46 <target name="allElements">
david_williams403beae2007-12-09 02:10:40 +000047 <echo
48 level="info"
49 message="Target:${target} " />
50 <echo
51 level="debug"
52 message="basedir: ${basedir}" />
53 <echo
54 level="debug"
55 message="component: ${component}" />
56 <echo
57 level="debug"
58 message="buildDirectory: ${buildDirectory}" />
59 <echo
60 level="debug"
61 message="baseLocation: ${baseLocation}" />
62 <echo
63 level="debug"
64 message="generic target: ${genericTargets}" />
david_williamsd913e922006-11-13 07:24:21 +000065 <ant
66 antfile="${genericTargets}"
67 target="${target}">
68 <property
69 name="type"
70 value="feature" />
71 <property
72 name="id"
73 value="org.eclipse.wst" />
david_williams3696f6f2005-12-30 07:59:43 +000074 </ant>
75 </target>
ndaib8cedc82005-09-13 18:00:32 +000076
david_williams3696f6f2005-12-30 07:59:43 +000077 <!-- ===================================================================== -->
78 <!-- Targets to assemble the built elements for particular configurations -->
79 <!-- These generally call the generated assemble scripts (named in -->
80 <!-- ${assembleScriptName}) but may also add pre and post processing -->
81 <!-- Add one target for each root element and each configuration -->
82 <!-- ===================================================================== -->
ndaib8cedc82005-09-13 18:00:32 +000083
david_williams3696f6f2005-12-30 07:59:43 +000084 <target name="assemble.org.eclipse.wst">
david_williamsd913e922006-11-13 07:24:21 +000085 <property
86 name="archiveName"
87 value="wtp-wst-${buildLabel}.zip" />
88 <ant
89 antfile="${assembleScriptName}"
90 dir="${buildDirectory}" />
ndaib8cedc82005-09-13 18:00:32 +000091
david_williamsa0aec8e2006-05-23 00:29:00 +000092 </target>
93
94 <target name="prePackage" />
95
96 <target name="postPackage">
david_williamsd913e922006-11-13 07:24:21 +000097 <property
98 name="archiveName"
99 value="wtp-wst-${buildLabel}.zip" />
david_williamsa0aec8e2006-05-23 00:29:00 +0000100
david_williamsd913e922006-11-13 07:24:21 +0000101 <ant
102 antfile="${wtp.builder.home}/scripts/build/buildutilities.xml"
103 target="unpackUpdateJarsAndCreateZippedPackages">
104 <property
105 name="buildDirectory"
106 value="${buildDirectory}" />
107 <property
108 name="buildLabel"
109 value="${buildLabel}" />
110 <property
111 name="archiveName"
112 value="${archiveName}" />
113 </ant>
david_williams0b74c592007-04-09 06:11:35 +0000114
david_williams1cff0e92006-11-23 00:40:29 +0000115 <ant
116 antfile="${wtp.builder.home}/scripts/build/buildutilities.xml"
117 target="createChecksums">
118 <property
119 name="buildDirectory"
120 value="${buildDirectory}" />
121 <property
122 name="buildLabel"
123 value="${buildLabel}" />
124 <property
125 name="archiveName"
126 value="${archiveName}" />
127 </ant>
128
129
david_williamsd913e922006-11-13 07:24:21 +0000130
david_williams3696f6f2005-12-30 07:59:43 +0000131 </target>
ndaib8cedc82005-09-13 18:00:32 +0000132
david_williams3696f6f2005-12-30 07:59:43 +0000133 <!-- ===================================================================== -->
134 <!-- Check out map files from correct repository -->
135 <!-- Replace values for cvsRoot, package and mapVersionTag as desired. -->
136 <!-- ===================================================================== -->
david_williams403beae2007-12-09 02:10:40 +0000137 <target
138 name="checkLocal"
139 depends="check.useLocalMaps"
140 if="useLocalMaps">
david_williamsd913e922006-11-13 07:24:21 +0000141 <available
142 property="mapsLocal"
david_williams34163522007-11-18 00:18:20 +0000143 file="${buildDirectory}/maps/${env.RELENG}" />
david_williams3696f6f2005-12-30 07:59:43 +0000144 </target>
david_williamsd913e922006-11-13 07:24:21 +0000145 <target
146 name="getMapFiles"
147 depends="checkLocal"
148 unless="mapsLocal">
ndaib8cedc82005-09-13 18:00:32 +0000149
david_williams3696f6f2005-12-30 07:59:43 +0000150 <!-- *** change the repo info -->
david_williamsd913e922006-11-13 07:24:21 +0000151 <property
152 name="mapCvsRoot"
153 value=":${cvsProtocol}:${cvsUser}@${cvsServer}:${cvsRoot}" />
david_williams403beae2007-12-09 02:10:40 +0000154
david_williams5d9c9862007-11-19 04:42:55 +0000155 <!-- if not otherwise set, assume HEAD -->
david_williamsd913e922006-11-13 07:24:21 +0000156 <property
157 name="mapVersionTag"
158 value="HEAD" />
david_williams403beae2007-12-09 02:10:40 +0000159
160
161 <echo
162 level="info"
163 message="${mapCvsRoot} ${mapVersionTag} ">
164 </echo>
david_williams1cff0e92006-11-23 00:40:29 +0000165 <property
166 name="cvsPackage"
david_williams5d9c9862007-11-19 04:42:55 +0000167 value="${env.RELENGMAPS}" />
david_williams403beae2007-12-09 02:10:40 +0000168 <echo
169 level="debug"
170 message="${mapCvsRoot} ${mapVersionTag} " />
171 <echo
172 level="debug"
173 message="cvsPackage = ${cvsPackage} " />
david_williams1cff0e92006-11-23 00:40:29 +0000174
david_williamsd913e922006-11-13 07:24:21 +0000175 <cvs
176 cvsRoot="${mapCvsRoot}"
david_williams1cff0e92006-11-23 00:40:29 +0000177 package="${cvsPackage}"
david_williamsd913e922006-11-13 07:24:21 +0000178 dest="${buildDirectory}/maps"
david_williamsa3e48362007-08-22 04:21:50 +0000179 tag="${mapVersionTag}"
180 quiet="${env.CVS_QUIET}"
181 reallyquiet="${env.CVS_REALLY_QUIET}" />
david_williams403beae2007-12-09 02:10:40 +0000182 <!--
183 <cvs
184 cvsRoot="${mapCvsRoot}"
185 package="${env.RELENGMAPS}"
186 dest="${buildDirectory}/maps"
187 tag="${mapVersionTag}"
188 quiet="${env.CVS_QUIET}"
189 reallyquiet="${env.CVS_REALLY_QUIET}" />
190 -->
david_williams5d9c9862007-11-19 04:42:55 +0000191
david_williams3696f6f2005-12-30 07:59:43 +0000192 <!--tag the map files project-->
193 <antcall target="tagMapFiles">
david_williamsd913e922006-11-13 07:24:21 +0000194 <param
195 name="mapCvsRoot"
196 value="${mapCvsRoot}" />
david_williams3696f6f2005-12-30 07:59:43 +0000197 </antcall>
david_williams5d9c9862007-11-19 04:42:55 +0000198
david_williams403beae2007-12-09 02:10:40 +0000199 <!-- copy all maps to the same place. Be sure to copy only "maps", as there may be "dependancies" etc,
200 that could be out of date -->
201 <!-- turns out this "one flat directory" appears not needed!
202 <copy todir="${buildDirectory}/maps/${env.RELENG}/maps" flatten="true">
203 <fileset dir="${buildDirectory}/maps/">
204 <include name="**/*.map" />
205 </fileset>
206 </copy>
207 -->
david_williams5d9c9862007-11-19 04:42:55 +0000208
209
210
david_williams3696f6f2005-12-30 07:59:43 +0000211 </target>
ndaib8cedc82005-09-13 18:00:32 +0000212
david_williamsd913e922006-11-13 07:24:21 +0000213 <target
214 name="tagMapFiles"
215 if="tagMaps">
216 <cvs
217 cvsRoot="${mapCvsRoot}"
218 dest="${buildDirectory}/maps"
david_williamsa3e48362007-08-22 04:21:50 +0000219 command="tag v${buildType}${timestamp}"
220 quiet="${env.CVS_QUIET}"
221 reallyquiet="${env.CVS_REALLY_QUIET}" />
david_williams3696f6f2005-12-30 07:59:43 +0000222 </target>
ndaib8cedc82005-09-13 18:00:32 +0000223
224
david_williams3696f6f2005-12-30 07:59:43 +0000225 <!-- ===================================================================== -->
226 <!-- Steps to do before setup -->
227 <!-- ===================================================================== -->
david_williamsd913e922006-11-13 07:24:21 +0000228 <target name="preSetup"></target>
ndaib8cedc82005-09-13 18:00:32 +0000229
david_williams3696f6f2005-12-30 07:59:43 +0000230 <!-- ===================================================================== -->
231 <!-- Steps to do after setup but before starting the build proper -->
232 <!-- ===================================================================== -->
233 <target name="postSetup">
david_williamsd913e922006-11-13 07:24:21 +0000234 <dirname
235 file="${ant.file}"
236 property="component.dir" />
david_williams403beae2007-12-09 02:10:40 +0000237 <echo
238 level="debug"
239 message="ant.file: ${ant.file}" />
240 <echo
241 level="debug"
242 message="component.dir: ${component.dir}" />
david_williams1cff0e92006-11-23 00:40:29 +0000243
david_williamsd913e922006-11-13 07:24:21 +0000244 <ant
245 antfile="${component.dir}/dependency.xml"
246 target="get">
247 <property
248 name="dependency.properties"
david_williams771c0a12007-11-17 02:19:01 +0000249 value="${buildDirectory}/maps/${env.RELENG}/maps/dependencies.properties" />
david_williamsd913e922006-11-13 07:24:21 +0000250 <property
251 name="base.install.dir"
252 value="${buildRoot}" />
david_williams3696f6f2005-12-30 07:59:43 +0000253 </ant>
ndaib8cedc82005-09-13 18:00:32 +0000254
david_williamsa3e48362007-08-22 04:21:50 +0000255
256
257
david_williams3696f6f2005-12-30 07:59:43 +0000258 </target>
ndaib8cedc82005-09-13 18:00:32 +0000259
david_williams3696f6f2005-12-30 07:59:43 +0000260 <!-- ===================================================================== -->
261 <!-- Steps to do before fetching the build elements -->
262 <!-- ===================================================================== -->
david_williamsd913e922006-11-13 07:24:21 +0000263 <target name="preFetch"></target>
ndaib8cedc82005-09-13 18:00:32 +0000264
david_williams3696f6f2005-12-30 07:59:43 +0000265 <!-- ===================================================================== -->
266 <!-- Steps to do after fetching the build elements -->
267 <!-- ===================================================================== -->
david_williamsd913e922006-11-13 07:24:21 +0000268 <target name="postFetch"></target>
ndaib8cedc82005-09-13 18:00:32 +0000269
david_williams3696f6f2005-12-30 07:59:43 +0000270 <!-- ===================================================================== -->
271 <!-- Steps to do before generating the build scripts. -->
272 <!-- ===================================================================== -->
david_williams0b74c592007-04-09 06:11:35 +0000273 <target name="postGenerate">
david_williamse9facbe2008-01-02 14:13:12 +0000274 <echo message="buildDirectory: ${buildDirectory}" />
david_williams490dd782008-01-02 14:30:42 +0000275 <taskdef name="customizeAccessRules" classname="org.eclipse.wtp.releng.tools.CustomizeAccessRules" />
276 <customizeAccessRules
david_williamsa3e48362007-08-22 04:21:50 +0000277 bundleDirectory="${buildDirectory}/plugins"
278 defaultRules="+org/eclipse/wst/**/*, +org/eclipse/jst/**/*" />
david_williams0b74c592007-04-09 06:11:35 +0000279 </target>
ndaib8cedc82005-09-13 18:00:32 +0000280
david_williams3696f6f2005-12-30 07:59:43 +0000281 <!-- ===================================================================== -->
282 <!-- Steps to do after generating the build scripts. -->
283 <!-- ===================================================================== -->
david_williams0b74c592007-04-09 06:11:35 +0000284 <target name="preGenerate"></target>
ndaib8cedc82005-09-13 18:00:32 +0000285
286
david_williams3696f6f2005-12-30 07:59:43 +0000287 <!-- ===================================================================== -->
288 <!-- Steps to do before running the build.xmls for the elements being built. -->
289 <!-- ===================================================================== -->
290 <target name="preProcess">
david_williamsd913e922006-11-13 07:24:21 +0000291 <replace
292 dir="${buildDirectory}/plugins"
293 value="${timestamp}"
294 token="@build@">
david_williams3696f6f2005-12-30 07:59:43 +0000295 <include name="**/about.mappings" />
296 </replace>
297 </target>
ndaib8cedc82005-09-13 18:00:32 +0000298
david_williams3696f6f2005-12-30 07:59:43 +0000299 <!-- ===================================================================== -->
300 <!-- Steps to do after running the build.xmls for the elements being built. -->
301 <!-- ===================================================================== -->
302 <target name="postProcess">
303 <condition property="logsAvailable">
304 <istrue value="${javacVerbose}" />
305 </condition>
david_williamsa3e48362007-08-22 04:21:50 +0000306 <antcall target="gatherLogs" />
david_williams3696f6f2005-12-30 07:59:43 +0000307 </target>
ndaib8cedc82005-09-13 18:00:32 +0000308
309
david_williams3696f6f2005-12-30 07:59:43 +0000310 <!-- ===================================================================== -->
311 <!-- Steps to do before running assemble. -->
david_williams7ebe2242007-09-06 02:10:39 +0000312 <!-- Note: in version 2.0 (and previous) we need to build the
313 explorer war file by invoking script. In 3.0 forward, we do not,
314 so this simple existence check allows us to use the same script for
315 both streams -->
david_williams3696f6f2005-12-30 07:59:43 +0000316 <!-- ===================================================================== -->
david_williams7ebe2242007-09-06 02:10:39 +0000317 <property
318 name="buildwarfilename"
319 value="${buildDirectory}/plugins/org.eclipse.wst.ws.explorer/build-war.xml" />
320 <target
321 name="preAssemble"
322 depends="buildwar">
323 </target>
324
325 <target name="checkForBuildFile">
326 <condition property="buildFileExists">
327 <available file="${buildwarfilename}" />
328 </condition>
329 </target>
330
331 <target
332 name="buildwar"
333 depends="checkForBuildFile"
334 if="buildFileExists">
335 <ant antfile="${buildwarfilename}">
336 <property
337 name="baseLocation"
338 value="${baseLocation}" />
339 <property
340 name="basedir"
341 value="${buildDirectory}/plugins/org.eclipse.wst.ws.explorer" />
342 <property
343 name="buildDirectory"
344 value="${buildDirectory}" />
345 </ant>
david_williams3696f6f2005-12-30 07:59:43 +0000346 </target>
ndaib8cedc82005-09-13 18:00:32 +0000347
david_williams3696f6f2005-12-30 07:59:43 +0000348 <!-- ===================================================================== -->
349 <!-- Steps to do after running assemble. -->
350 <!-- ===================================================================== -->
david_williams1cff0e92006-11-23 00:40:29 +0000351 <target name="postAssemble">
352
353 </target>
ndaib8cedc82005-09-13 18:00:32 +0000354
david_williams3696f6f2005-12-30 07:59:43 +0000355 <!-- ===================================================================== -->
356 <!-- Steps to do after the build is done. -->
357 <!-- ===================================================================== -->
david_williams1cff0e92006-11-23 00:40:29 +0000358 <target name="postBuild"></target>
ndaib8cedc82005-09-13 18:00:32 +0000359
david_williams3696f6f2005-12-30 07:59:43 +0000360 <!-- ===================================================================== -->
361 <!-- Steps to do to test the build results -->
362 <!-- ===================================================================== -->
david_williamsd913e922006-11-13 07:24:21 +0000363 <target name="test"></target>
ndaib8cedc82005-09-13 18:00:32 +0000364
david_williams3696f6f2005-12-30 07:59:43 +0000365 <!-- ===================================================================== -->
366 <!-- Steps to do to publish the build results -->
367 <!-- ===================================================================== -->
david_williamsd913e922006-11-13 07:24:21 +0000368 <target name="publish"></target>
ndaib8cedc82005-09-13 18:00:32 +0000369
david_williams3696f6f2005-12-30 07:59:43 +0000370 <!-- ===================================================================== -->
371 <!-- Helper targets -->
372 <!-- ===================================================================== -->
david_williamsd913e922006-11-13 07:24:21 +0000373 <target
374 name="gatherLogs"
375 if="logsAvailable">
david_williams3696f6f2005-12-30 07:59:43 +0000376 <mkdir dir="${buildDirectory}/${buildLabel}/compilelogs" />
david_williams403beae2007-12-09 02:10:40 +0000377 <echo
378 level="debug"
379 message="logExtension: ${logExtension}" />
david_williams3696f6f2005-12-30 07:59:43 +0000380 <antcall target="allElements">
david_williamsd913e922006-11-13 07:24:21 +0000381 <param
382 name="target"
383 value="gatherLogs" />
david_williams803b3cd2007-12-13 07:37:16 +0000384 <param
385 name="logExtension"
386 value="${logExtension}" />
david_williams3696f6f2005-12-30 07:59:43 +0000387 </antcall>
david_williamsd913e922006-11-13 07:24:21 +0000388 <unzip
389 dest="${buildDirectory}/${buildLabel}/compilelogs"
390 overwrite="true">
david_williams3696f6f2005-12-30 07:59:43 +0000391 <fileset dir="${buildDirectory}/features/org.eclipse.wst">
david_williams0bcf3432006-09-02 02:58:30 +0000392 <include name="**/*.log.zip" />
david_williams3696f6f2005-12-30 07:59:43 +0000393 </fileset>
394 </unzip>
david_williamsd757a552006-09-12 06:29:01 +0000395
david_williams0b74c592007-04-09 06:11:35 +0000396
david_williams295dfa92006-09-11 14:47:51 +0000397 <!-- workaround: see https://bugs.eclipse.org/bugs/show_bug.cgi?id=156043 -->
david_williamsd913e922006-11-13 07:24:21 +0000398 <copy
399 todir="${buildDirectory}/${buildLabel}/compilelogs"
400 overwrite="true">
401 <fileset
402 dir="${buildDirectory}/features/org.eclipse.wst.common_ui.feature/feature.temp.folder" />
david_williams295dfa92006-09-11 14:47:51 +0000403 </copy>
david_williamsd913e922006-11-13 07:24:21 +0000404
405 <copy
406 todir="${buildDirectory}/${buildLabel}/compilelogs"
407 overwrite="true">
408 <fileset
409 dir="${buildDirectory}/features/org.eclipse.wst.server_ui.feature/feature.temp.folder" />
david_williams295dfa92006-09-11 14:47:51 +0000410 </copy>
david_williamsd913e922006-11-13 07:24:21 +0000411
412 <copy
413 todir="${buildDirectory}/${buildLabel}/compilelogs"
414 overwrite="true">
415 <fileset
416 dir="${buildDirectory}/features/org.eclipse.wst.xml_ui.feature/feature.temp.folder" />
david_williams295dfa92006-09-11 14:47:51 +0000417 </copy>
david_williamsd913e922006-11-13 07:24:21 +0000418
419 <copy
420 todir="${buildDirectory}/${buildLabel}/compilelogs"
421 overwrite="true">
422 <fileset
423 dir="${buildDirectory}/features/org.eclipse.wst.ws_ui.feature/feature.temp.folder" />
david_williams295dfa92006-09-11 14:47:51 +0000424 </copy>
david_williamsd913e922006-11-13 07:24:21 +0000425
426 <copy
427 todir="${buildDirectory}/${buildLabel}/compilelogs"
428 overwrite="true">
429 <fileset
430 dir="${buildDirectory}/features/org.eclipse.wst.web_ui.feature/feature.temp.folder" />
david_williams295dfa92006-09-11 14:47:51 +0000431 </copy>
david_williamsd913e922006-11-13 07:24:21 +0000432
david_williams3696f6f2005-12-30 07:59:43 +0000433 </target>
434
david_williamsd913e922006-11-13 07:24:21 +0000435 <target
436 name="clean"
437 unless="noclean">
david_williams3696f6f2005-12-30 07:59:43 +0000438 <antcall target="allElements">
david_williamsd913e922006-11-13 07:24:21 +0000439 <param
440 name="target"
441 value="cleanElement" />
david_williams3696f6f2005-12-30 07:59:43 +0000442 </antcall>
443 </target>
444
445 <!-- ===================================================================== -->
446 <!-- Default target -->
447 <!-- ===================================================================== -->
448 <target name="noDefault">
david_williams403beae2007-12-09 02:10:40 +0000449 <echo
450 level="error"
david_williamsa3e48362007-08-22 04:21:50 +0000451 message="You must specify a target when invoking this file" />
david_williams3696f6f2005-12-30 07:59:43 +0000452 </target>
ndaib8cedc82005-09-13 18:00:32 +0000453
david_williams403beae2007-12-09 02:10:40 +0000454 <target name="check.useLocalMaps">
455 <condition property="useLocalMaps">
456 <equals
457 arg1="${env.USE_LOCAL_MAPS}"
458 arg2="true" />
459 </condition>
460 </target>
461
ndaib8cedc82005-09-13 18:00:32 +0000462</project>