blob: 72dc2345293309035218b4730786a5c02008b494 [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.build.repo"
39 value="file://${buildDirectory}/${buildLabel}/${component}/repository/"/>
david_williams16c0f5e2010-03-31 07:54:19 +000040 <echo
41 message="p2.build.repo: ${p2.build.repo}"/>
david_williams5ceb14e2010-03-17 04:30:37 +000042 <!--
43 Run a given ${target} on all elements being built Add on <ant>
44 task for each top level element being built.
45 -->
david_williams16c0f5e2010-03-31 07:54:19 +000046 <available
47 property="allElementsFile"
48 file="${builder}/allElements.xml"
49 value="${builder}/allElements.xml"/>
50 <property
51 name="allElementsFile"
52 location="${eclipse.pdebuild.templates}/headless-build/allElements.xml"/>
53 <import
54 file="${allElementsFile}"/>
david_williams5ceb14e2010-03-17 04:30:37 +000055 <target
56 name="allElements">
57 <echo
58 level="info"
david_williams788c2012010-03-31 05:23:00 +000059 message="target: ${target} "/>
david_williams5ceb14e2010-03-17 04:30:37 +000060 <echo
david_williams788c2012010-03-31 05:23:00 +000061 level="info"
david_williams5ceb14e2010-03-17 04:30:37 +000062 message="basedir: ${basedir}"/>
63 <echo
64 level="info"
65 message="component: ${component}"/>
66 <echo
david_williams788c2012010-03-31 05:23:00 +000067 level="info"
david_williams5ceb14e2010-03-17 04:30:37 +000068 message="buildDirectory: ${buildDirectory}"/>
69 <echo
david_williams788c2012010-03-31 05:23:00 +000070 level="info"
david_williams5ceb14e2010-03-17 04:30:37 +000071 message="baseLocation: ${baseLocation}"/>
72 <echo
david_williams788c2012010-03-31 05:23:00 +000073 level="info"
74 message="generic target: ${genericTargets}"/>
75 <echo
76 level="info"
david_williams16c0f5e2010-03-31 07:54:19 +000077 message="topLevelElementId: ${topLevelElementId}"/>
david_williams5ceb14e2010-03-17 04:30:37 +000078 <echo
79 message="compilerArg: ${compilerArg}"/>
80 <echo
david_williams9bbb4592010-03-31 15:23:24 +000081 message="individualSourceBundles: ${individualSourceBundles}"/>
david_williams16c0f5e2010-03-31 07:54:19 +000082 <antcall
83 target="allElementsDelegator"/>
david_williams5ceb14e2010-03-17 04:30:37 +000084 </target>
david_williams9bbb4592010-03-31 15:23:24 +000085
david_williams5ceb14e2010-03-17 04:30:37 +000086 <!--
87 Check out map files from repository
david_williams16c0f5e2010-03-31 07:54:19 +000088 -->
david_williams5ceb14e2010-03-17 04:30:37 +000089 <target
90 name="getMapFiles">
david_williams5ceb14e2010-03-17 04:30:37 +000091 <!-- for now, get all, at once. May componetize later. -->
92 <ant
93 antfile="${wtp.builder.home}/scripts/build/maptasks.xml"
94 target="fetchAllMaps"/>
95 </target>
96
97
david_williams16c0f5e2010-03-31 07:54:19 +000098 <!--
david_williams5ceb14e2010-03-17 04:30:37 +000099 Steps to do before setup
100 -->
101 <target
102 name="preSetup"></target>
103 <!--
104 Steps to do after setup but before starting the build proper
105 -->
106 <target
107 name="postSetup">
108 <dirname
109 file="${ant.file}"
110 property="component.dir"/>
111 <echo
112 level="debug"
113 message="ant.file: ${ant.file}"/>
114 <echo
115 level="debug"
116 message="component.dir: ${component.dir}"/>
117
118 <!-- Get the dependencies -->
119 <antcall
david_williams9bbb4592010-03-31 15:23:24 +0000120 target="getDependencies"/>
david_williams5ceb14e2010-03-17 04:30:37 +0000121 </target>
122 <!--
123 =====================================================================
124 -->
125 <!-- Get the dependencies based on releng maps -->
126 <!--
127 =====================================================================
128 -->
129 <target
130 name="getDependencies">
131 <ant
132 antfile="${component.dir}/dependency.xml"
133 target="get">
134 <property
135 name="base.install.dir"
136 value="${buildRoot}"/>
137 </ant>
david_williams9bbb4592010-03-31 15:23:24 +0000138 </target>
david_williams5ceb14e2010-03-17 04:30:37 +0000139
140 <!--
141 Steps to do before fetching the build elements
142 -->
143 <target
david_williams9bbb4592010-03-31 15:23:24 +0000144 name="preFetch"></target>
david_williams5ceb14e2010-03-17 04:30:37 +0000145 <target
146 name="postFetch"></target>
david_williams9bbb4592010-03-31 15:23:24 +0000147 <!--
148 Steps to do before the repositories are being processed
david_williams5ceb14e2010-03-17 04:30:37 +0000149 -->
david_williams16c0f5e2010-03-31 07:54:19 +0000150 <target
151 name="preProcessRepos">
152 </target>
david_williams9bbb4592010-03-31 15:23:24 +0000153 <!--
154 Steps to do after the repositories have been processed
david_williams16c0f5e2010-03-31 07:54:19 +0000155 -->
156 <target
157 name="postProcessRepos">
david_williams8f9da722010-03-31 15:51:47 +0000158
david_williams16c0f5e2010-03-31 07:54:19 +0000159 </target>
david_williams9bbb4592010-03-31 15:23:24 +0000160
david_williams16c0f5e2010-03-31 07:54:19 +0000161 <!--
162 Steps to do before generating the build scripts.
163 -->
david_williams5ceb14e2010-03-17 04:30:37 +0000164 <target
165 name="preGenerate"></target>
166
167 <!--
168 Steps to do after generating the build scripts.
169 -->
170 <target
171 name="postGenerate">
172 <echo
173 message="buildDirectory: ${buildDirectory}"/>
174 <customizeAccessRules
175 bundleDirectory="${buildDirectory}/plugins"
176 defaultRules="+org/eclipse/wst/**/*, +org/eclipse/jst/**/*"/>
177 </target>
178 <!--
179 Steps to do before running the build.xmls for the elements being
180 built.
181 -->
182 <target
183 name="preProcess">
184 <replace
185 dir="${buildDirectory}/plugins"
186 value="${timestamp}"
187 token="@build@">
188 <include
189 name="**/about.mappings"/>
190 </replace>
191 </target>
192 <!--
193 Steps to do after running the build.xmls for the elements being
194 built.
195 -->
196 <target
197 name="postProcess">
198 <condition
199 property="logsAvailable">
200 <istrue
201 value="${javacVerbose}"/>
202 </condition>
203 <antcall
204 target="gatherLogs"/>
205 </target>
206
david_williams16c0f5e2010-03-31 07:54:19 +0000207 <!-- Steps to do before running assemble. -->
david_williams5ceb14e2010-03-17 04:30:37 +0000208 <target
david_williams16c0f5e2010-03-31 07:54:19 +0000209 name="preAssemble">
210 </target>
david_williams9bbb4592010-03-31 15:23:24 +0000211
david_williams16c0f5e2010-03-31 07:54:19 +0000212
david_williams5ceb14e2010-03-17 04:30:37 +0000213
214 <!--
215 Steps to do after running assemble.
216 -->
217 <target
david_williams8f9da722010-03-31 15:51:47 +0000218 name="postAssemble">
219
220 <p2.repo2runnable>
221 <repository
222 location="file:/${buildDirectory}/${buildLabel}/${component}/runnable"/>
223 <source>
224 <repository
225 location="${p2.build.repo}"/>
226 </source>
227 </p2.repo2runnable>
228 <property
229 name="ziparchiveName"
230 value="${component}-${buildLabel}.zip"/>
231 <copy
232 todir="${buildDirectory}/${buildLabel}/${component}/runnable"
233 overwrite="false">
234 <fileset
235 dir="${wtp.builder.home}/rootfiles">
236 </fileset>
237 </copy>
238 <zip
239 destfile="${buildDirectory}/${buildLabel}/${ziparchiveName}">
240 <zipfileset
241 src="${buildDirectory}/${buildLabel}/${component}/runnable"
242 excludes="content.xml,content.jar,archives.xml,archives.jar"/>
243 </zip>
244 </target>
david_williams9bbb4592010-03-31 15:23:24 +0000245
david_williams5ceb14e2010-03-17 04:30:37 +0000246 <!--
247 Steps to do after the build is done.
248 -->
249 <target
david_williams16c0f5e2010-03-31 07:54:19 +0000250 name="prePackage">
251 </target>
252
253 <!-- Steps to do after running package. -->
david_williams16c0f5e2010-03-31 07:54:19 +0000254 <target
255 name="postPackage">
256 </target>
david_williams9bbb4592010-03-31 15:23:24 +0000257
david_williams16c0f5e2010-03-31 07:54:19 +0000258 <!--
259 Steps to do after the build is done.
260 -->
david_williams16c0f5e2010-03-31 07:54:19 +0000261 <target
262 name="postBuild">
263 <antcall
264 target="gatherLogs"/>
265 </target>
david_williams5ceb14e2010-03-17 04:30:37 +0000266
267 <!--
268 Steps to do to test the build results
269 -->
270 <target
271 name="test"></target>
272
273 <!--
274 Steps to do to publish the build results
275 -->
276 <target
277 name="publish"></target>
david_williams9bbb4592010-03-31 15:23:24 +0000278
david_williams5ceb14e2010-03-17 04:30:37 +0000279 <!--
280 Helper targets
281 -->
282 <target
283 name="gatherLogs"
284 if="logsAvailable">
285 <mkdir
david_williams16c0f5e2010-03-31 07:54:19 +0000286 dir="${buildDirectory}/${buildLabel}/compilelogs"/>
david_williams5ceb14e2010-03-17 04:30:37 +0000287 <echo
288 level="debug"
289 message="logExtension: ${logExtension}"/>
290 <antcall
291 target="allElements">
292 <param
293 name="target"
294 value="gatherLogs"/>
295 <param
296 name="logExtension"
297 value="${logExtension}"/>
298 </antcall>
299 <unzip
david_williams16c0f5e2010-03-31 07:54:19 +0000300 dest="${buildDirectory}/${buildLabel}/compilelogs"
david_williams5ceb14e2010-03-17 04:30:37 +0000301 overwrite="true">
302 <fileset
david_williams16c0f5e2010-03-31 07:54:19 +0000303 dir="${buildDirectory}/features/${topLevelElementId}">
david_williams5ceb14e2010-03-17 04:30:37 +0000304 <include
305 name="**/*.log.zip"/>
306 </fileset>
307 </unzip>
308 </target>
309 <target
310 name="clean"
311 unless="noclean">
312 <antcall
313 target="allElements">
314 <param
315 name="target"
316 value="cleanElement"/>
317 </antcall>
318 </target>
319
320 <!--
david_williams16c0f5e2010-03-31 07:54:19 +0000321 Default target
david_williams5ceb14e2010-03-17 04:30:37 +0000322 -->
323 <target
324 name="noDefault">
325 <echo
326 level="error"
327 message="You must specify a target when invoking this file"/>
328 </target>
329</project>