blob: 0d5ee39b4159a7e0aae1ac54f2e461cca6c168df [file] [log] [blame]
tle557eaab2008-03-12 00:24:39 +00001<project
2 name="PDECustomTargets"
3 default="noDefault"
4 basedir=".">
5
6 <property
7 name="patchFeature"
8 value="org.eclipse.dali.patch.assembly.feature" />
9
10
11 <!-- = = = standard properties pattern = = = -->
12
13 <!--
14 Note to be cross-platform, "environment variables" are only appropriate for
15 some variables, e.g. ones we set, since properties are case sensitive, even if
16 the environment variables on your operating system are not, e.g. it will
17 be ${env.Path} not ${env.PATH} on Windows -->
18 <property environment="env" />
19
20 <!--
21 Let users override standard properties, if desired.
22 If directory, file, or some properties do not exist,
23 then standard properties will be used.
24 -->
25 <property
26 file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties" />
27
28 <!-- let this project specify properties, if not already set -->
29 <property file="build.properties" />
30
31 <fail unless="buildDirectory" message="buildDirectory must be set" />
32 <echo message="buildDirectory: ${buildDirectory}" />
33
34 <property
35 name="cvsProtocol"
36 value="${env.BUILD_CVS_WRITE_PROTOCOL}" />
37 <property
38 name="cvsUser"
39 value="${env.BUILD_CVS_WRITE_USER}" />
40 <property
41 name="cvsServer"
42 value="${env.BUILD_CVS_SERVER}" />
43 <property
44 name="cvsRoot"
45 value="${env.BUILD_CVS_ROOT}" />
46
47 <!-- ===================================================================== -->
48 <!-- Run a given ${target} on all elements being built -->
49 <!-- Add on <ant> task for each top level element being built. -->
50 <!-- ===================================================================== -->
51 <target name="allElements">
52 <echo
53 level="info"
54 message="Target: ${target} " />
55 <echo
56 level="debug"
57 message="basedir: ${basedir}" />
58 <echo
59 level="debug"
60 message="component: ${component}" />
61 <echo
62 level="debug"
63 message="buildDirectory: ${buildDirectory}" />
64 <echo
65 level="debug"
66 message="baseLocation: ${baseLocation}" />
67 <echo
68 level="debug"
69 message="patchFeature: ${patchFeature}" />
70 <ant
71 antfile="${genericTargets}"
72 target="${target}">
73 <property
74 name="type"
75 value="feature" />
76 <property
77 name="id"
78 value="${patchFeature}" />
79 </ant>
80 </target>
81
82
83 <!-- ===================================================================== -->
84 <!-- Targets to assemble the built elements for particular configurations -->
85 <!-- These generally call the generated assemble scripts (named in -->
86 <!-- ${assembleScriptName}) but may also add pre and post processing -->
87 <!-- Add one target for each root element and each configuration -->
88 <!-- ===================================================================== -->
89
90 <target name="assemble.org.eclipse.dali.patch.assembly.feature">
91 <property
92 name="archiveName"
93 value="wtp-jpt-${buildLabel}.zip" />
94 <ant
95 antfile="${assembleScriptName}"
96 dir="${buildDirectory}" />
97 </target>
98
99 <target name="prePackage" />
100
101 <target name="postPackage">
102 <property
103 name="archiveName"
104 value="wtp-jpt-${buildLabel}.zip" />
105
106 <ant
107 antfile="${wtp.builder.home}/scripts/build/buildutilities.xml"
108 target="unpackUpdateJarsAndCreateZippedPackages">
109 <property
110 name="buildDirectory"
111 value="${buildDirectory}" />
112 <property
113 name="buildLabel"
114 value="${buildLabel}" />
115 <property
116 name="archiveName"
117 value="${archiveName}" />
118 </ant>
119
120 </target>
121
122 <!-- ===================================================================== -->
123 <!-- Check out map files from correct repository -->
124 <!-- Replace values for cvsRoot, package and mapVersionTag as desired. -->
125 <!-- ===================================================================== -->
126 <target name="checkLocal">
127 <available
128 property="mapsLocal"
129 file="${buildDirectory}/maps/${env.RELENGDALI}" />
130 </target>
131
132 <target
133 name="getMapFiles"
134 depends="checkLocal"
135 unless="mapsLocal">
136
137 <!-- *** change the repo info -->
138 <property
139 name="mapCvsRoot"
140 value=":${cvsProtocol}:${cvsUser}@${cvsServer}:${cvsRoot}" />
141
142 <!-- if not otherwise set, assume HEAD -->
143 <property
144 name="mapVersionTag"
145 value="HEAD" />
146 <property
147 name="releng.dali-mapVersionTag"
148 value="HEAD" />
149
150 <!-- get releng maps -->
151 <antcall target="checkOutMaps">
152 <param
153 name="cvsPackage"
154 value="${env.RELENG}" />
155 <param
156 name="versionTagParam"
157 value="${mapVersionTag}" />
158 </antcall>
159
160 <!-- get releng.dali/maps -->
161 <antcall target="checkOutMaps">
162 <param
163 name="cvsPackage"
164 value="${env.RELENGDALI}" />
165 <param
166 name="versionTagParam"
167 value="${releng.dali-mapVersionTag}" />
168 </antcall>
169
170 <!-- tag the map files project -->
171 <antcall target="tagMapFiles">
172 <param
173 name="mapCvsRoot"
174 value="${mapCvsRoot}" />
175 </antcall>
176 </target>
177
178 <!-- ===================================================================== -->
179 <!-- Check out the cvsPackage -->
180 <!-- ===================================================================== -->
181 <target name="checkOutMaps">
182 <echo
183 level="info"
184 message="mapCvsRoot: ${mapCvsRoot}" />
185 <echo
186 level="info"
187 message="cvsPackage = ${cvsPackage} " />
188 <echo
189 level="info"
190 message="versionTagParam: ${versionTagParam}" />
191 <cvs
192 cvsRoot="${mapCvsRoot}"
193 package="${cvsPackage}"
194 dest="${buildDirectory}/maps"
195 tag="${versionTagParam}"
196 quiet="${env.CVS_QUIET}"
197 reallyquiet="${env.CVS_REALLY_QUIET}" />
198 </target>
199
200 <!-- ===================================================================== -->
201 <!-- Tag Map Files mapCvsRoot -->
202 <!-- ===================================================================== -->
203 <target
204 name="tagMapFiles"
205 if="tagMaps">
206 <cvs
207 cvsRoot="${mapCvsRoot}"
208 dest="${buildDirectory}/maps"
209 command="tag v${buildType}${timestamp}"
210 quiet="${env.CVS_QUIET}"
211 reallyquiet="${env.CVS_REALLY_QUIET}" />
212 </target>
213
214 <!-- ===================================================================== -->
215 <!-- Steps to do before setup -->
216 <!-- ===================================================================== -->
217 <target name="preSetup"></target>
218
219 <!-- ===================================================================== -->
220 <!-- Steps to do after setup but before starting the build proper -->
221 <!-- ===================================================================== -->
222 <target name="postSetup">
223 <dirname
224 file="${ant.file}"
225 property="component.dir" />
226 <echo
227 level="debug"
228 message="ant.file: ${ant.file}" />
229 <echo
230 level="debug"
231 message="component.dir: ${component.dir}" />
232
233 <condition
234 property="daliLocalBuild"
235 value="true">
236 <equals
237 arg1="${build.distribution}"
238 arg2="dali"
239 casesensitive="false"
240 trim="true" />
241 </condition>
242
243 <!-- Get the dependencies -->
244 <antcall target="getDependencies" />
245
246 <!-- Get Dali dependencies -->
247 <!-- Don't need to get local dependencies since getDependencies is already getting "wtp"
248 <antcall target="getDaliLocalDependencies" />
249 -->
250 </target>
251
252 <!-- ===================================================================== -->
253 <!-- Get the dependencies based on releng maps -->
254 <!-- ===================================================================== -->
255 <target name="getDependencies">
256
257 <ant
258 antfile="${component.dir}/dependency.xml"
259 target="get">
260 <property
261 name="dependency.properties"
262 value="${buildDirectory}/maps/${env.RELENG}/maps/dependencies.properties" />
263 <property
264 name="base.install.dir"
265 value="${buildRoot}" />
266 </ant>
267 </target>
268
269 <!-- ===================================================================== -->
270 <!-- Get Dali dependencies based on releng.dali maps -->
271 <!-- ===================================================================== -->
272 <target
273 name="getDaliLocalDependencies"
274 if="daliLocalBuild">
275
276 <ant
277 antfile="${component.dir}/localDependency.xml"
278 target="get">
279 <property
280 name="dependency.properties"
281 value="${buildDirectory}/maps/${env.RELENGDALI}/maps/dali.dependencies.properties" />
282 <property
283 name="base.install.dir"
284 value="${buildRoot}" />
285 </ant>
286
287 </target>
288
289 <!-- ===================================================================== -->
290 <!-- Steps to do before fetching the build elements -->
291 <!-- ===================================================================== -->
292 <target name="preFetch"></target>
293
294 <!-- ===================================================================== -->
295 <!-- Steps to do after fetching the build elements -->
296 <!-- ===================================================================== -->
297 <target name="postFetch"></target>
298
299 <!-- ===================================================================== -->
300 <!-- Steps to do before generating the build scripts. -->
301 <!-- ===================================================================== -->
302 <target name="preGenerate"></target>
303
304 <!-- ===================================================================== -->
305 <!-- Steps to do after generating the build scripts. -->
306 <!-- ===================================================================== -->
307 <target name="postGenerate">
308 <customizeAccessRules
309 bundleDirectory="${buildDirectory}/plugins"
310 defaultRules="+org/eclipse/wst/**/*, +org/eclipse/jst/**/*" />
311 </target>
312
313
314 <!-- ===================================================================== -->
315 <!-- Steps to do before running the build.xmls for the elements being built. -->
316 <!-- ===================================================================== -->
317 <target name="preProcess">
318 <replace
319 dir="${buildDirectory}/plugins"
320 value="${timestamp}"
321 token="@build@">
322 <include name="**/about.mappings" />
323 </replace>
324 </target>
325
326 <!-- ===================================================================== -->
327 <!-- Steps to do after running the build.xmls for the elements being built. -->
328 <!-- ===================================================================== -->
329 <target name="postProcess">
330 <condition property="logsAvailable">
331 <istrue value="${javacVerbose}" />
332 </condition>
333 <antcall target="gatherLogs" />
334 </target>
335
336 <!-- TOREVIEW ????? Does Dali Need to buildwar in preAssemble target ????? -->
337 <!-- ===================================================================== -->
338 <!-- Steps to do before running assemble. -->
339 <!-- Note: in version 2.0 (and previous) we need to build the
340 explorer war file by invoking script. In 3.0 forward, we do not,
341 so this simple existence check allows us to use the same script for
342 both streams -->
343 <!-- ===================================================================== -->
344 <property
345 name="buildwarfilename"
346 value="${buildDirectory}/plugins/org.eclipse.wst.ws.explorer/build-war.xml" />
347
348 <target name="preAssemble"></target>
349<!--
350 <target
351 name="preAssemble"
352 depends="buildwar">
353 </target>
354-->
355 <target name="checkForBuildFile">
356 <condition property="buildFileExists">
357 <available file="${buildwarfilename}" />
358 </condition>
359 </target>
360
361 <target
362 name="buildwar"
363 depends="checkForBuildFile"
364 if="buildFileExists">
365 <ant antfile="${buildwarfilename}">
366 <property
367 name="baseLocation"
368 value="${baseLocation}" />
369 <property
370 name="basedir"
371 value="${buildDirectory}/plugins/org.eclipse.wst.ws.explorer" />
372 <property
373 name="buildDirectory"
374 value="${buildDirectory}" />
375 </ant>
376 </target>
377
378 <!-- ===================================================================== -->
379 <!-- Steps to do after running assemble. -->
380 <!-- ===================================================================== -->
381 <target name="postAssemble"></target>
382
383 <!-- ===================================================================== -->
384 <!-- Steps to do after the build is done. -->
385 <!-- ===================================================================== -->
386 <target name="postBuild"></target>
387
388 <!-- ===================================================================== -->
389 <!-- Steps to do to test the build results -->
390 <!-- ===================================================================== -->
391 <target name="test"></target>
392
393 <!-- ===================================================================== -->
394 <!-- Steps to do to publish the build results -->
395 <!-- ===================================================================== -->
396 <target name="publish"></target>
397
398 <!-- ===================================================================== -->
399 <!-- Helper targets -->
400 <!-- ===================================================================== -->
401 <target
402 name="gatherLogs"
403 if="logsAvailable">
404 <mkdir dir="${buildDirectory}/${buildLabel}/compilelogs" />
405 <echo
406 level="debug"
407 message="logExtension: ${logExtension}" />
408 <antcall target="allElements">
409 <param
410 name="target"
411 value="gatherLogs" />
412 <param
413 name="logExtension"
414 value="${logExtension}" />
415 </antcall>
416
417 <unzip
418 dest="${buildDirectory}/${buildLabel}/compilelogs"
419 overwrite="true">
420 <fileset dir="${buildDirectory}/features/${patchFeature}">
421 <include name="**/*.log.zip" />
422 </fileset>
423 </unzip>
424 </target>
425
426 <target
427 name="clean"
428 unless="noclean">
429 <antcall target="allElements">
430 <param
431 name="target"
432 value="cleanElement" />
433 </antcall>
434 </target>
435
436 <!-- ===================================================================== -->
437 <!-- Default target -->
438 <!-- ===================================================================== -->
439 <target name="noDefault">
440 <echo
441 level="error"
442 message="You must specify a target when invoking this file" />
443 </target>
444
445</project>