blob: b3584acd53479319952f6f0ba1b30eb98f6941f3 [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_williams16c0f5e2010-03-31 07:54:19 +000046 <echo
47 message="p2.build.repo: ${p2.build.repo}"/>
david_williams5ceb14e2010-03-17 04:30:37 +000048 <!--
49 Run a given ${target} on all elements being built Add on <ant>
50 task for each top level element being built.
51 -->
david_williams16c0f5e2010-03-31 07:54:19 +000052 <available
53 property="allElementsFile"
54 file="${builder}/allElements.xml"
55 value="${builder}/allElements.xml"/>
56 <property
57 name="allElementsFile"
58 location="${eclipse.pdebuild.templates}/headless-build/allElements.xml"/>
59 <import
60 file="${allElementsFile}"/>
david_williams5ceb14e2010-03-17 04:30:37 +000061 <target
62 name="allElements">
63 <echo
64 level="info"
david_williams243440a2010-03-17 05:54:30 +000065 message="target: ${target} "/>
david_williams5ceb14e2010-03-17 04:30:37 +000066 <echo
david_williams243440a2010-03-17 05:54:30 +000067 level="info"
david_williams5ceb14e2010-03-17 04:30:37 +000068 message="basedir: ${basedir}"/>
69 <echo
70 level="info"
71 message="component: ${component}"/>
72 <echo
david_williamsb4301692010-03-17 05:37:39 +000073 level="info"
david_williams5ceb14e2010-03-17 04:30:37 +000074 message="buildDirectory: ${buildDirectory}"/>
75 <echo
david_williams243440a2010-03-17 05:54:30 +000076 level="info"
david_williams5ceb14e2010-03-17 04:30:37 +000077 message="baseLocation: ${baseLocation}"/>
78 <echo
david_williams243440a2010-03-17 05:54:30 +000079 level="info"
david_williams5ceb14e2010-03-17 04:30:37 +000080 message="generic target: ${genericTargets}"/>
81 <echo
david_williams243440a2010-03-17 05:54:30 +000082 level="info"
david_williams16c0f5e2010-03-31 07:54:19 +000083 message="topLevelElementId: ${topLevelElementId}"/>
84 <echo
david_williams5ceb14e2010-03-17 04:30:37 +000085 message="compilerArg: ${compilerArg}"/>
86 <echo
david_williams9bbb4592010-03-31 15:23:24 +000087 message="individualSourceBundles: ${individualSourceBundles}"/>
david_williams16c0f5e2010-03-31 07:54:19 +000088 <antcall
89 target="allElementsDelegator"/>
david_williams5ceb14e2010-03-17 04:30:37 +000090 </target>
david_williams9bbb4592010-03-31 15:23:24 +000091
david_williams5ceb14e2010-03-17 04:30:37 +000092 <!--
david_williams5ceb14e2010-03-17 04:30:37 +000093 Check out map files from repository
94 -->
95 <target
96 name="getMapFiles">
david_williams5ceb14e2010-03-17 04:30:37 +000097 <!-- for now, get all, at once. May componetize later. -->
98 <ant
99 antfile="${wtp.builder.home}/scripts/build/maptasks.xml"
100 target="fetchAllMaps"/>
101 </target>
102
103
david_williams16c0f5e2010-03-31 07:54:19 +0000104 <!--
david_williams5ceb14e2010-03-17 04:30:37 +0000105 Steps to do before setup
106 -->
107 <target
108 name="preSetup"></target>
109 <!--
110 Steps to do after setup but before starting the build proper
111 -->
112 <target
113 name="postSetup">
114 <dirname
115 file="${ant.file}"
116 property="component.dir"/>
117 <echo
118 level="debug"
119 message="ant.file: ${ant.file}"/>
120 <echo
121 level="debug"
122 message="component.dir: ${component.dir}"/>
123
124 <!-- Get the dependencies -->
125 <antcall
david_williams9bbb4592010-03-31 15:23:24 +0000126 target="getDependencies"/>
david_williams5ceb14e2010-03-17 04:30:37 +0000127 </target>
128 <!--
129 =====================================================================
130 -->
131 <!-- Get the dependencies based on releng maps -->
132 <!--
133 =====================================================================
134 -->
135 <target
136 name="getDependencies">
137 <ant
138 antfile="${component.dir}/dependency.xml"
139 target="get">
140 <property
141 name="base.install.dir"
142 value="${buildRoot}"/>
143 </ant>
david_williams9bbb4592010-03-31 15:23:24 +0000144 </target>
david_williams5ceb14e2010-03-17 04:30:37 +0000145
146 <!--
147 Steps to do before fetching the build elements
148 -->
149 <target
david_williams9bbb4592010-03-31 15:23:24 +0000150 name="preFetch"></target>
david_williams5ceb14e2010-03-17 04:30:37 +0000151 <target
152 name="postFetch"></target>
david_williams9bbb4592010-03-31 15:23:24 +0000153 <!--
154 Steps to do before the repositories are being processed
david_williams5ceb14e2010-03-17 04:30:37 +0000155 -->
david_williams16c0f5e2010-03-31 07:54:19 +0000156 <target
157 name="preProcessRepos">
158 </target>
david_williams9bbb4592010-03-31 15:23:24 +0000159 <!--
160 Steps to do after the repositories have been processed
david_williams16c0f5e2010-03-31 07:54:19 +0000161 -->
162 <target
david_williams8f9da722010-03-31 15:51:47 +0000163 name="postProcessRepos"></target>
david_williams9bbb4592010-03-31 15:23:24 +0000164
david_williams16c0f5e2010-03-31 07:54:19 +0000165 <!--
166 Steps to do before generating the build scripts.
167 -->
david_williams5ceb14e2010-03-17 04:30:37 +0000168 <target
169 name="preGenerate"></target>
170
171 <!--
172 Steps to do after generating the build scripts.
173 -->
174 <target
175 name="postGenerate">
176 <echo
177 message="buildDirectory: ${buildDirectory}"/>
178 <customizeAccessRules
179 bundleDirectory="${buildDirectory}/plugins"
180 defaultRules="+org/eclipse/wst/**/*, +org/eclipse/jst/**/*"/>
181 </target>
182 <!--
183 Steps to do before running the build.xmls for the elements being
184 built.
185 -->
186 <target
187 name="preProcess">
188 <replace
189 dir="${buildDirectory}/plugins"
190 value="${timestamp}"
191 token="@build@">
192 <include
193 name="**/about.mappings"/>
194 </replace>
195 </target>
196 <!--
197 Steps to do after running the build.xmls for the elements being
198 built.
199 -->
200 <target
201 name="postProcess">
202 <condition
203 property="logsAvailable">
204 <istrue
205 value="${javacVerbose}"/>
206 </condition>
207 <antcall
208 target="gatherLogs"/>
209 </target>
david_williams16c0f5e2010-03-31 07:54:19 +0000210
211 <!-- Steps to do before running assemble. -->
david_williams5ceb14e2010-03-17 04:30:37 +0000212 <target
david_williams16c0f5e2010-03-31 07:54:19 +0000213 name="preAssemble">
david_williams5ceb14e2010-03-17 04:30:37 +0000214 </target>
david_williams9bbb4592010-03-31 15:23:24 +0000215
david_williams16c0f5e2010-03-31 07:54:19 +0000216
david_williams5ceb14e2010-03-17 04:30:37 +0000217
218 <!--
219 Steps to do after running assemble.
220 -->
221 <target
david_williams8f9da722010-03-31 15:51:47 +0000222 name="postAssemble">
223
224
225 <p2.repo2runnable>
226 <repository
227 location="file:/${buildDirectory}/${buildLabel}/${component}/runnable"/>
228 <source>
229 <repository
230 location="${p2.build.repo}"/>
231 </source>
232 </p2.repo2runnable>
233 <property
234 name="ziparchiveName"
235 value="${component}-${buildLabel}.zip"/>
236 <copy
237 todir="${buildDirectory}/${buildLabel}/${component}/runnable"
238 overwrite="false">
239 <fileset
240 dir="${wtp.builder.home}/rootfiles">
241 </fileset>
242 </copy>
243 <zip
244 destfile="${buildDirectory}/${buildLabel}/${ziparchiveName}">
david_williams35733582010-03-31 15:59:58 +0000245 <zipfileset
246 dir="${buildDirectory}/${buildLabel}/${component}/runnable"
david_williamsbcc23242010-03-31 19:36:46 +0000247 excludes="content.xml,content.jar,artifacts.xml,artifacts.jar"/>
david_williams8f9da722010-03-31 15:51:47 +0000248 </zip>
249
250 </target>
david_williams9bbb4592010-03-31 15:23:24 +0000251
david_williams5ceb14e2010-03-17 04:30:37 +0000252 <!--
253 Steps to do after the build is done.
254 -->
255 <target
david_williams16c0f5e2010-03-31 07:54:19 +0000256 name="prePackage">
257 </target>
258
259 <!-- Steps to do after running package. -->
david_williams16c0f5e2010-03-31 07:54:19 +0000260 <target
261 name="postPackage">
262 </target>
david_williams9bbb4592010-03-31 15:23:24 +0000263
david_williams16c0f5e2010-03-31 07:54:19 +0000264 <!--
265 Steps to do after the build is done.
266 -->
david_williams16c0f5e2010-03-31 07:54:19 +0000267 <target
268 name="postBuild">
269 <antcall
270 target="gatherLogs"/>
271 </target>
david_williams5ceb14e2010-03-17 04:30:37 +0000272
273 <!--
274 Steps to do to test the build results
275 -->
276 <target
277 name="test"></target>
278
279 <!--
280 Steps to do to publish the build results
281 -->
282 <target
283 name="publish"></target>
david_williams9bbb4592010-03-31 15:23:24 +0000284
david_williams5ceb14e2010-03-17 04:30:37 +0000285 <!--
286 Helper targets
287 -->
288 <target
289 name="gatherLogs"
290 if="logsAvailable">
291 <mkdir
292 dir="${buildDirectory}/${buildLabel}/compilelogs"/>
293 <echo
294 level="debug"
295 message="logExtension: ${logExtension}"/>
296 <antcall
297 target="allElements">
298 <param
299 name="target"
300 value="gatherLogs"/>
301 <param
302 name="logExtension"
303 value="${logExtension}"/>
304 </antcall>
305 <unzip
306 dest="${buildDirectory}/${buildLabel}/compilelogs"
307 overwrite="true">
308 <fileset
david_williams16c0f5e2010-03-31 07:54:19 +0000309 dir="${buildDirectory}/features/${topLevelElementId}">
david_williams5ceb14e2010-03-17 04:30:37 +0000310 <include
311 name="**/*.log.zip"/>
312 </fileset>
313 </unzip>
david_williams5ceb14e2010-03-17 04:30:37 +0000314 </target>
315 <target
316 name="clean"
317 unless="noclean">
318 <antcall
319 target="allElements">
320 <param
321 name="target"
322 value="cleanElement"/>
323 </antcall>
324 </target>
325
326 <!--
david_williams16c0f5e2010-03-31 07:54:19 +0000327 Default target
david_williams5ceb14e2010-03-17 04:30:37 +0000328 -->
329 <target
330 name="noDefault">
331 <echo
332 level="error"
333 message="You must specify a target when invoking this file"/>
334 </target>
335</project>