blob: 29252d2fbcb2cd8bbe0351062d182f031a1eb21d [file] [log] [blame]
david_williams5ceb14e2010-03-17 04:30:37 +00001<project
2 name="PDECustomTargets"
3 default="noDefault"
4 basedir=".">
david_williams5ceb14e2010-03-17 04:30:37 +00005 <!--
6 = = = standard properties pattern = = = Note to be
7 cross-platform, "environment variables" are only appropriate for
8 some variables, e.g. ones we set, since properties are case
9 sensitive, even if the environment variables on your operating
10 system are not, e.g. it will be ${env.Path} not ${env.PATH} on
11 Windows
12 -->
13 <property
14 environment="env"/>
15 <!--
16 Let users override standard properties, if desired. If
17 directory, file, or some properties do not exist, then standard
18 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
25 file="build.properties"/>
26 <fail
27 message="dependency.properties must be specified by distribution script"
28 unless="dependency.properties"/>
29 <fail
30 unless="buildDirectory"
31 message="buildDirectory must be set"/>
32 <echo
33 message="buildDirectory: ${buildDirectory}"/>
david_williams9bbb4592010-03-31 15:23:24 +000034 <property
35 name="archiveName"
36 value="${component}-buildrepo-${buildLabel}.zip"/>
37 <property
38 name="p2.metadata.repo.name"
39 value="WTP Build repository: ${buildLabel}/${component}"/>
40 <property
41 name="p2.artifact.repo.name"
42 value="WTP Build repository: ${buildLabel}/${component}"/>
43 <property
44 name="p2.build.repo"
45 value="file:/${buildDirectory}/${buildLabel}/${component}/repository/"/>
david_williams1dd45432010-03-31 19:42:48 +000046 <property
47 name="p2.category.definition"
david_williamsa3c56dd2010-03-31 20:26:27 +000048 value="file://${wtp.builder.home}/components/${component}/category.xml"/>
david_williams16c0f5e2010-03-31 07:54:19 +000049 <echo
50 message="p2.build.repo: ${p2.build.repo}"/>
david_williams96dc2452010-03-31 20:44:48 +000051 <echo
52 message="p2.category.definition: ${p2.category.definition}"/>
david_williams5ceb14e2010-03-17 04:30:37 +000053 <!--
54 Run a given ${target} on all elements being built Add on <ant>
55 task for each top level element being built.
56 -->
david_williams16c0f5e2010-03-31 07:54:19 +000057 <available
58 property="allElementsFile"
59 file="${builder}/allElements.xml"
60 value="${builder}/allElements.xml"/>
61 <property
62 name="allElementsFile"
63 location="${eclipse.pdebuild.templates}/headless-build/allElements.xml"/>
64 <import
65 file="${allElementsFile}"/>
david_williams5ceb14e2010-03-17 04:30:37 +000066 <target
67 name="allElements">
68 <echo
69 level="info"
david_williams243440a2010-03-17 05:54:30 +000070 message="target: ${target} "/>
david_williams5ceb14e2010-03-17 04:30:37 +000071 <echo
david_williams243440a2010-03-17 05:54:30 +000072 level="info"
david_williams5ceb14e2010-03-17 04:30:37 +000073 message="basedir: ${basedir}"/>
74 <echo
75 level="info"
76 message="component: ${component}"/>
77 <echo
david_williamsb4301692010-03-17 05:37:39 +000078 level="info"
david_williams5ceb14e2010-03-17 04:30:37 +000079 message="buildDirectory: ${buildDirectory}"/>
80 <echo
david_williams243440a2010-03-17 05:54:30 +000081 level="info"
david_williams5ceb14e2010-03-17 04:30:37 +000082 message="baseLocation: ${baseLocation}"/>
83 <echo
david_williams243440a2010-03-17 05:54:30 +000084 level="info"
david_williams5ceb14e2010-03-17 04:30:37 +000085 message="generic target: ${genericTargets}"/>
86 <echo
david_williams243440a2010-03-17 05:54:30 +000087 level="info"
david_williams16c0f5e2010-03-31 07:54:19 +000088 message="topLevelElementId: ${topLevelElementId}"/>
89 <echo
david_williams5ceb14e2010-03-17 04:30:37 +000090 message="compilerArg: ${compilerArg}"/>
91 <echo
david_williams9bbb4592010-03-31 15:23:24 +000092 message="individualSourceBundles: ${individualSourceBundles}"/>
david_williams16c0f5e2010-03-31 07:54:19 +000093 <antcall
94 target="allElementsDelegator"/>
david_williams5ceb14e2010-03-17 04:30:37 +000095 </target>
david_williams9bbb4592010-03-31 15:23:24 +000096
david_williams5ceb14e2010-03-17 04:30:37 +000097 <!--
david_williams5ceb14e2010-03-17 04:30:37 +000098 Check out map files from repository
99 -->
100 <target
101 name="getMapFiles">
david_williams5ceb14e2010-03-17 04:30:37 +0000102 <!-- for now, get all, at once. May componetize later. -->
103 <ant
104 antfile="${wtp.builder.home}/scripts/build/maptasks.xml"
105 target="fetchAllMaps"/>
106 </target>
107
108
david_williams16c0f5e2010-03-31 07:54:19 +0000109 <!--
david_williams5ceb14e2010-03-17 04:30:37 +0000110 Steps to do before setup
111 -->
112 <target
113 name="preSetup"></target>
114 <!--
115 Steps to do after setup but before starting the build proper
116 -->
117 <target
118 name="postSetup">
119 <dirname
120 file="${ant.file}"
121 property="component.dir"/>
122 <echo
123 level="debug"
124 message="ant.file: ${ant.file}"/>
125 <echo
126 level="debug"
127 message="component.dir: ${component.dir}"/>
128
129 <!-- Get the dependencies -->
130 <antcall
david_williams9bbb4592010-03-31 15:23:24 +0000131 target="getDependencies"/>
david_williams5ceb14e2010-03-17 04:30:37 +0000132 </target>
133 <!--
134 =====================================================================
135 -->
136 <!-- Get the dependencies based on releng maps -->
137 <!--
138 =====================================================================
139 -->
140 <target
141 name="getDependencies">
142 <ant
143 antfile="${component.dir}/dependency.xml"
144 target="get">
145 <property
146 name="base.install.dir"
147 value="${buildRoot}"/>
148 </ant>
david_williams9bbb4592010-03-31 15:23:24 +0000149 </target>
david_williams5ceb14e2010-03-17 04:30:37 +0000150
151 <!--
152 Steps to do before fetching the build elements
153 -->
154 <target
david_williams9bbb4592010-03-31 15:23:24 +0000155 name="preFetch"></target>
david_williams5ceb14e2010-03-17 04:30:37 +0000156 <target
157 name="postFetch"></target>
david_williams9bbb4592010-03-31 15:23:24 +0000158 <!--
159 Steps to do before the repositories are being processed
david_williams5ceb14e2010-03-17 04:30:37 +0000160 -->
david_williams16c0f5e2010-03-31 07:54:19 +0000161 <target
162 name="preProcessRepos">
163 </target>
david_williams9bbb4592010-03-31 15:23:24 +0000164 <!--
165 Steps to do after the repositories have been processed
david_williams16c0f5e2010-03-31 07:54:19 +0000166 -->
167 <target
david_williams8f9da722010-03-31 15:51:47 +0000168 name="postProcessRepos"></target>
david_williams9bbb4592010-03-31 15:23:24 +0000169
david_williams16c0f5e2010-03-31 07:54:19 +0000170 <!--
171 Steps to do before generating the build scripts.
172 -->
david_williams5ceb14e2010-03-17 04:30:37 +0000173 <target
174 name="preGenerate"></target>
175
176 <!--
177 Steps to do after generating the build scripts.
178 -->
179 <target
180 name="postGenerate">
181 <echo
182 message="buildDirectory: ${buildDirectory}"/>
183 <customizeAccessRules
184 bundleDirectory="${buildDirectory}/plugins"
185 defaultRules="+org/eclipse/wst/**/*, +org/eclipse/jst/**/*"/>
186 </target>
187 <!--
188 Steps to do before running the build.xmls for the elements being
189 built.
190 -->
191 <target
192 name="preProcess">
193 <replace
194 dir="${buildDirectory}/plugins"
195 value="${timestamp}"
196 token="@build@">
197 <include
198 name="**/about.mappings"/>
199 </replace>
200 </target>
201 <!--
202 Steps to do after running the build.xmls for the elements being
203 built.
204 -->
205 <target
206 name="postProcess">
207 <condition
208 property="logsAvailable">
209 <istrue
210 value="${javacVerbose}"/>
211 </condition>
212 <antcall
213 target="gatherLogs"/>
214 </target>
david_williams16c0f5e2010-03-31 07:54:19 +0000215
216 <!-- Steps to do before running assemble. -->
david_williams5ceb14e2010-03-17 04:30:37 +0000217 <target
david_williams16c0f5e2010-03-31 07:54:19 +0000218 name="preAssemble">
david_williams5ceb14e2010-03-17 04:30:37 +0000219 </target>
david_williams9bbb4592010-03-31 15:23:24 +0000220
david_williams16c0f5e2010-03-31 07:54:19 +0000221
david_williams5ceb14e2010-03-17 04:30:37 +0000222
223 <!--
224 Steps to do after running assemble.
225 -->
226 <target
david_williams8f9da722010-03-31 15:51:47 +0000227 name="postAssemble">
david_williams1dd45432010-03-31 19:42:48 +0000228 <p2.repo2runnable>
229 <repository
230 location="file:/${buildDirectory}/${buildLabel}/${component}/runnable"/>
231 <source>
232 <repository
233 location="${p2.build.repo}"/>
234 </source>
235 </p2.repo2runnable>
236 <property
237 name="ziparchiveName"
238 value="${component}-${buildLabel}.zip"/>
239 <copy
240 todir="${buildDirectory}/${buildLabel}/${component}/runnable"
241 overwrite="false">
242 <fileset
243 dir="${wtp.builder.home}/rootfiles">
244 </fileset>
245 </copy>
246 <zip
247 destfile="${buildDirectory}/${buildLabel}/${ziparchiveName}">
248 <zipfileset
249 dir="${buildDirectory}/${buildLabel}/${component}/runnable"
250 excludes="content.xml,content.jar,artifacts.xml,artifacts.jar"/>
251 </zip>
david_williams8f9da722010-03-31 15:51:47 +0000252 </target>
david_williams9bbb4592010-03-31 15:23:24 +0000253
david_williams5ceb14e2010-03-17 04:30:37 +0000254 <!--
255 Steps to do after the build is done.
256 -->
257 <target
david_williams16c0f5e2010-03-31 07:54:19 +0000258 name="prePackage">
259 </target>
260
261 <!-- Steps to do after running package. -->
david_williams16c0f5e2010-03-31 07:54:19 +0000262 <target
263 name="postPackage">
264 </target>
david_williams9bbb4592010-03-31 15:23:24 +0000265
david_williams16c0f5e2010-03-31 07:54:19 +0000266 <!--
267 Steps to do after the build is done.
268 -->
david_williams16c0f5e2010-03-31 07:54:19 +0000269 <target
270 name="postBuild">
271 <antcall
272 target="gatherLogs"/>
273 </target>
david_williams5ceb14e2010-03-17 04:30:37 +0000274
275 <!--
276 Steps to do to test the build results
277 -->
278 <target
279 name="test"></target>
280
281 <!--
282 Steps to do to publish the build results
283 -->
284 <target
285 name="publish"></target>
david_williams9bbb4592010-03-31 15:23:24 +0000286
david_williams5ceb14e2010-03-17 04:30:37 +0000287 <!--
288 Helper targets
289 -->
290 <target
291 name="gatherLogs"
292 if="logsAvailable">
293 <mkdir
294 dir="${buildDirectory}/${buildLabel}/compilelogs"/>
295 <echo
296 level="debug"
297 message="logExtension: ${logExtension}"/>
298 <antcall
299 target="allElements">
300 <param
301 name="target"
302 value="gatherLogs"/>
303 <param
304 name="logExtension"
305 value="${logExtension}"/>
306 </antcall>
307 <unzip
308 dest="${buildDirectory}/${buildLabel}/compilelogs"
309 overwrite="true">
310 <fileset
david_williams16c0f5e2010-03-31 07:54:19 +0000311 dir="${buildDirectory}/features/${topLevelElementId}">
david_williams5ceb14e2010-03-17 04:30:37 +0000312 <include
313 name="**/*.log.zip"/>
314 </fileset>
315 </unzip>
david_williams5ceb14e2010-03-17 04:30:37 +0000316 </target>
317 <target
318 name="clean"
319 unless="noclean">
320 <antcall
321 target="allElements">
322 <param
323 name="target"
324 value="cleanElement"/>
325 </antcall>
326 </target>
327
328 <!--
david_williams16c0f5e2010-03-31 07:54:19 +0000329 Default target
david_williams5ceb14e2010-03-17 04:30:37 +0000330 -->
331 <target
332 name="noDefault">
333 <echo
334 level="error"
335 message="You must specify a target when invoking this file"/>
336 </target>
337</project>