blob: 795b7a31ef4047ce1cb75b70eab202e467e51934 [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=".">
david_williamsd913e922006-11-13 07:24:21 +00005
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"
30 value="${env.WTP_CVS_PROTOCOL}" />
31 <property
32 name="cvsUser"
33 value="${env.WTP_CVS_USER}" />
34 <property
35 name="cvsServer"
36 value="${env.WTP_CVS_SERVER}" />
37 <property
38 name="cvsRoot"
39 value="${env.WTP_CVS_ROOT}" />
40
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="component: ${component}" />
55 <echo
56 level="debug"
57 message="buildDirectory: ${buildDirectory}" />
58 <echo
59 level="debug"
60 message="baseLocation: ${baseLocation}" />
61 <echo
62 level="debug"
63 message="generic target: ${genericTargets}" />
david_williamsd913e922006-11-13 07:24:21 +000064 <ant
65 antfile="${genericTargets}"
66 target="${target}">
67 <property
68 name="type"
69 value="feature" />
70 <property
71 name="id"
72 value="org.eclipse.wst.sdk" />
73 </ant>
74 </target>
75
76 <!-- ===================================================================== -->
77 <!-- Targets to assemble the built elements for particular configurations -->
78 <!-- These generally call the generated assemble scripts (named in -->
79 <!-- ${assembleScriptName}) but may also add pre and post processing -->
80 <!-- Add one target for each root element and each configuration -->
81 <!-- ===================================================================== -->
82
83 <target name="assemble.org.eclipse.wst.sdk">
84 <property
85 name="archiveName"
86 value="wtp-wst-sdk-${buildLabel}.zip" />
87 <ant
88 antfile="${assembleScriptName}"
89 dir="${buildDirectory}" />
90 </target>
91
92 <target name="prePackage" />
93
94 <target name="postPackage">
95
96 <property
97 name="archiveName"
98 value="wtp-wst-sdk-${buildLabel}.zip" />
99
100 <ant
101 antfile="${wtp.builder.home}/scripts/build/buildutilities.xml"
102 target="unpackUpdateJarsAndCreateZippedPackages">
103 <property
104 name="buildDirectory"
105 value="${buildDirectory}" />
106 <property
107 name="buildLabel"
108 value="${buildLabel}" />
109 <property
110 name="archiveName"
111 value="${archiveName}" />
112 </ant>
113
david_williams1cff0e92006-11-23 00:40:29 +0000114 <ant
115 antfile="${wtp.builder.home}/scripts/build/buildutilities.xml"
116 target="createChecksums">
117 <property
118 name="buildDirectory"
119 value="${buildDirectory}" />
120 <property
121 name="buildLabel"
122 value="${buildLabel}" />
123 <property
124 name="archiveName"
125 value="${archiveName}" />
126 </ant>
127
128
129
david_williamsd913e922006-11-13 07:24:21 +0000130 </target>
131
132 <!-- ===================================================================== -->
133 <!-- Check out map files from correct repository -->
134 <!-- Replace values for cvsRoot, package and mapVersionTag as desired. -->
135 <!-- ===================================================================== -->
david_williams403beae2007-12-09 02:10:40 +0000136 <target
137 name="checkLocal"
138 depends="check.useLocalMaps"
139 if="useLocalMaps">
david_williamsd913e922006-11-13 07:24:21 +0000140 <available
141 property="mapsLocal"
david_williams34163522007-11-18 00:18:20 +0000142 file="${buildDirectory}/maps/${env.RELENG}" />
david_williamsd913e922006-11-13 07:24:21 +0000143 </target>
144 <target
145 name="getMapFiles"
146 depends="checkLocal"
147 unless="mapsLocal">
148
149 <!-- *** change the repo info -->
150 <property
151 name="mapCvsRoot"
152 value=":${cvsProtocol}:${cvsUser}@${cvsServer}:${cvsRoot}" />
david_williams5d9c9862007-11-19 04:42:55 +0000153
154 <!-- if not otherwise set, assume HEAD -->
david_williamsd913e922006-11-13 07:24:21 +0000155 <property
156 name="mapVersionTag"
157 value="HEAD" />
david_williams403beae2007-12-09 02:10:40 +0000158
159 <echo
160 level="info"
161 message="${mapCvsRoot} ${mapVersionTag} ">
162 </echo>
david_williamsd913e922006-11-13 07:24:21 +0000163 <property
164 name="cvsPackage"
david_williams5d9c9862007-11-19 04:42:55 +0000165 value="${env.RELENGMAPS}" />
david_williams403beae2007-12-09 02:10:40 +0000166 <echo
167 level="debug"
168 message="${mapCvsRoot} ${mapVersionTag} " />
169 <echo
170 level="debug"
171 message="cvsPackage = ${cvsPackage} " />
david_williamsd913e922006-11-13 07:24:21 +0000172 <cvs
173 cvsRoot="${mapCvsRoot}"
174 package="${cvsPackage}"
175 dest="${buildDirectory}/maps"
david_williamsa3e48362007-08-22 04:21:50 +0000176 tag="${mapVersionTag}"
177 quiet="${env.CVS_QUIET}"
178 reallyquiet="${env.CVS_REALLY_QUIET}" />
david_williams403beae2007-12-09 02:10:40 +0000179 <!--
180 <cvs
181 cvsRoot="${mapCvsRoot}"
182 package="${env.RELENGMAPS}"
183 dest="${buildDirectory}/maps"
184 tag="${mapVersionTag}"
185 quiet="${env.CVS_QUIET}"
186 reallyquiet="${env.CVS_REALLY_QUIET}" />
187 -->
david_williams5d9c9862007-11-19 04:42:55 +0000188
david_williamsd913e922006-11-13 07:24:21 +0000189 <!--tag the map files project-->
190 <antcall target="tagMapFiles">
191 <param
192 name="mapCvsRoot"
193 value="${mapCvsRoot}" />
194 </antcall>
david_williams5d9c9862007-11-19 04:42:55 +0000195
david_williams403beae2007-12-09 02:10:40 +0000196 <!-- copy all maps to the same place. Be sure to copy only "maps", as there may be "dependancies" etc,
197 that could be out of date -->
198 <!-- turns out this "one flat directory" appears not needed!
199 <copy todir="${buildDirectory}/maps/${env.RELENG}/maps" flatten="true">
200 <fileset dir="${buildDirectory}/maps/">
201 <include name="**/*.map" />
202 </fileset>
203 </copy>
204 -->
david_williams5d9c9862007-11-19 04:42:55 +0000205
david_williamsd913e922006-11-13 07:24:21 +0000206 </target>
207
208 <target
209 name="tagMapFiles"
210 if="tagMaps">
211 <cvs
212 cvsRoot="${mapCvsRoot}"
213 dest="${buildDirectory}/maps"
david_williamsa3e48362007-08-22 04:21:50 +0000214 command="tag v${buildType}${timestamp}"
215 quiet="${env.CVS_QUIET}"
216 reallyquiet="${env.CVS_REALLY_QUIET}" />
david_williamsd913e922006-11-13 07:24:21 +0000217 </target>
david_williamsf9aae9f2006-05-26 23:58:24 +0000218
ndaib8cedc82005-09-13 18:00:32 +0000219
david_williamsd913e922006-11-13 07:24:21 +0000220 <!-- ===================================================================== -->
221 <!-- Steps to do before setup -->
222 <!-- ===================================================================== -->
223 <target name="preSetup"></target>
david_williamsa0aec8e2006-05-23 00:29:00 +0000224
david_williamsd913e922006-11-13 07:24:21 +0000225 <!-- ===================================================================== -->
226 <!-- Steps to do after setup but before starting the build proper -->
227 <!-- ===================================================================== -->
228 <target name="postSetup">
229 <dirname
230 file="${ant.file}"
231 property="component.dir" />
david_williams403beae2007-12-09 02:10:40 +0000232 <echo
233 level="debug"
234 message="ant.file: ${ant.file}" />
235 <echo
236 level="debug"
237 message="component.dir: ${component.dir}" />
david_williamsa0aec8e2006-05-23 00:29:00 +0000238
david_williamsd913e922006-11-13 07:24:21 +0000239 <ant
240 antfile="${component.dir}/dependency.xml"
241 target="get">
242 <property
243 name="dependency.properties"
david_williams771c0a12007-11-17 02:19:01 +0000244 value="${buildDirectory}/maps/${env.RELENG}/maps/dependencies.properties" />
david_williamsd913e922006-11-13 07:24:21 +0000245 <property
246 name="base.install.dir"
247 value="${buildRoot}" />
248 </ant>
david_williamsa0aec8e2006-05-23 00:29:00 +0000249
david_williamsd913e922006-11-13 07:24:21 +0000250 </target>
david_williamsa0aec8e2006-05-23 00:29:00 +0000251
david_williamsd913e922006-11-13 07:24:21 +0000252 <!-- ===================================================================== -->
253 <!-- Steps to do before fetching the build elements -->
254 <!-- ===================================================================== -->
255 <target name="preFetch"></target>
david_williamsa0aec8e2006-05-23 00:29:00 +0000256
david_williamsd913e922006-11-13 07:24:21 +0000257 <!-- ===================================================================== -->
258 <!-- Steps to do after fetching the build elements -->
259 <!-- ===================================================================== -->
260 <target name="postFetch"></target>
david_williamsa0aec8e2006-05-23 00:29:00 +0000261
david_williamsd913e922006-11-13 07:24:21 +0000262 <!-- ===================================================================== -->
263 <!-- Steps to do before generating the build scripts. -->
264 <!-- ===================================================================== -->
david_williams0b74c592007-04-09 06:11:35 +0000265 <target name="postGenerate">
david_williamsa3e48362007-08-22 04:21:50 +0000266 <customizeAccessRules
267 bundleDirectory="${buildDirectory}/plugins"
268 defaultRules="+org/eclipse/wst/**/*, +org/eclipse/jst/**/*" />
david_williams0b74c592007-04-09 06:11:35 +0000269 </target>
david_williamsd913e922006-11-13 07:24:21 +0000270 <!-- ===================================================================== -->
271 <!-- Steps to do after generating the build scripts. -->
272 <!-- ===================================================================== -->
david_williams0b74c592007-04-09 06:11:35 +0000273 <target name="preGenerate"></target>
david_williamsa0aec8e2006-05-23 00:29:00 +0000274
275
david_williamsd913e922006-11-13 07:24:21 +0000276 <!-- ===================================================================== -->
277 <!-- Steps to do before running the build.xmls for the elements being built. -->
278 <!-- ===================================================================== -->
279 <target name="preProcess">
280 <replace
281 dir="${buildDirectory}/plugins"
282 value="${timestamp}"
283 token="@build@">
284 <include name="**/about.mappings" />
285 </replace>
286 </target>
david_williamsa0aec8e2006-05-23 00:29:00 +0000287
david_williamsd913e922006-11-13 07:24:21 +0000288 <!-- ===================================================================== -->
289 <!-- Steps to do after running the build.xmls for the elements being built. -->
290 <!-- ===================================================================== -->
291 <target name="postProcess">
david_williamsa3e48362007-08-22 04:21:50 +0000292 <condition property="logsAvailable">
david_williamsd913e922006-11-13 07:24:21 +0000293 <istrue value="${javacVerbose}" />
294 </condition>
david_williamsa3e48362007-08-22 04:21:50 +0000295 <antcall target="gatherLogs" />
david_williamsd913e922006-11-13 07:24:21 +0000296 </target>
ndaib8cedc82005-09-13 18:00:32 +0000297
298
david_williamsd913e922006-11-13 07:24:21 +0000299 <!-- ===================================================================== -->
300 <!-- Steps to do before running assemble. -->
david_williams7ebe2242007-09-06 02:10:39 +0000301 <!-- Note: in version 2.0 (and previous) we need to build the
302 explorer war file by invoking script. In 3.0 forward, we do not,
303 so this simple existence check allows us to use the same script for
304 both streams -->
david_williamsd913e922006-11-13 07:24:21 +0000305 <!-- ===================================================================== -->
david_williams7ebe2242007-09-06 02:10:39 +0000306 <property
307 name="buildwarfilename"
308 value="${buildDirectory}/plugins/org.eclipse.wst.ws.explorer/build-war.xml" />
309 <target
310 name="preAssemble"
311 depends="buildwar">
312 </target>
313
314 <target name="checkForBuildFile">
315 <condition property="buildFileExists">
316 <available file="${buildwarfilename}" />
317 </condition>
318 </target>
319
320 <target
321 name="buildwar"
322 depends="checkForBuildFile"
323 if="buildFileExists">
324 <ant antfile="${buildwarfilename}">
david_williams1cff0e92006-11-23 00:40:29 +0000325 <property
326 name="baseLocation"
327 value="${baseLocation}" />
328 <property
329 name="basedir"
330 value="${buildDirectory}/plugins/org.eclipse.wst.ws.explorer" />
331 <property
332 name="buildDirectory"
333 value="${buildDirectory}" />
334 </ant>
335 </target>
ndaib8cedc82005-09-13 18:00:32 +0000336
david_williamsd913e922006-11-13 07:24:21 +0000337 <!-- ===================================================================== -->
338 <!-- Steps to do after running assemble. -->
339 <!-- ===================================================================== -->
340 <target name="postAssemble">
ndaib8cedc82005-09-13 18:00:32 +0000341
david_williamsd913e922006-11-13 07:24:21 +0000342 </target>
ndaib8cedc82005-09-13 18:00:32 +0000343
david_williamsd913e922006-11-13 07:24:21 +0000344 <!-- ===================================================================== -->
345 <!-- Steps to do after the build is done. -->
346 <!-- ===================================================================== -->
347 <target name="postBuild"></target>
ndaib8cedc82005-09-13 18:00:32 +0000348
david_williamsd913e922006-11-13 07:24:21 +0000349 <!-- ===================================================================== -->
350 <!-- Steps to do to test the build results -->
351 <!-- ===================================================================== -->
352 <target name="test"></target>
ndaib8cedc82005-09-13 18:00:32 +0000353
david_williamsd913e922006-11-13 07:24:21 +0000354 <!-- ===================================================================== -->
355 <!-- Steps to do to publish the build results -->
356 <!-- ===================================================================== -->
357 <target name="publish"></target>
ndaib8cedc82005-09-13 18:00:32 +0000358
david_williamsd913e922006-11-13 07:24:21 +0000359 <!-- ===================================================================== -->
360 <!-- Helper targets -->
361 <!-- ===================================================================== -->
362 <target
363 name="gatherLogs"
364 if="logsAvailable">
365 <mkdir dir="${buildDirectory}/${buildLabel}/compilelogs" />
david_williams403beae2007-12-09 02:10:40 +0000366 <echo
367 level="debug"
368 message="logExtension: ${logExtension}" />
david_williamsd913e922006-11-13 07:24:21 +0000369 <antcall target="allElements">
370 <param
371 name="target"
372 value="gatherLogs" />
david_williams803b3cd2007-12-13 07:37:16 +0000373 <param
374 name="logExtension"
375 value="${logExtension}" />
david_williamsd913e922006-11-13 07:24:21 +0000376 </antcall>
david_williamsd913e922006-11-13 07:24:21 +0000377 <unzip
378 dest="${buildDirectory}/${buildLabel}/compilelogs"
379 overwrite="true">
david_williamsa3e48362007-08-22 04:21:50 +0000380 <fileset
381 dir="${buildDirectory}/features/org.eclipse.wst.sdk">
david_williamsd913e922006-11-13 07:24:21 +0000382 <include name="**/*.log.zip" />
383 </fileset>
384 </unzip>
david_williams1cff0e92006-11-23 00:40:29 +0000385
david_williams0b74c592007-04-09 06:11:35 +0000386
david_williams1cff0e92006-11-23 00:40:29 +0000387 <!-- workaround: see https://bugs.eclipse.org/bugs/show_bug.cgi?id=156043 -->
388 <copy
389 todir="${buildDirectory}/${buildLabel}/compilelogs"
390 overwrite="true">
391 <fileset
392 dir="${buildDirectory}/features/org.eclipse.wst.common_ui.feature/feature.temp.folder" />
393 </copy>
394
395 <copy
396 todir="${buildDirectory}/${buildLabel}/compilelogs"
397 overwrite="true">
398 <fileset
399 dir="${buildDirectory}/features/org.eclipse.wst.server_ui.feature/feature.temp.folder" />
400 </copy>
401
402 <copy
403 todir="${buildDirectory}/${buildLabel}/compilelogs"
404 overwrite="true">
405 <fileset
406 dir="${buildDirectory}/features/org.eclipse.wst.xml_ui.feature/feature.temp.folder" />
407 </copy>
408
409 <copy
410 todir="${buildDirectory}/${buildLabel}/compilelogs"
411 overwrite="true">
412 <fileset
413 dir="${buildDirectory}/features/org.eclipse.wst.ws_ui.feature/feature.temp.folder" />
414 </copy>
415
416 <copy
417 todir="${buildDirectory}/${buildLabel}/compilelogs"
418 overwrite="true">
419 <fileset
420 dir="${buildDirectory}/features/org.eclipse.wst.web_ui.feature/feature.temp.folder" />
421 </copy>
422
david_williamsd913e922006-11-13 07:24:21 +0000423 </target>
ndaib8cedc82005-09-13 18:00:32 +0000424
david_williamsd913e922006-11-13 07:24:21 +0000425 <target
426 name="clean"
427 unless="noclean">
428 <antcall target="allElements">
429 <param
430 name="target"
431 value="cleanElement" />
432 </antcall>
433 </target>
ndaib8cedc82005-09-13 18:00:32 +0000434
david_williamsd913e922006-11-13 07:24:21 +0000435 <!-- ===================================================================== -->
436 <!-- Default target -->
437 <!-- ===================================================================== -->
438 <target name="noDefault">
david_williams403beae2007-12-09 02:10:40 +0000439 <echo
440 level="error"
david_williamsa3e48362007-08-22 04:21:50 +0000441 message="You must specify a target when invoking this file" />
david_williamsd913e922006-11-13 07:24:21 +0000442 </target>
ndaib8cedc82005-09-13 18:00:32 +0000443
david_williams403beae2007-12-09 02:10:40 +0000444 <target name="check.useLocalMaps">
445 <condition property="useLocalMaps">
446 <equals
447 arg1="${env.USE_LOCAL_MAPS}"
448 arg2="true" />
449 </condition>
david_williams5d9c9862007-11-19 04:42:55 +0000450 </target>
451
ndaib8cedc82005-09-13 18:00:32 +0000452</project>