blob: e081b5a3b702307d60b531e34e2f866f7809b3f8 [file] [log] [blame]
david_williams60f2e6f2008-10-28 04:14:12 +00001<project
2 name="PDECustomTargets"
3 default="noDefault"
4 basedir=".">
david_williams0f36b3b2009-01-15 02:07:34 +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"/>
david_williams60f2e6f2008-10-28 04:14:12 +000022
david_williams0f36b3b2009-01-15 02:07:34 +000023 <!-- let this project specify properties, if not already set -->
24 <property
25 file="build.properties"/>
26 <fail
david_williamsc253e572009-08-04 07:09:44 +000027 message="dependency.properties must be specified by distribution script"
david_williams0f36b3b2009-01-15 02:07:34 +000028 unless="dependency.properties"/>
david_williams60f2e6f2008-10-28 04:14:12 +000029 <fail
30 unless="buildDirectory"
david_williams0f36b3b2009-01-15 02:07:34 +000031 message="buildDirectory must be set"/>
32 <echo
33 message="buildDirectory: ${buildDirectory}"/>
34 <!--
35 Run a given ${target} on all elements being built Add on <ant>
36 task for each top level element being built.
david_williams60f2e6f2008-10-28 04:14:12 +000037 -->
david_williams0f36b3b2009-01-15 02:07:34 +000038 <target
39 name="allElements">
david_williams60f2e6f2008-10-28 04:14:12 +000040 <echo
41 level="info"
david_williams0f36b3b2009-01-15 02:07:34 +000042 message="Target:${target} "/>
david_williams60f2e6f2008-10-28 04:14:12 +000043 <echo
44 level="debug"
david_williams0f36b3b2009-01-15 02:07:34 +000045 message="basedir: ${basedir}"/>
david_williams60f2e6f2008-10-28 04:14:12 +000046 <echo
47 level="info"
david_williams0f36b3b2009-01-15 02:07:34 +000048 message="component: ${component}"/>
david_williams60f2e6f2008-10-28 04:14:12 +000049 <echo
50 level="debug"
david_williams0f36b3b2009-01-15 02:07:34 +000051 message="buildDirectory: ${buildDirectory}"/>
david_williams60f2e6f2008-10-28 04:14:12 +000052 <echo
53 level="debug"
david_williams0f36b3b2009-01-15 02:07:34 +000054 message="baseLocation: ${baseLocation}"/>
david_williams60f2e6f2008-10-28 04:14:12 +000055 <echo
56 level="debug"
david_williams0f36b3b2009-01-15 02:07:34 +000057 message="generic target: ${genericTargets}"/>
58 <echo
59 message="compilerArg: ${compilerArg}"/>
60 <echo
61 message="individualSourceBundles: ${individualSourceBundles}"/>
david_williams60f2e6f2008-10-28 04:14:12 +000062 <ant
63 antfile="${genericTargets}"
64 target="${target}">
65 <property
66 name="type"
david_williams0f36b3b2009-01-15 02:07:34 +000067 value="feature"/>
david_williams60f2e6f2008-10-28 04:14:12 +000068 <property
69 name="id"
david_williams0f36b3b2009-01-15 02:07:34 +000070 value="org.eclipse.wst.xml.vex_tests.feature"/>
david_williams60f2e6f2008-10-28 04:14:12 +000071 </ant>
72 </target>
david_williams0f36b3b2009-01-15 02:07:34 +000073 <!--
74 Targets to assemble the built elements for particular
75 configurations These generally call the generated assemble
76 scripts (named in ${assembleScriptName}) but may also add pre
77 and post processing Add one target for each root element and
78 each configuration
david_williams60f2e6f2008-10-28 04:14:12 +000079 -->
david_williams0f36b3b2009-01-15 02:07:34 +000080 <target
81 name="assemble.org.eclipse.wst.xml.vex_tests.feature">
david_williams60f2e6f2008-10-28 04:14:12 +000082 <property
83 name="archiveName"
david_williamsc879d9e2009-01-15 05:45:27 +000084 value="wtp-incubator-xml.vex-tests-${buildLabel}.zip"/>
david_williams60f2e6f2008-10-28 04:14:12 +000085 <ant
86 antfile="${assembleScriptName}"
david_williams0f36b3b2009-01-15 02:07:34 +000087 dir="${buildDirectory}"/>
david_williams60f2e6f2008-10-28 04:14:12 +000088 </target>
david_williams0f36b3b2009-01-15 02:07:34 +000089 <target
90 name="prePackage"/>
91 <target
92 name="postPackage">
david_williams60f2e6f2008-10-28 04:14:12 +000093 <property
94 name="archiveName"
david_williamsc879d9e2009-01-15 05:45:27 +000095 value="wtp-incubator-xml.vex-tests-${buildLabel}.zip"/>
david_williams60f2e6f2008-10-28 04:14:12 +000096 <ant
97 antfile="${wtp.builder.home}/scripts/build/buildutilities.xml"
98 target="unpackUpdateJarsAndCreateZippedPackages">
99 <property
100 name="buildDirectory"
david_williams0f36b3b2009-01-15 02:07:34 +0000101 value="${buildDirectory}"/>
david_williams60f2e6f2008-10-28 04:14:12 +0000102 <property
103 name="buildLabel"
david_williams0f36b3b2009-01-15 02:07:34 +0000104 value="${buildLabel}"/>
david_williams60f2e6f2008-10-28 04:14:12 +0000105 <property
106 name="archiveName"
david_williams0f36b3b2009-01-15 02:07:34 +0000107 value="${archiveName}"/>
david_williams60f2e6f2008-10-28 04:14:12 +0000108 </ant>
david_williams60f2e6f2008-10-28 04:14:12 +0000109 </target>
110
david_williams0f36b3b2009-01-15 02:07:34 +0000111 <!--
david_williams60f2e6f2008-10-28 04:14:12 +0000112 Check out map files from repository
113 -->
david_williams0f36b3b2009-01-15 02:07:34 +0000114 <target
115 name="getMapFiles">
116 <ant
117 antfile="${wtp.builder.home}/scripts/build/maptasks.xml"
118 target="maputil">
119 <property
120 name="mapcomponent"
121 value="${env.RELENG}"/>
122 <property
123 name="mapTag"
124 value="${mapVersionTag}"/>
125 </ant>
126 <ant
127 antfile="${wtp.builder.home}/scripts/build/maptasks.xml"
128 target="maputil">
129 <property
130 name="mapcomponent"
131 value="${env.RELENGINCUBATORVEX}"/>
132 <property
133 name="mapTag"
134 value="${mapVersionTag}"/>
135 </ant>
david_williams60f2e6f2008-10-28 04:14:12 +0000136 </target>
137
138
139 <!--
140 Steps to do before setup
141 -->
david_williams0f36b3b2009-01-15 02:07:34 +0000142 <target
143 name="preSetup"></target>
david_williams60f2e6f2008-10-28 04:14:12 +0000144 <!--
david_williams0f36b3b2009-01-15 02:07:34 +0000145 Steps to do after setup but before starting the build proper
david_williams60f2e6f2008-10-28 04:14:12 +0000146 -->
david_williams0f36b3b2009-01-15 02:07:34 +0000147 <target
148 name="postSetup">
david_williams60f2e6f2008-10-28 04:14:12 +0000149 <dirname
150 file="${ant.file}"
david_williams0f36b3b2009-01-15 02:07:34 +0000151 property="component.dir"/>
david_williams60f2e6f2008-10-28 04:14:12 +0000152 <echo
153 level="debug"
david_williams0f36b3b2009-01-15 02:07:34 +0000154 message="ant.file: ${ant.file}"/>
david_williams60f2e6f2008-10-28 04:14:12 +0000155 <echo
156 level="debug"
david_williams0f36b3b2009-01-15 02:07:34 +0000157 message="component.dir: ${component.dir}"/>
david_williams60f2e6f2008-10-28 04:14:12 +0000158
159 <!-- Get the dependencies -->
david_williams0f36b3b2009-01-15 02:07:34 +0000160 <antcall
161 target="getDependencies"/>
david_williams60f2e6f2008-10-28 04:14:12 +0000162 </target>
david_williams0f36b3b2009-01-15 02:07:34 +0000163 <!--
164 =====================================================================
165 -->
david_williams60f2e6f2008-10-28 04:14:12 +0000166 <!-- Get the dependencies based on releng maps -->
david_williams0f36b3b2009-01-15 02:07:34 +0000167 <!--
168 =====================================================================
169 -->
170 <target
171 name="getDependencies">
david_williams60f2e6f2008-10-28 04:14:12 +0000172 <ant
173 antfile="${component.dir}/dependency.xml"
174 target="get">
175 <property
176 name="base.install.dir"
david_williams0f36b3b2009-01-15 02:07:34 +0000177 value="${buildRoot}"/>
david_williams60f2e6f2008-10-28 04:14:12 +0000178 </ant>
david_williams60f2e6f2008-10-28 04:14:12 +0000179 </target>
180
181 <!--
182 Steps to do before fetching the build elements
183 -->
david_williams0f36b3b2009-01-15 02:07:34 +0000184 <target
185 name="preFetch"></target>
david_williams60f2e6f2008-10-28 04:14:12 +0000186
187 <!--
188 Steps to do after fetching the build elements
189 -->
david_williams0f36b3b2009-01-15 02:07:34 +0000190 <target
191 name="postFetch"></target>
david_williams60f2e6f2008-10-28 04:14:12 +0000192
193 <!--
194 Steps to do before generating the build scripts.
195 -->
david_williams0f36b3b2009-01-15 02:07:34 +0000196 <target
197 name="preGenerate"></target>
198
david_williams60f2e6f2008-10-28 04:14:12 +0000199 <!--
200 Steps to do after generating the build scripts.
201 -->
david_williams0f36b3b2009-01-15 02:07:34 +0000202 <target
203 name="postGenerate">
204 <echo
205 message="buildDirectory: ${buildDirectory}"/>
david_williams60f2e6f2008-10-28 04:14:12 +0000206 <customizeAccessRules
207 bundleDirectory="${buildDirectory}/plugins"/>
208 </target>
david_williams0f36b3b2009-01-15 02:07:34 +0000209 <!--
210 Steps to do before running the build.xmls for the elements being
211 built.
david_williams60f2e6f2008-10-28 04:14:12 +0000212 -->
david_williams0f36b3b2009-01-15 02:07:34 +0000213 <target
214 name="preProcess">
david_williams60f2e6f2008-10-28 04:14:12 +0000215 <replace
216 dir="${buildDirectory}/plugins"
217 value="${timestamp}"
218 token="@build@">
david_williams0f36b3b2009-01-15 02:07:34 +0000219 <include
220 name="**/about.mappings"/>
david_williams60f2e6f2008-10-28 04:14:12 +0000221 </replace>
222 </target>
david_williams60f2e6f2008-10-28 04:14:12 +0000223 <!--
david_williams0f36b3b2009-01-15 02:07:34 +0000224 Steps to do after running the build.xmls for the elements being
225 built.
david_williams60f2e6f2008-10-28 04:14:12 +0000226 -->
david_williams0f36b3b2009-01-15 02:07:34 +0000227 <target
228 name="postProcess">
229 <condition
230 property="logsAvailable">
231 <istrue
232 value="${javacVerbose}"/>
david_williams60f2e6f2008-10-28 04:14:12 +0000233 </condition>
david_williams0f36b3b2009-01-15 02:07:34 +0000234 <antcall
235 target="gatherLogs"/>
david_williams60f2e6f2008-10-28 04:14:12 +0000236 </target>
237
238
david_williams0f36b3b2009-01-15 02:07:34 +0000239 <!--
david_williams60f2e6f2008-10-28 04:14:12 +0000240 Steps to do before running assemble.
241 -->
david_williams0f36b3b2009-01-15 02:07:34 +0000242 <target
243 name="preAssemble"></target>
david_williams60f2e6f2008-10-28 04:14:12 +0000244
245 <!--
246 Steps to do after running assemble.
247 -->
david_williams0f36b3b2009-01-15 02:07:34 +0000248 <target
249 name="postAssemble"></target>
david_williams60f2e6f2008-10-28 04:14:12 +0000250
251 <!--
252 Steps to do after the build is done.
253 -->
david_williams0f36b3b2009-01-15 02:07:34 +0000254 <target
255 name="postBuild"></target>
david_williams60f2e6f2008-10-28 04:14:12 +0000256
257 <!--
258 Steps to do to test the build results
david_williams0f36b3b2009-01-15 02:07:34 +0000259 -->
260 <target
261 name="test"></target>
david_williams60f2e6f2008-10-28 04:14:12 +0000262
263 <!--
264 Steps to do to publish the build results
265 -->
david_williams0f36b3b2009-01-15 02:07:34 +0000266 <target
267 name="publish"></target>
david_williams60f2e6f2008-10-28 04:14:12 +0000268
269 <!--
270 Helper targets
271 -->
david_williams0fadc4e2010-03-01 04:45:19 +0000272 <target
273 name="gatherLogs"
274 if="logsAvailable">
275 <mkdir
david_williams0f36b3b2009-01-15 02:07:34 +0000276 dir="${buildDirectory}/${buildLabel}/testcompilelogs"/>
david_williams0fadc4e2010-03-01 04:45:19 +0000277 <echo
278 level="debug"
279 message="logExtension: ${logExtension}"/>
280 <antcall
281 target="allElements">
282 <param
283 name="target"
284 value="gatherLogs"/>
285 <param
286 name="logExtension"
287 value="${logExtension}"/>
288 </antcall>
289 <unzip
david_williams60f2e6f2008-10-28 04:14:12 +0000290 dest="${buildDirectory}/${buildLabel}/testcompilelogs"
291 overwrite="true">
david_williams0fadc4e2010-03-01 04:45:19 +0000292 <fileset
david_williams60f2e6f2008-10-28 04:14:12 +0000293 dir="${buildDirectory}/features/org.eclipse.wst.xml.vex_tests.feature">
david_williams0fadc4e2010-03-01 04:45:19 +0000294 <include
295 name="**/*.log.zip"/>
296 </fileset>
297 </unzip>
298 <!--
299 TODO: it is unclear if the above "gather" and unzip do
300 anything constructive. I think not and should be removed
301 (after experimental run, of course.
302 -->
303 <!--
304 workaround: see
305 https://bugs.eclipse.org/bugs/show_bug.cgi?id=156043 and
306 https://bugs.eclipse.org/bugs/show_bug.cgi?id=172361 and
307 https://bugs.eclipse.org/bugs/show_bug.cgi?id=294070
308 -->
309 <copy
310 todir="${buildDirectory}/${buildLabel}/testcompilelogs/plugins"
311 overwrite="true">
312 <!--
313 we want all @dot.xml files, but assumes a certain
314 structure, to include directory for name of plugin
315 -->
316 <fileset
317 dir="${buildDirectory}/features/">
318 <include
319 name="**/feature.temp.folder/"/>
320 <exclude
321 name="**/*tests*feature*/feature.temp.folder/"/>
322 </fileset>
323 <compositemapper>
324 <mapper
325 type="regexp"
326 from="(.*)/plugins/(.*)/@dot.xml"
327 to="/\2/@dot.xml"/>
328 <mapper
329 type="regexp"
330 from="(.*)/plugins/(.*)/(.*)bin.xml"
331 to="/\2/\3bin.xml"/>
332 </compositemapper>
333 </copy>
334 </target>
david_williams60f2e6f2008-10-28 04:14:12 +0000335 <target
336 name="clean"
337 unless="noclean">
david_williams0f36b3b2009-01-15 02:07:34 +0000338 <antcall
339 target="allElements">
david_williams60f2e6f2008-10-28 04:14:12 +0000340 <param
341 name="target"
david_williams0f36b3b2009-01-15 02:07:34 +0000342 value="cleanElement"/>
david_williams60f2e6f2008-10-28 04:14:12 +0000343 </antcall>
344 </target>
345
346 <!--
347 Default target
348 -->
david_williams0f36b3b2009-01-15 02:07:34 +0000349 <target
350 name="noDefault">
david_williams60f2e6f2008-10-28 04:14:12 +0000351 <echo
352 level="error"
david_williams0f36b3b2009-01-15 02:07:34 +0000353 message="You must specify a target when invoking this file"/>
david_williams60f2e6f2008-10-28 04:14:12 +0000354 </target>
david_williams0f36b3b2009-01-15 02:07:34 +0000355</project>