blob: e162ea66b68efdbfb7f86a5cc948175cdd5807f1 [file] [log] [blame]
david_williams42f9b242006-11-27 18:45:14 +00001<?xml version="1.0" encoding="UTF-8"?>
david_williams9505a3e2007-06-29 23:42:47 +00002<project
3 name="runbuild"
4 default="runbuild"
5 basedir=".">
david_williams42f9b242006-11-27 18:45:14 +00006
7 <!-- = = = 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 -->
13 <property environment="env" />
david_williams9505a3e2007-06-29 23:42:47 +000014
david_williams42f9b242006-11-27 18:45:14 +000015 <!--
david_williams9505a3e2007-06-29 23:42:47 +000016 Let users override standard properties, if desired.
17 If directory, file, or some properties do not exist,
18 then standard properties will be used.
19 -->
20 <property
21 file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties" />
david_williams42f9b242006-11-27 18:45:14 +000022
23 <!-- load standard properties for production environment -->
david_williams9505a3e2007-06-29 23:42:47 +000024 <property
25 file="${env.STANDARD_PROPERTIES_DIR}/${ant.project.name}.properties" />
david_williams42f9b242006-11-27 18:45:14 +000026 <!-- = = = end standard properties pattern = = = -->
27
david_williams9505a3e2007-06-29 23:42:47 +000028
david_williamsce156292006-12-11 00:12:35 +000029
30 <!-- if not explicitly set by caller, we'll assume we should fail
david_williams9505a3e2007-06-29 23:42:47 +000031 here on errors. In some cases, such as JUnit test compiles, or
32 even leaf components, the caller may want to set to false, so that
33 some part of the build is still made available -->
34 <property
35 name="eclipseBuildFailOnError"
36 value="true" />
david_williamsce156292006-12-11 00:12:35 +000037
david_williams42f9b242006-11-27 18:45:14 +000038
39 <target name="runbuild">
david_williams9505a3e2007-06-29 23:42:47 +000040 <dirname
41 file="${ant.file}"
42 property="scripts.build.dir" />
43 <property
44 name="wtp.builder.home"
45 value="${scripts.build.dir}/../.." />
david_williams42f9b242006-11-27 18:45:14 +000046
47 <antcall target="runEclipseBuild">
david_williams9505a3e2007-06-29 23:42:47 +000048 <param
49 name="wtp.builder.home"
50 value="${wtp.builder.home}" />
david_williams42f9b242006-11-27 18:45:14 +000051 </antcall>
52 <antcall target="runEclipseBuildStamped">
david_williams9505a3e2007-06-29 23:42:47 +000053 <param
54 name="wtp.builder.home"
55 value="${wtp.builder.home}" />
david_williams42f9b242006-11-27 18:45:14 +000056 </antcall>
57 </target>
58
59
60
david_williams9505a3e2007-06-29 23:42:47 +000061 <target
62 name="build"
63 depends="init">
david_williams42f9b242006-11-27 18:45:14 +000064
65 <!--this property required as of Eclipse 3.0 stream builds > 20031126 -->
david_williams9505a3e2007-06-29 23:42:47 +000066 <property
67 name="buildingOSGi"
68 value="true" />
david_williams42f9b242006-11-27 18:45:14 +000069
70 <!-- this generateFeatureVersionSuffix property causes feature
71 suffixes to be calcuated based on their
72 own CVS tag, plus the qualifier of their contained plugins -->
73 <!--
74 https://bugs.eclipse.org/bugs/show_bug.cgi?id=138825
75 false for builds intended for 3.1.2, since can generate underscores
76 true for builds instended for 3.2
77 -->
david_williams9505a3e2007-06-29 23:42:47 +000078 <property
79 name="generateFeatureVersionSuffix"
80 value="true" />
david_williams42f9b242006-11-27 18:45:14 +000081
david_williams9505a3e2007-06-29 23:42:47 +000082 <property
83 name="outputUpdateJars"
84 value="true" />
david_williams42f9b242006-11-27 18:45:14 +000085
david_williams9505a3e2007-06-29 23:42:47 +000086 <property
87 name="runPackager"
88 value="true" />
david_williams52d0fc02007-05-06 06:08:38 +000089
david_williams42f9b242006-11-27 18:45:14 +000090 <!--run the build for the specified component-->
91 <echo message="basedir: ${basedir}" />
david_williamsf1fa0422006-11-28 22:36:04 +000092 <echo message="component: ${component}" />
david_williams42f9b242006-11-27 18:45:14 +000093 <echo message="buildDirectory: ${buildDirectory}" />
94 <echo message="wtp.builder.home: ${wtp.builder.home}" />
david_williamsec797932007-06-30 19:17:08 +000095 <echo message="buildBranch: ${buildBranch}" />
96
97 <fail unless="buildBranch" />
david_williams42f9b242006-11-27 18:45:14 +000098
david_williams9505a3e2007-06-29 23:42:47 +000099 <ant
100 antfile="build.xml"
101 dir="${pde.build.scripts}">
102 <property
103 name="builder"
104 value="${wtp.builder.home}/components/${component}" />
105 <property
106 name="wtp.builder.home"
107 value="${wtp.builder.home}" />
108 <property
109 name="buildBranch"
110 value="${buildBranch}" />
111 <property
112 name="cvsUser"
113 value="${cvsUser}" />
114 <property
115 name="cvsProtocol"
116 value="${cvsProtocol}" />
117 <property
118 name="dependencyTargets"
119 value="${wtp.builder.home}/scripts/dependency/build.xml" />
120 <property
121 name="local.cache.dir"
122 value="${env.LOCAL_PREREQS_CACHE}" />
123 <property
124 name="baseLocation"
125 value="${env.BUILD_HOME}/${build.current}-${build.distribution}-${buildBranch}-${buildType}/${base.location}" />
126 <property
127 name="build.pack-all-in-one"
128 value="${build.pack-all-in-one}" />
129 <property
130 name="buildRoot"
131 value="${env.BUILD_HOME}/${build.current}-${build.distribution}-${buildBranch}-${buildType}" />
132 <property
133 name="testRoot"
134 value="${env.BUILD_HOME}/${build.tests}-${build.distribution}-${buildBranch}-${buildType}" />
135 <property
136 name="performanceRoot"
137 value="${env.BUILD_HOME}/${build.perf.tests}-${buildType}" />
david_williams42f9b242006-11-27 18:45:14 +0000138 </ant>
139 </target>
140
david_williamsec797932007-06-30 19:17:08 +0000141 <target name="checkBaseBuilder" depends="checkWTPBaseBuilder">
142
143 <!-- we just check if both base, and our wtp specific one are current, if
144 either is not, we'll get them both -->
145
146 <condition property="basebuilderLocal">
147 <and>
148 <available file="${pde.builder.path}" />
149 <!-- should we check explicitly for "true" instead of just isset?
150 either should work for this case, but which is better ant style? -->
151 <isset property="wtpBuilderPresent"/>
152 </and>
153 </condition>
154
155
david_williams42f9b242006-11-27 18:45:14 +0000156 </target>
157
david_williams9505a3e2007-06-29 23:42:47 +0000158 <target
159 name="getBaseBuilder"
david_williams79b85742007-06-30 19:43:47 +0000160 depends="init,checkBaseBuilder"
david_williams9505a3e2007-06-29 23:42:47 +0000161 unless="basebuilderLocal">
david_williams42f9b242006-11-27 18:45:14 +0000162 <!-- *** change the repo info -->
david_williams9505a3e2007-06-29 23:42:47 +0000163 <property
164 name="builderCvsRoot"
165 value=":pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse" />
166 <property
167 name="basebuilder.path"
168 value="${env.BUILD_HOME}/builders/${eclipse.builder.version}" />
david_williams4fa630e2007-02-17 21:46:07 +0000169 <!-- note: untagged or some default version of base builder is not good to use.
david_williams42f9b242006-11-27 18:45:14 +0000170 in some cases, won't run at all, in the best of cases, will simply
david_williams4fa630e2007-02-17 21:46:07 +0000171 be unstable, so we'll fail if we forgot to specify it -->
david_williams9505a3e2007-06-29 23:42:47 +0000172 <fail unless="eclipse.builder.version" />
173 <mkdir
174 dir="${env.BUILD_HOME}/builders/${eclipse.builder.version}" />
175 <cvs
176 cvsRoot="${builderCvsRoot}"
177 package="org.eclipse.releng.basebuilder"
178 dest="${basebuilder.path}"
179 tag="${eclipse.builder.version}" />
david_williams64872882007-05-02 06:04:36 +0000180
david_williams9505a3e2007-06-29 23:42:47 +0000181
182 <fail unless="wtpBuildTools.url" />
183 <!-- now add our WTP base builder if not there -->
david_williamsec797932007-06-30 19:17:08 +0000184 <antcall target="getWTPBaseBuilder" />
david_williams64872882007-05-02 06:04:36 +0000185
david_williams42f9b242006-11-27 18:45:14 +0000186 </target>
187
david_williamsc2796252007-06-30 04:41:27 +0000188 <target
189 name="getWTPBaseBuilder"
190 depends="checkWTPBaseBuilder"
191 unless="wtpBuilderPresent">
192 <get
193 dest="${basebuilder.path}/org.eclipse.releng.basebuilder/plugins/${wtpBuildTools.file}"
194 src="${wtpBuildTools.url}/${wtpBuildTools.file}"
195 usetimestamp="true" />
196 </target>
david_williams42f9b242006-11-27 18:45:14 +0000197
david_williamsc2796252007-06-30 04:41:27 +0000198 <target name="checkWTPBaseBuilder">
199 <condition property="wtpBuilderPresent">
200 <available
201 file="${basebuilder.path}/org.eclipse.releng.basebuilder/plugins/${wtpBuildTools.file}" />
202 </condition>
203 </target>
204
205
206
207
208
david_williams42f9b242006-11-27 18:45:14 +0000209 <target name="init">
210
211
david_williams9505a3e2007-06-29 23:42:47 +0000212 <condition
213 property="buildBranch"
david_williamsc2796252007-06-30 04:41:27 +0000214 value="R3.0">
david_williams9505a3e2007-06-29 23:42:47 +0000215 <equals
216 arg1="${mapVersionTag}"
217 arg2="HEAD" />
david_williams42f9b242006-11-27 18:45:14 +0000218 </condition>
david_williams9505a3e2007-06-29 23:42:47 +0000219 <condition
220 property="buildBranch"
221 value="R0.7">
222 <equals
223 arg1="${mapVersionTag}"
224 arg2="R0_7_maintenance" />
david_williams42f9b242006-11-27 18:45:14 +0000225 </condition>
david_williams9505a3e2007-06-29 23:42:47 +0000226 <condition
227 property="buildBranch"
228 value="R1.0">
229 <equals
230 arg1="${mapVersionTag}"
231 arg2="R1_0_maintenance" />
david_williams42f9b242006-11-27 18:45:14 +0000232 </condition>
david_williams9505a3e2007-06-29 23:42:47 +0000233 <condition
234 property="buildBranch"
235 value="R1.5">
236 <equals
237 arg1="${mapVersionTag}"
238 arg2="R1_5_maintenance" />
david_williams42f9b242006-11-27 18:45:14 +0000239 </condition>
david_williamsc2796252007-06-30 04:41:27 +0000240 <condition
241 property="buildBranch"
242 value="R2.0">
243 <equals
244 arg1="${mapVersionTag}"
245 arg2="R2_0_maintenance" />
246 </condition>
247 <!-- if not set above, assume R3.0 -->
248 <!-- this happens, for example, when using a "tempTest" branch -->
249 <property
250 name="buildBranch"
251 value="R3.0" />
david_williamsec797932007-06-30 19:17:08 +0000252
david_williams42f9b242006-11-27 18:45:14 +0000253 <property file="${wtp.builder.home}/build.properties" />
david_williams9505a3e2007-06-29 23:42:47 +0000254
david_williams42f9b242006-11-27 18:45:14 +0000255 <ant antfile="${wtp.builder.home}/scripts/build/label.xml" />
256 <property file="${buildDirectory}/label.properties" />
257
258 <!--fetch the HEAD stream of all projects if build type specified as N-->
david_williams9505a3e2007-06-29 23:42:47 +0000259 <condition
260 property="fetchTag"
261 value="HEAD">
262 <equals
263 arg1="${buildType}"
264 arg2="N" />
david_williams42f9b242006-11-27 18:45:14 +0000265 </condition>
266
267 <condition property="tagMaps">
david_williams9505a3e2007-06-29 23:42:47 +0000268 <equals
269 arg1="${build.trial}"
270 arg2="false" />
david_williams42f9b242006-11-27 18:45:14 +0000271 </condition>
272 </target>
273
david_williams9505a3e2007-06-29 23:42:47 +0000274 <target
275 name="runEclipseBuild"
276 if="buildId">
277 <java
278 taskname="build-${build.distribution}-${component}"
279 jar="${eclipse.launcher}"
280 fork="true"
281 failonerror="${eclipseBuildFailOnError}">
david_williams42f9b242006-11-27 18:45:14 +0000282 <jvmarg value="-Dosgi.ws=${env.BASEWS}" />
283 <jvmarg value="-Dosgi.os=${env.BASEOS}" />
284 <jvmarg value="-Dosgi.arch=${env.BASEARCH}" />
285 <jvmarg value="-Dbuild.home=${env.BUILD_HOME}" />
286 <jvmarg value="-Dbuild.trial=${build.trial}" />
287 <jvmarg value="-DbuildType=${buildType}" />
288 <jvmarg value="-DbuildId=${buildId}" />
289 <jvmarg value="-DjavacDebugInfo=${javacDebugInfo}" />
290 <jvmarg value="-DmapVersionTag=${mapVersionTag}" />
david_williamsd56a5ca2007-06-30 21:13:54 +0000291 <jvmarg value="-Dreleng-jsf-mapVersionTag=${releng-jsf-mapVersionTag}" />
292 <jvmarg value="-Dreleng.dali-mapVersionTag=${releng.dali-mapVersionTag}" />
david_williams9505a3e2007-06-29 23:42:47 +0000293 <jvmarg value="-DlogExtension=${logExtension}" />
294 <jvmarg value="-DcvsUser=${cvsUser}" />
david_williams42f9b242006-11-27 18:45:14 +0000295 <jvmarg value="-DcvsProtocol=${cvsProtocol}" />
296 <jvmarg value="-Dwtp.builder.home=${wtp.builder.home}" />
297 <jvmarg value="-Dbuild.distribution=${build.distribution}" />
david_williamsf1fa0422006-11-28 22:36:04 +0000298 <jvmarg value="-Dcomponent=${component}" />
david_williams42f9b242006-11-27 18:45:14 +0000299 <jvmarg value="-DJ2SE-1.5=${env.J2SE15}" />
300 <jvmarg value="-DJ2SE-1.4=${env.J2SE14}" />
301 <arg value="-application" />
302 <arg value="org.eclipse.ant.core.antRunner" />
303 <arg value="-buildfile" />
304 <arg value="${ant.file}" />
305 <arg value="build" />
david_williams9505a3e2007-06-29 23:42:47 +0000306 <sysproperty
307 key="logExtension"
308 value="${logExtension}" />
309
david_williams42f9b242006-11-27 18:45:14 +0000310 </java>
311 </target>
david_williams9505a3e2007-06-29 23:42:47 +0000312
313 <target
314 name="runEclipseBuildStamped"
315 unless="buildId">
316 <java
317 taskname="build-${build.distribution}-${component}"
318 jar="${eclipse.launcher}"
319 fork="true"
320 failonerror="${eclipseBuildFailOnError}">
david_williams42f9b242006-11-27 18:45:14 +0000321 <jvmarg value="-Dosgi.ws=${env.BASEWS}" />
322 <jvmarg value="-Dosgi.os=${env.BASEOS}" />
323 <jvmarg value="-Dosgi.arch=${env.BASEARCH}" />
324 <jvmarg value="-Dbuild.home=${env.BUILD_HOME}" />
325 <jvmarg value="-Dbuild.trial=${build.trial}" />
326 <jvmarg value="-DbuildType=${buildType}" />
327 <jvmarg value="-DjavacDebugInfo=${javacDebugInfo}" />
328 <jvmarg value="-DmapVersionTag=${mapVersionTag}" />
david_williamsd56a5ca2007-06-30 21:13:54 +0000329 <jvmarg value="-Dreleng-jsf-mapVersionTag=${releng-jsf-mapVersionTag}" />
330 <jvmarg value="-Dreleng.dali-mapVersionTag=${releng.dali-mapVersionTag}" />
david_williams42f9b242006-11-27 18:45:14 +0000331 <jvmarg value="-DcvsUser=${cvsUser}" />
332 <jvmarg value="-DcvsProtocol=${cvsProtocol}" />
david_williams9505a3e2007-06-29 23:42:47 +0000333 <jvmarg value="-DlogExtension=${logExtension}" />
david_williams42f9b242006-11-27 18:45:14 +0000334 <jvmarg value="-Dwtp.builder.home=${wtp.builder.home}" />
335 <jvmarg value="-Dbuild.distribution=${build.distribution}" />
david_williamsf1fa0422006-11-28 22:36:04 +0000336 <jvmarg value="-Dcomponent=${component}" />
david_williams42f9b242006-11-27 18:45:14 +0000337 <jvmarg value="-DJ2SE-1.5=${env.J2SE15}" />
338 <jvmarg value="-DJ2SE-1.4=${env.J2SE14}" />
339 <arg value="-application" />
340 <arg value="org.eclipse.ant.core.antRunner" />
341 <arg value="-buildfile" />
342 <arg value="${ant.file}" />
343 <arg value="build" />
david_williams9505a3e2007-06-29 23:42:47 +0000344 <sysproperty
345 key="logExtension"
346 value="${logExtension}" />
347 </java>
david_williams42f9b242006-11-27 18:45:14 +0000348 </target>
349</project>