blob: f8a1423e1b7257bcc8aa8acf8e551bfbf6fb5f53 [file] [log] [blame]
david_williams42f9b242006-11-27 18:45:14 +00001<?xml version="1.0" encoding="UTF-8"?>
david_williams2171a5b2008-02-10 08:15:08 +00002<project
3 name="runbuild"
4 default="runbuild"
5 basedir=".">
david_williams42f9b242006-11-27 18:45:14 +00006
david_williamsad2097e2008-01-28 06:06:12 +00007 <!-- = = = standard properties pattern = = = -->
8 <!--
david_williams9505a3e2007-06-29 23:42:47 +00009 Note to be cross-platform, "environment variables" are only appropriate for
david_williams42f9b242006-11-27 18:45:14 +000010 some variables, e.g. ones we set, since properties are case sensitive, even if
11 the environment variables on your operating system are not, e.g. it will
12 be ${env.Path} not ${env.PATH} on Windows -->
david_williams2171a5b2008-02-10 08:15:08 +000013 <property
14 environment="env" />
david_williams9505a3e2007-06-29 23:42:47 +000015
david_williamsad2097e2008-01-28 06:06:12 +000016 <!--
david_williams9505a3e2007-06-29 23:42:47 +000017 Let users override standard properties, if desired.
18 If directory, file, or some properties do not exist,
19 then standard properties will be used.
20 -->
david_williams2171a5b2008-02-10 08:15:08 +000021 <property
22 file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties" />
david_williams42f9b242006-11-27 18:45:14 +000023
david_williamsad2097e2008-01-28 06:06:12 +000024 <!-- = = = end standard properties pattern = = = -->
david_williams2171a5b2008-02-10 08:15:08 +000025 <fail
26 unless="env.BUILD_HOME"
27 message="all scripts need a BUILD_HOME" />
28 <echo
29 level="info"
30 message="buildDirectory: ${buildDirectory}" />
31 <property
32 name="keyCfgFile"
33 value="${env.PROJECT_BUILDERS}/${projectname}/${env.RELENG}/maps/build.cfg" />
34 <echo
35 message="keyCfgFile: ${keyCfgFile}" />
36 <property
37 file="${keyCfgFile}" />
38 <fail
39 unless="builderVersion"
40 message="Could not get builderVersion. Probably could not checkout build.cfg?" />
41 <fail
42 unless="eclipse.builder.version"
43 message="Could not get eclipse.builder.version. Perhaps an old format build.cfg?" />
44 <property
45 name="basebuilder.path"
46 value="${env.BASE_BUILDERS}/${eclipse.builder.version}" />
david_williams9505a3e2007-06-29 23:42:47 +000047
david_williamsce156292006-12-11 00:12:35 +000048
david_williams403beae2007-12-09 02:10:40 +000049
david_williamsad2097e2008-01-28 06:06:12 +000050 <!-- if not explicitly set by caller, we'll assume we should fail
david_williams9505a3e2007-06-29 23:42:47 +000051 here on errors. In some cases, such as JUnit test compiles, or
52 even leaf components, the caller may want to set to false, so that
53 some part of the build is still made available -->
david_williams2171a5b2008-02-10 08:15:08 +000054 <property
55 name="eclipseBuildFailOnError"
56 value="true" />
57 <target
58 name="runbuild">
59 <dirname
60 file="${ant.file}"
61 property="scripts.build.dir" />
62 <property
63 name="wtp.builder.home"
64 value="${scripts.build.dir}/../../.." />
65 <antcall
66 target="runEclipseBuild" />
67 </target>
68 <target
69 name="build"
70 depends="init">
david_williams42f9b242006-11-27 18:45:14 +000071
david_williamsad2097e2008-01-28 06:06:12 +000072 <!--this property required as of Eclipse 3.0 stream builds > 20031126 -->
david_williams2171a5b2008-02-10 08:15:08 +000073 <property
74 name="buildingOSGi"
75 value="true" />
david_williams42f9b242006-11-27 18:45:14 +000076
david_williamsad2097e2008-01-28 06:06:12 +000077 <!-- this generateFeatureVersionSuffix property causes feature
david_williams42f9b242006-11-27 18:45:14 +000078 suffixes to be calcuated based on their
79 own CVS tag, plus the qualifier of their contained plugins -->
david_williamsad2097e2008-01-28 06:06:12 +000080 <!--
david_williams42f9b242006-11-27 18:45:14 +000081 https://bugs.eclipse.org/bugs/show_bug.cgi?id=138825
82 false for builds intended for 3.1.2, since can generate underscores
83 true for builds instended for 3.2
84 -->
david_williams2171a5b2008-02-10 08:15:08 +000085 <property
86 name="generateFeatureVersionSuffix"
87 value="true" />
88 <property
89 name="outputUpdateJars"
90 value="true" />
91 <property
92 name="runPackager"
93 value="true" />
david_williams52d0fc02007-05-06 06:08:38 +000094
david_williamsad2097e2008-01-28 06:06:12 +000095 <!--run the build for the specified component-->
david_williams2171a5b2008-02-10 08:15:08 +000096 <echo
97 level="debug"
98 message="basedir: ${basedir}" />
99 <echo
100 level="debug"
101 message="component: ${component}" />
102 <echo
103 level="debug"
104 message="buildDirectory: ${buildDirectory}" />
105 <echo
106 level="debug"
107 message="wtp.builder.home: ${wtp.builder.home}" />
108 <echo
109 level="debug"
110 message="buildBranch: ${buildBranch}" />
111 <fail
112 unless="buildBranch" />
113 <ant
114 antfile="build.xml"
115 dir="${pde.build.scripts}">
116 <property
117 name="builder"
118 value="${wtp.builder.home}/components/${component}" />
119 <property
120 name="wtp.builder.home"
121 value="${wtp.builder.home}" />
122 <property
123 name="buildBranch"
124 value="${buildBranch}" />
125 <property
126 name="dependencyTargets"
127 value="${wtp.builder.home}/scripts/dependency/build.xml" />
128 <property
129 name="local.cache.dir"
130 value="${env.LOCAL_PREREQS_CACHE}" />
131 <property
132 name="baseLocation"
133 value="${env.PROJECT_PROJECTS}/${projectname}/eclipse" />
134 <property
135 name="buildRoot"
136 value="${env.PROJECT_PROJECTS}/${projectname}" />
137 <property
138 name="testRoot"
139 value="${env.PROJECT_TESTS}/${projectname}" />
140 <property
141 name="performanceRoot"
142 value="${env.BUILD_HOME}/${build.perf.tests}-${buildType}" />
143 </ant>
144 </target>
145 <target
146 name="checkBaseBuilder"
147 depends="checkWTPBaseBuilder">
david_williams13d378c2007-08-22 04:04:54 +0000148
david_williamsad2097e2008-01-28 06:06:12 +0000149 <!-- we just check if both base, and our wtp specific one are current, if
david_williamsec797932007-06-30 19:17:08 +0000150 either is not, we'll get them both -->
david_williams2171a5b2008-02-10 08:15:08 +0000151 <condition
152 property="basebuilderlocal">
153 <and>
154 <available
155 file="${pde.builder.path}" />
david_williamsad2097e2008-01-28 06:06:12 +0000156 <!-- should we check explicitly for "true" instead of just isset?
david_williams13d378c2007-08-22 04:04:54 +0000157 either should work for this case, but which is better ant style? -->
david_williams2171a5b2008-02-10 08:15:08 +0000158 <isset
159 property="wtpBuilderPresent" />
160 </and>
161 </condition>
162 <echo
163 message="basebuilderlocal: ${basebuilderlocal}" />
164 <echo
165 message="wtpBuilderPresent: ${wtpBuilderPresent}" />
166 </target>
167 <target
168 name="getBaseBuilder"
169 depends="init,checkBaseBuilder"
170 unless="basebuilderlocal">
david_williamsad2097e2008-01-28 06:06:12 +0000171 <!-- *** change the repo info -->
david_williams2171a5b2008-02-10 08:15:08 +0000172 <property
173 name="builderCvsRoot"
174 value=":pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse" />
david_williams05dbe622007-12-09 01:20:57 +0000175
david_williamsad2097e2008-01-28 06:06:12 +0000176 <!-- note: untagged or some default version of base builder is not good to use.
david_williams42f9b242006-11-27 18:45:14 +0000177 in some cases, won't run at all, in the best of cases, will simply
david_williams4fa630e2007-02-17 21:46:07 +0000178 be unstable, so we'll fail if we forgot to specify it -->
david_williams2171a5b2008-02-10 08:15:08 +0000179 <fail
180 unless="eclipse.builder.version" />
181 <mkdir
182 dir="${env.BASE_BUILDERS}/${eclipse.builder.version}" />
183 <cvs
184 quiet="${env.CVS_QUIET}"
185 reallyquiet="${env.CVS_REALLY_QUIET}"
186 cvsRoot="${builderCvsRoot}"
187 package="${eclipse.builder}"
188 dest="${basebuilder.path}"
189 tag="${eclipse.builder.version}" />
190 <fail
191 unless="wtpBuildTools.url" />
david_williamsad2097e2008-01-28 06:06:12 +0000192 <!-- now add our WTP base builder if not there -->
david_williams2171a5b2008-02-10 08:15:08 +0000193 <antcall
194 target="getWTPBaseBuilder" />
195 </target>
196 <target
197 name="getWTPBaseBuilder"
198 depends="checkWTPBaseBuilder"
199 unless="wtpBuilderPresent">
200 <get
201 dest="${basebuilder.path}/org.eclipse.releng.basebuilder/plugins/${wtpBuildTools.file}"
202 src="${wtpBuildTools.url}/${wtpBuildTools.file}"
203 usetimestamp="true" />
204 </target>
205 <target
206 name="checkWTPBaseBuilder">
207 <condition
208 property="wtpBuilderPresent">
209 <available
210 file="${basebuilder.path}/org.eclipse.releng.basebuilder/plugins/${wtpBuildTools.file}" />
211 </condition>
212 </target>
213 <target
214 name="init">
215 <condition
216 property="buildBranch"
217 value="R3.0">
218 <equals
219 arg1="${mapVersionTag}"
220 arg2="HEAD" />
221 </condition>
222 <condition
223 property="buildBranch"
224 value="R0.7">
225 <equals
226 arg1="${mapVersionTag}"
227 arg2="R0_7_maintenance" />
228 </condition>
229 <condition
230 property="buildBranch"
231 value="R1.0">
232 <equals
233 arg1="${mapVersionTag}"
234 arg2="R1_0_maintenance" />
235 </condition>
236 <condition
237 property="buildBranch"
238 value="R1.5">
239 <equals
240 arg1="${mapVersionTag}"
241 arg2="R1_5_maintenance" />
242 </condition>
243 <condition
244 property="buildBranch"
245 value="R1.5">
246 <equals
247 arg1="${mapVersionTag}"
248 arg2="R1_5_5_patches" />
249 </condition>
250 <condition
251 property="buildBranch"
252 value="R2.0">
253 <equals
254 arg1="${mapVersionTag}"
255 arg2="R2_0_maintenance" />
david_williams26f3a5f2008-03-07 22:56:23 +0000256 </condition>
257 <condition
258 property="buildBranch"
259 value="R2.0">
260 <equals
261 arg1="${mapVersionTag}"
262 arg2="R2_0_2_patches" />
263 </condition>
david_williamsad2097e2008-01-28 06:06:12 +0000264 <!-- if not set above, assume R3.0 -->
265 <!-- this happens, for example, when using a "tempTest" branch -->
david_williams2171a5b2008-02-10 08:15:08 +0000266 <property
267 name="buildBranch"
268 value="R3.0" />
david_williamsec797932007-06-30 19:17:08 +0000269
david_williamsad2097e2008-01-28 06:06:12 +0000270 <!-- strip trailing blanks. Seems either Eclipse, or CVS make it hard to not have trailing spaces -->
david_williams2171a5b2008-02-10 08:15:08 +0000271 <replaceregexp
272 flags="gm"
273 file="${wtp.builder.home}/build.properties"
274 match=" *$"
275 replace="" />
276 <property
277 file="${wtp.builder.home}/build.properties" />
278 <ant
279 antfile="${wtp.builder.home}/scripts/build/label.xml" />
280 <property
281 file="${buildDirectory}/label.properties" />
david_williams42f9b242006-11-27 18:45:14 +0000282
david_williamsad2097e2008-01-28 06:06:12 +0000283 <!--fetch the HEAD stream of all projects if build type specified as N-->
david_williams2171a5b2008-02-10 08:15:08 +0000284 <condition
285 property="fetchTag"
286 value="HEAD">
287 <equals
288 arg1="${buildType}"
289 arg2="N" />
290 </condition>
291 <condition
292 property="tagMaps">
293 <equals
david_williams7d822c82008-02-24 04:27:41 +0000294 arg1="${build.donottagmaps}"
david_williams2171a5b2008-02-10 08:15:08 +0000295 arg2="false" />
296 </condition>
297 </target>
298 <target
299 name="runEclipseBuild"
300 if="buildId">
301 <fail
302 unless="eclipse.builder.version" />
david_williams403beae2007-12-09 02:10:40 +0000303
david_williamsad2097e2008-01-28 06:06:12 +0000304 <!-- if not otherwise set "externally", set the classpath jars for
david_williams403beae2007-12-09 02:10:40 +0000305 the Execution Envirnonments we need in WTP.
306 And other parameters we need set.
307 To successfully do local builds, most of these do have to be provided
308 externally, such as in "localbuildproperties" directory -->
david_williams2171a5b2008-02-10 08:15:08 +0000309 <property
310 name="J2SE-1.4"
311 value="${env.JAVA_4_HOME}/jre/lib/core.jar:${env.JAVA_4_HOME}/jre/lib/xml.jar:${env.JAVA_4_HOME}/jre/lib/graphics.jar:${env.JAVA_4_HOME}/jre/lib/server.jar:${env.JAVA_4_HOME}/jre/lib/ibmorbapi.jar:${env.JAVA_4_HOME}/jre/lib/security.jar" />
312 <property
313 name="J2SE-1.5"
314 value="${env.JAVA_5_HOME}/jre/lib/core.jar:${env.JAVA_5_HOME}/jre/lib/vm.jar:${env.JAVA_5_HOME}/jre/lib/xml.jar:${env.JAVA_5_HOME}/jre/lib/graphics.jar:${env.JAVA_5_HOME}/jre/lib/server.jar:${env.JAVA_5_HOME}/jre/lib/ibmorbapi.jar:${env.JAVA_5_HOME}/jre/lib/security.jar" />
david_williamse4638bf2007-12-09 04:49:04 +0000315
david_williams7d822c82008-02-24 04:27:41 +0000316 <!-- local builds must set build.donottagmaps to true, in runbuild.properties, to avoid erroneous time stamps -->
david_williams2171a5b2008-02-10 08:15:08 +0000317 <property
david_williams7d822c82008-02-24 04:27:41 +0000318 name="build.donottagmaps"
david_williams2171a5b2008-02-10 08:15:08 +0000319 value="false" />
320 <fail
321 unless="J2SE-1.5"
322 message="classpath to J2SE-1.5 Execution Environment must be set" />
323 <fail
324 unless="J2SE-1.4"
325 message="classpath to J2SE-1.4 Execution Environment must be set" />
david_williams403beae2007-12-09 02:10:40 +0000326
david_williamsad2097e2008-01-28 06:06:12 +0000327 <!-- we read these in as ant properties, so in java call below, we convert
david_williamsfdbd7992007-12-10 17:31:57 +0000328 them to system (environment) properties, which is where PDE expects to find them -->
david_williams2171a5b2008-02-10 08:15:08 +0000329 <echo
330 message="J2SE-1.5=${J2SE-1.5}" />
331 <echo
332 message="J2SE-1.4=${J2SE-1.4}" />
333 <java
334 taskname="build-${build.distribution}-${component}"
335 jar="${eclipse.launcher}"
336 fork="true"
337 failonerror="${eclipseBuildFailOnError}">
338 <jvmarg
339 value="-Djava.protocol.handler.pkgs=com.ibm.etools.www.protocol" />
340 <jvmarg
341 value="-DurlLogLocation=${buildDirectory}/outgoinghttplogfromcodebuild.log" />
342 <jvmarg
343 value="-Dosgi.ws=${env.BASEWS}" />
344 <jvmarg
345 value="-Dosgi.os=${env.BASEOS}" />
346 <jvmarg
347 value="-Dosgi.arch=${env.BASEARCH}" />
348 <jvmarg
349 value="-Dbuild.home=${env.BUILD_HOME}" />
350 <jvmarg
351 value="-DJAVA_5_HOME=${env.JAVA_5_HOME}" />
352 <jvmarg
353 value="-DJAVA_4_HOME=${env.JAVA_4_HOME}" />
354 <jvmarg
355 value="-DJ2SE-1.5=${J2SE-1.5}" />
356 <jvmarg
357 value="-DJ2SE-1.4=${J2SE-1.4}" />
358 <jvmarg
david_williams7d822c82008-02-24 04:27:41 +0000359 value="-Dbuild.donottagmaps=${build.donottagmaps}" />
david_williams2171a5b2008-02-10 08:15:08 +0000360 <jvmarg
361 value="-DbuildType=${buildType}" />
362 <jvmarg
363 value="-DbuildId=${buildId}" />
364 <jvmarg
365 value="-Dosgi.clean=true" />
366 <jvmarg
367 value="-DmapVersionTag=${mapVersionTag}" />
368 <jvmarg
369 value="-Declipse.builder.version=${eclipse.builder.version}" />
370 <jvmarg
371 value="-Declipse.builder=${eclipse.builder}" />
372 <jvmarg
373 value="-Dprojectname=${projectname}" />
374 <jvmarg
375 value="-Dreleng.jsf-mapVersionTag=${releng.jsf-mapVersionTag}" />
376 <jvmarg
377 value="-Dreleng.dali-mapVersionTag=${releng.dali-mapVersionTag}" />
378 <jvmarg
379 value="-Dwtp.builder.home=${wtp.builder.home}" />
380 <jvmarg
381 value="-Dbuild.distribution=${build.distribution}" />
382 <jvmarg
383 value="-Dcomponent=${component}" />
384 <jvmarg
385 value="-Dbasebiulder.path=${basebuilder.path}" />
386 <jvmarg
387 value="-DwtpBuildTools.file=${wtpBuildTools.file}" />
david_williamsc8b6cac2008-03-05 06:15:17 +0000388 <jvmarg value="-Djava.io.tmpdir=${env.RECOMMENDED_TMP_DIR}" />
389 <jvmarg value="-DSKIP_JAR_SIGNING=${SKIP_JAR_SIGNING}" />
david_williams2171a5b2008-02-10 08:15:08 +0000390 <arg
391 value="-application" />
392 <arg
393 value="org.eclipse.ant.core.antRunner" />
394 <arg
395 value="-buildfile" />
396 <arg
397 value="${ant.file}" />
398 <arg
399 value="build" />
400 </java>
401 </target>
402</project>