blob: 84174bea230db79f32dbca4d4b333469b9e2a90a [file] [log] [blame]
david_williams5ceb14e2010-03-17 04:30:37 +00001<project
2 name="PDECustomTargets"
3 default="noDefault"
4 basedir=".">
5 <property
6 name="buildfeature"
7 value="org.eclipse.wtp.patch.assembly.feature"/>
8 <!--
9 = = = standard properties pattern = = = Note to be
10 cross-platform, "environment variables" are only appropriate for
11 some variables, e.g. ones we set, since properties are case
12 sensitive, even if the environment variables on your operating
13 system are not, e.g. it will be ${env.Path} not ${env.PATH} on
14 Windows
15 -->
16 <property
17 environment="env"/>
18 <!--
19 Let users override standard properties, if desired. If
20 directory, file, or some properties do not exist, then standard
21 properties will be used.
22 -->
23 <property
24 file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties"/>
25
26 <!-- let this project specify properties, if not already set -->
27 <property
28 file="build.properties"/>
29 <fail
30 message="dependency.properties must be specified by distribution script"
31 unless="dependency.properties"/>
32 <fail
33 unless="buildDirectory"
34 message="buildDirectory must be set"/>
35 <echo
36 message="buildDirectory: ${buildDirectory}"/>
david_williams212b3822010-03-31 05:58:27 +000037
david_williams9e6b5922010-03-31 06:34:44 +000038<!--
david_williams212b3822010-03-31 05:58:27 +000039 <property
40 name="p2.build.repo"
david_williams7744edb2010-03-31 06:23:59 +000041 value="${buildDirectory}/${buildLabel}/${component}/repository/" />
david_williams44ec1e12010-03-31 06:16:38 +000042 <mkdir dir="${p2.build.repo}"/>
david_williamscf6a3452010-03-31 06:35:34 +000043 -->
david_williams212b3822010-03-31 05:58:27 +000044 <echo
45 message="p2.build.repo: ${p2.build.repo}" />
david_williamscf6a3452010-03-31 06:35:34 +000046
david_williams5ceb14e2010-03-17 04:30:37 +000047 <!--
48 Run a given ${target} on all elements being built Add on <ant>
49 task for each top level element being built.
50 -->
51 <target
52 name="allElements">
53 <echo
54 level="info"
david_williams243440a2010-03-17 05:54:30 +000055 message="target: ${target} "/>
david_williams5ceb14e2010-03-17 04:30:37 +000056 <echo
david_williams243440a2010-03-17 05:54:30 +000057 level="info"
david_williams5ceb14e2010-03-17 04:30:37 +000058 message="basedir: ${basedir}"/>
59 <echo
60 level="info"
61 message="component: ${component}"/>
62 <echo
david_williamsb4301692010-03-17 05:37:39 +000063 level="info"
david_williams5ceb14e2010-03-17 04:30:37 +000064 message="buildDirectory: ${buildDirectory}"/>
65 <echo
david_williams243440a2010-03-17 05:54:30 +000066 level="info"
david_williams5ceb14e2010-03-17 04:30:37 +000067 message="baseLocation: ${baseLocation}"/>
68 <echo
david_williams243440a2010-03-17 05:54:30 +000069 level="info"
david_williams5ceb14e2010-03-17 04:30:37 +000070 message="generic target: ${genericTargets}"/>
71 <echo
david_williams243440a2010-03-17 05:54:30 +000072 level="info"
david_williams212b3822010-03-31 05:58:27 +000073 message="buildfeature: ${buildfeature}"/>
david_williamsb4301692010-03-17 05:37:39 +000074 <echo
david_williams5ceb14e2010-03-17 04:30:37 +000075 message="compilerArg: ${compilerArg}"/>
76 <echo
77 message="individualSourceBundles: ${individualSourceBundles}"/>
78 <ant
79 antfile="${genericTargets}"
80 target="${target}">
81 <property
82 name="type"
83 value="feature"/>
84 <property
85 name="id"
86 value="${buildfeature}"/>
87 </ant>
88 </target>
89 <!--
90 Targets to assemble the built elements for particular
91 configurations These generally call the generated assemble
92 scripts (named in ${assembleScriptName}) but may also add pre
93 and post processing Add one target for each root element and
94 each configuration
95 -->
david_williams05c86602010-03-31 04:31:07 +000096
97 <target
98 name="assemble.org.eclipse.wtp.patch.assembly.feature.p2">
david_williamsb8d1d602010-03-31 04:51:59 +000099 <property
100 name="archiveName"
101 value="wtp-${buildLabel}.zip"/>
david_williamsa82966c2010-03-31 05:42:30 +0000102
103 <echo message="running in p2 assembly: ${assembleScriptName}" />
104
david_williamsb8d1d602010-03-31 04:51:59 +0000105 <ant
106 antfile="${assembleScriptName}"
107 dir="${buildDirectory}"/>
david_williams05c86602010-03-31 04:31:07 +0000108 </target>
david_williamsa5733822010-03-31 04:40:38 +0000109
110 <target
111 name="assemble.org.eclipse.wtp.patch.assembly.feature.group.group.group">
112
david_williamsa82966c2010-03-31 05:42:30 +0000113
114 <echo message="running in group.group.group assembly: ${assembleScriptName}" />
115
david_williamsa5733822010-03-31 04:40:38 +0000116 </target>
117
david_williams5ceb14e2010-03-17 04:30:37 +0000118 <target
119 name="assemble.org.eclipse.wtp.patch.assembly.feature">
120 <property
121 name="archiveName"
122 value="wtp-${buildLabel}.zip"/>
123 <ant
124 antfile="${assembleScriptName}"
125 dir="${buildDirectory}"/>
126 </target>
127 <target
128 name="prePackage"/>
129 <target
130 name="postPackage">
131 <property
132 name="archiveName"
133 value="wtp-${buildLabel}.zip"/>
david_williams51373cf2010-03-31 04:59:50 +0000134 <!--
david_williams5ceb14e2010-03-17 04:30:37 +0000135 <ant
136 antfile="${wtp.builder.home}/scripts/build/buildutilities.xml"
137 target="unpackUpdateJarsAndCreateZippedPackages">
138 <property
139 name="buildDirectory"
140 value="${buildDirectory}"/>
141 <property
142 name="buildLabel"
143 value="${buildLabel}"/>
144 <property
145 name="archiveName"
146 value="${archiveName}"/>
147 </ant>
david_williams51373cf2010-03-31 04:59:50 +0000148 -->
david_williams5ceb14e2010-03-17 04:30:37 +0000149 </target>
150
151
152 <!--
153 Check out map files from repository
154 -->
155 <target
156 name="getMapFiles">
157
158 <!-- for now, get all, at once. May componetize later. -->
159 <ant
160 antfile="${wtp.builder.home}/scripts/build/maptasks.xml"
161 target="fetchAllMaps"/>
162 </target>
163
164
165 <!--
166 Steps to do before setup
167 -->
168 <target
169 name="preSetup"></target>
170 <!--
171 Steps to do after setup but before starting the build proper
172 -->
173 <target
174 name="postSetup">
175 <dirname
176 file="${ant.file}"
177 property="component.dir"/>
178 <echo
179 level="debug"
180 message="ant.file: ${ant.file}"/>
181 <echo
182 level="debug"
183 message="component.dir: ${component.dir}"/>
184
185 <!-- Get the dependencies -->
186 <antcall
187 target="getDependencies"/>
188 </target>
189 <!--
190 =====================================================================
191 -->
192 <!-- Get the dependencies based on releng maps -->
193 <!--
194 =====================================================================
195 -->
196 <target
197 name="getDependencies">
198 <ant
199 antfile="${component.dir}/dependency.xml"
200 target="get">
201 <property
202 name="base.install.dir"
203 value="${buildRoot}"/>
204 </ant>
205 </target>
206
207 <!--
208 Steps to do before fetching the build elements
209 -->
210 <target
211 name="preFetch"></target>
212
213 <!--
214 Steps to do after fetching the build elements
215 -->
216 <target
217 name="postFetch"></target>
218
219 <!--
220 Steps to do before generating the build scripts.
221 -->
222 <target
223 name="preGenerate"></target>
224
225 <!--
226 Steps to do after generating the build scripts.
227 -->
228 <target
229 name="postGenerate">
230 <echo
231 message="buildDirectory: ${buildDirectory}"/>
232 <customizeAccessRules
233 bundleDirectory="${buildDirectory}/plugins"
234 defaultRules="+org/eclipse/wst/**/*, +org/eclipse/jst/**/*"/>
235 </target>
236 <!--
237 Steps to do before running the build.xmls for the elements being
238 built.
239 -->
240 <target
241 name="preProcess">
242 <replace
243 dir="${buildDirectory}/plugins"
244 value="${timestamp}"
245 token="@build@">
246 <include
247 name="**/about.mappings"/>
248 </replace>
249 </target>
250 <!--
251 Steps to do after running the build.xmls for the elements being
252 built.
253 -->
254 <target
255 name="postProcess">
256 <condition
257 property="logsAvailable">
258 <istrue
259 value="${javacVerbose}"/>
260 </condition>
261 <antcall
262 target="gatherLogs"/>
263 </target>
264 <!--
265 Steps to do before running assemble. Note: in version 2.0 (and
266 previous) we need to build the explorer war file by invoking
267 script. In 3.0 forward, we do not, so this simple existence
268 check allows us to use the same script for both streams
269 -->
270 <property
271 name="buildwarfilename"
272 value="${buildDirectory}/plugins/org.eclipse.wst.ws.explorer/build-war.xml"/>
273 <target
274 name="preAssemble"
275 depends="buildwar">
276 </target>
277 <target
278 name="checkForBuildFile">
279 <condition
280 property="buildFileExists">
281 <available
282 file="${buildwarfilename}"/>
283 </condition>
284 </target>
285 <target
286 name="buildwar"
287 depends="checkForBuildFile"
288 if="buildFileExists">
289 <ant
290 antfile="${buildwarfilename}">
291 <property
292 name="baseLocation"
293 value="${baseLocation}"/>
294 <property
295 name="basedir"
296 value="${buildDirectory}/plugins/org.eclipse.wst.ws.explorer"/>
297 <property
298 name="buildDirectory"
299 value="${buildDirectory}"/>
300 </ant>
301 </target>
302
303 <!--
304 Steps to do after running assemble.
305 -->
306 <target
307 name="postAssemble"></target>
308
309 <!--
310 Steps to do after the build is done.
311 -->
312 <target
313 name="postBuild"></target>
314
315 <!--
316 Steps to do to test the build results
317 -->
318 <target
319 name="test"></target>
320
321 <!--
322 Steps to do to publish the build results
323 -->
324 <target
325 name="publish"></target>
326
327 <!--
328 Helper targets
329 -->
330 <target
331 name="gatherLogs"
332 if="logsAvailable">
333 <mkdir
334 dir="${buildDirectory}/${buildLabel}/compilelogs"/>
335 <echo
336 level="debug"
337 message="logExtension: ${logExtension}"/>
338 <antcall
339 target="allElements">
340 <param
341 name="target"
342 value="gatherLogs"/>
343 <param
344 name="logExtension"
345 value="${logExtension}"/>
346 </antcall>
347 <unzip
348 dest="${buildDirectory}/${buildLabel}/compilelogs"
349 overwrite="true">
350 <fileset
351 dir="${buildDirectory}/features/${buildfeature}">
352 <include
353 name="**/*.log.zip"/>
354 </fileset>
355 </unzip>
david_williams5ceb14e2010-03-17 04:30:37 +0000356 </target>
357 <target
358 name="clean"
359 unless="noclean">
360 <antcall
361 target="allElements">
362 <param
363 name="target"
364 value="cleanElement"/>
365 </antcall>
366 </target>
367
368 <!--
369 Default target
370 -->
371 <target
372 name="noDefault">
373 <echo
374 level="error"
375 message="You must specify a target when invoking this file"/>
376 </target>
377</project>