org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.dash.common.releng/tools/scripts/buildAllHelper.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.151 - (view) (download) (as text)

1 : nickb 1.61 <project name="buildAllHelper.xml : helpful methods for signing, packing and all kinds of crazy crap">
2 : nickb 1.1
3 : nickb 1.120 <target name="initCommandlineArgsList">
4 :     <!-- These variables can be set via commandline (Ant -Dflag) or in project's .releng/build.properties as
5 :     overrides for default values in .common.releng/build.properties or .common.releng/server.properties.
6 :     See buildAll.xml#runEclipse and buildAllHelper.xml#createBuildConfigFile for usage
7 : nickb 1.123 Note that these will be loaded IN ORDER LISTED so for variables that depend on other variables, MUST list in
8 :     proper order (eg., if thirdPartyJarsDir = ${writableBuildRoot}/3rdPartyJars, must list writableBuildRoot first)
9 : nickb 1.120 -->
10 :     <property name="commandlineArgsList"
11 : nickb 1.126 value="
12 : nickb 1.123 version
13 :     projectid
14 :     topprojectName
15 :     projectName
16 :     subprojectName
17 :    
18 :     buildType
19 :     buildTimestamp
20 : nickb 1.120 buildAlias
21 : nickb 1.136 zipPrefix
22 :     incubation
23 : nickb 1.123
24 : nickb 1.120 build.steps
25 : nickb 1.123 packageFeaturesIncludedBinaries
26 : nickb 1.125 failBuildIfTestFailuresOrErrors
27 : nickb 1.120 forceContextQualifier
28 : nickb 1.123
29 : nickb 1.120 JAVA_HOME
30 : nickb 1.132 PACK200_JAVA_HOME
31 : nickb 1.123 writableBuildRoot
32 :     thirdPartyJarsDir
33 :     downloadsDir
34 :     buildDir
35 :     relengBuilderDir
36 :     relengBaseBuilderDir
37 :     relengCommonBuilderDir
38 :     relengCommonScriptsDir
39 :    
40 : nickb 1.120 localSourceCheckoutDir
41 :     localSourceCheckoutDirExcludes
42 : nickb 1.123
43 :     branch
44 :     projRelengBranch
45 :     commonRelengBranch
46 :     basebuilderBranch
47 :     fetchTag
48 :    
49 : nickb 1.120 noclean
50 : nickb 1.123 buildcfg
51 :    
52 :     dependencyURLs
53 :     repositoryURLs
54 :     featureIDsToInstall
55 : nickb 1.120 pluginIDsToInstall
56 : nickb 1.134 IUsToInstall
57 : nickb 1.123 projectSetFiles"
58 : nickb 1.120 />
59 :     </target>
60 :    
61 : nickb 1.122 <target name="init">
62 : nickb 1.30
63 : nickb 1.36 <property name="writableBuildRoot" value="/opt/public/cbi/build" />
64 : nickb 1.34 <property name="thirdPartyJarsDir" value="${writableBuildRoot}/3rdPartyJars" />
65 : nickb 1.30
66 : nickb 1.18 <taskdef resource="net/sf/antcontrib/antlib.xml">
67 :     <classpath>
68 :     <pathelement path="${classpath}" />
69 : nickb 1.30 <pathelement location="${relengCommonBuilderDir}/lib/ant-contrib.jar" />
70 :     <pathelement location="${relengBuilderDir}/lib/ant-contrib.jar" />
71 : nickb 1.18 <pathelement location="${thirdPartyJarsDir}/ant-contrib.jar" />
72 : nickb 1.30 <pathelement location="/usr/share/java/ant-contrib.jar" />
73 : nickb 1.18 </classpath>
74 :     </taskdef>
75 :     </target>
76 :    
77 : nickb 1.63 <target name="get.pde.build.svn" description="make sure SVN mapfile support is available">
78 :     <if>
79 :     <not>
80 :     <available file="${relengBaseBuilderDir}/plugins/org.eclipse.pde.build.svn_1.0.1.v20070222.jar" type="file" />
81 :     </not>
82 :     <then>
83 :     <if>
84 :     <available file="${downloadsDir}/org.eclipse.pde.build.svn-1.0.1RC2.zip" />
85 :     <then>
86 :     <echo>Found ${downloadsDir}/org.eclipse.pde.build.svn-1.0.1RC2.zip</echo>
87 :     </then>
88 :     <else>
89 :     <!-- download the requirement, if permitted by license agreement -->
90 :     <echo>Third Party Download License Agreement: ${thirdPartyDownloadLicenseAcceptance}</echo>
91 :     <if>
92 :     <and>
93 :     <isset property="thirdPartyDownloadLicenseAcceptance" />
94 :     <equals arg1="${thirdPartyDownloadLicenseAcceptance}" arg2="&quot;I accept&quot;" />
95 :     </and>
96 :     <then>
97 :     <get src="http://downloads.sourceforge.net/svn-pde-build/org.eclipse.pde.build.svn-1.0.1RC2.zip"
98 :     dest="${downloadsDir}/org.eclipse.pde.build.svn-1.0.1RC2.zip"
99 :     usetimestamp="true"
100 :     />
101 :     <touch file="${downloadsDir}/org.eclipse.pde.build.svn-1.0.1RC2.zip" />
102 :     </then>
103 :     </if>
104 :     </else>
105 :     </if>
106 :     <if>
107 :     <available file="${downloadsDir}/org.eclipse.pde.build.svn-1.0.1RC2.zip" />
108 :     <then>
109 :     <!--
110 :     Note that ${relengBaseBuilderDir} must be writable for this to be updated automatically. If running in Hudson
111 :     and ${relengBaseBuilderDir} is a symlink to a read-only dir, this will fail. You will need to update this by hand.
112 :     -->
113 : nickb 1.149 <mkdir dir="${java.io.tmpdir}/org.eclipse.pde.build.svn" />
114 : nickb 1.150 <unzip src="${downloadsDir}/org.eclipse.pde.build.svn-1.0.1RC2.zip"
115 :     dest="${java.io.tmpdir}/org.eclipse.pde.build.svn"
116 :     overwrite="true"
117 :     />
118 : nickb 1.63 <if>
119 : nickb 1.149 <available file="${java.io.tmpdir}/org.eclipse.pde.build.svn/org.eclipse.releng.basebuilder/features" type="dir" />
120 : nickb 1.63 <then>
121 :     <mkdir dir="${relengBaseBuilderDir}/features" />
122 :     <move todir="${relengBaseBuilderDir}/features">
123 : nickb 1.149 <fileset dir="${java.io.tmpdir}/org.eclipse.pde.build.svn/org.eclipse.releng.basebuilder/features" />
124 : nickb 1.63 </move>
125 :     </then>
126 :     </if>
127 :     <mkdir dir="${relengBaseBuilderDir}/plugins" />
128 :     <move todir="${relengBaseBuilderDir}/plugins">
129 : nickb 1.149 <fileset dir="${java.io.tmpdir}/org.eclipse.pde.build.svn/org.eclipse.releng.basebuilder/plugins" />
130 : nickb 1.63 </move>
131 : nickb 1.149 <delete dir="${java.io.tmpdir}/org.eclipse.pde.build.svn" />
132 : nickb 1.63 </then>
133 :     <else>
134 :     <echo>Warning!
135 :     Cannot find org.eclipse.pde.build.svn-1.0.1RC2.zip.
136 :     If your build depends on sources in an SVN repository, it will fail.
137 :     You can manually download this zip into ${downloadsDir} from http://downloads.sourceforge.net/svn-pde-build/org.eclipse.pde.build.svn-1.0.1RC2.zip
138 :     Or, to download this automatically, see ${relengCommonBuilderDir}/build.properties#thirdPartyDownloadLicenseAcceptance.
139 : nickb 1.93 </echo>
140 : nickb 1.63 </else>
141 :     </if>
142 :     </then>
143 :     </if>
144 :     </target>
145 :     <target name="get.ant4eclipse" description="make sure ant4eclipse support is available">
146 :     <if>
147 :     <not>
148 : nickb 1.66 <available file="${relengCommonBuilderDir}/lib/ant4eclipse.jar" type="file" />
149 : nickb 1.63 </not>
150 :     <then>
151 :     <if>
152 :     <available file="${downloadsDir}/ant4eclipse-0.5.0.rc1.zip" />
153 :     <then>
154 :     <echo>Found ${downloadsDir}/ant4eclipse-0.5.0.rc1.zip</echo>
155 :     </then>
156 :     <else>
157 :     <!-- download the requirement, if permitted by license agreement -->
158 :     <echo>Third Party Download License Agreement: ${thirdPartyDownloadLicenseAcceptance}</echo>
159 :     <if>
160 :     <and>
161 :     <isset property="thirdPartyDownloadLicenseAcceptance" />
162 : nickb 1.112 <or>
163 : nickb 1.113 <equals arg1="${thirdPartyDownloadLicenseAcceptance}" arg2="Y" />
164 : nickb 1.112 <equals arg1="${thirdPartyDownloadLicenseAcceptance}" arg2="I accept" />
165 :     <equals arg1="${thirdPartyDownloadLicenseAcceptance}" arg2="&quot;I accept&quot;" />
166 :     </or>
167 : nickb 1.63 </and>
168 :     <then>
169 :     <get src="http://downloads.sourceforge.net/sourceforge/ant4eclipse/ant4eclipse-0.5.0.rc1.zip"
170 :     dest="${downloadsDir}/ant4eclipse-0.5.0.rc1.zip"
171 :     usetimestamp="true"
172 :     />
173 :     <touch file="${downloadsDir}/ant4eclipse-0.5.0.rc1.zip" />
174 :     </then>
175 :     </if>
176 :     </else>
177 :     </if>
178 :     <if>
179 :     <available file="${downloadsDir}/ant4eclipse-0.5.0.rc1.zip" />
180 :     <then>
181 :     <!--
182 :     Note that ${relengCommonBuilderDir} must be writable for this to be updated automatically. If running in Hudson
183 :     and ${relengCommonBuilderDir} is a symlink to a read-only dir, this will fail. You will need to update this by hand.
184 :     -->
185 : nickb 1.149 <mkdir dir="${java.io.tmpdir}/net.sf.ant4eclipse" />
186 :     <unzip src="${downloadsDir}/ant4eclipse-0.5.0.rc1.zip" dest="${java.io.tmpdir}/net.sf.ant4eclipse" overwrite="true" />
187 : nickb 1.150 <move file="${java.io.tmpdir}/net.sf.ant4eclipse/ant4eclipse-0.5.0.rc1.jar"
188 :     tofile="${relengCommonBuilderDir}/lib/ant4eclipse.jar"
189 :     />
190 : nickb 1.149 <delete dir="${java.io.tmpdir}/net.sf.ant4eclipse" />
191 : nickb 1.63 </then>
192 :     <else>
193 :     <echo>Warning!
194 :     Cannot find ant4eclipse-0.5.0.rc1.zip.
195 :     If your build depends on fetching sources from a .psf file, it will fail.
196 :     You can manually download this zip into ${downloadsDir} from http://downloads.sourceforge.net/sourceforge/ant4eclipse/ant4eclipse-0.5.0.rc1.zip,
197 :     then place the renamed jar (ant4eclipse.jar) into ${relengCommonBuilderDir}/lib.
198 :     Or, to download this automatically, see ${relengCommonBuilderDir}/build.properties#thirdPartyDownloadLicenseAcceptance.
199 : nickb 1.93 </echo>
200 : nickb 1.63 </else>
201 :     </if>
202 :     </then>
203 :     </if>
204 :     </target>
205 :    
206 : nickb 1.1 <target name="copyJars">
207 : nickb 1.23 <!--
208 :     must load a properties file first, eg.
209 : nickb 1.76 <property file="${buildDirectory}/../${projRelengName}/builder/sdk/extraJars.properties" />
210 : nickb 1.1 -->
211 :     <echo message="Copy ${jars} ..." />
212 :     <mkdir dir="${buildDirectory}/${dir}" />
213 :     <copy todir="${buildDirectory}/${dir}" failonerror="true" verbose="true">
214 : nickb 1.11 <fileset dir="${thirdPartyJarsDir}" includes="${jars}" />
215 : nickb 1.1 <mapper type="flatten" />
216 :     </copy>
217 :     </target>
218 :    
219 :     <!-- echo timestamp into log: format can be "MM/dd/yyyy hh:mm:ss aa" or "hh:mm:ss" -->
220 :     <target name="-timestamp">
221 :     <tstamp>
222 :     <format property="-timestamp" pattern="hh:mm:ss" />
223 :     </tstamp>
224 :     <echo>${-timestamp}</echo>
225 :     </target>
226 :    
227 : nickb 1.10 <target name="unpackUpdateJarsAndRepack"
228 :     description="Use this in to convert a Master zip (with jarred features and plugins) to an SDK zip (with unpacked features and mix of jarred/unpacked plugins)."
229 :     >
230 : nickb 1.1 <!-- must be set when called: should be masterZip containing features and plugins as ONLY jars, no folders -->
231 : nickb 1.10 <property name="sourceZip" value="${buildDirectory}/${buildLabel}/${archiveName}" />
232 : nickb 1.1 <!-- must be set when called; could be sdkZip, allZip, etc; by default, useful in customTargets.xml#postBuild (see gmf.releng) -->
233 : nickb 1.10 <property name="targetZip" value="${buildDirectory}/${buildLabel}/${archiveName}" />
234 : nickb 1.1
235 :     <property name="tmpsite" value="${buildDirectory}/unpacktmp" />
236 :     <mkdir dir="${tmpsite}/new/eclipse/features" />
237 :     <mkdir dir="${tmpsite}/new/eclipse/plugins" />
238 : nickb 1.10 <unzip src="${sourceZip}" dest="${tmpsite}" />
239 : nickb 1.1 <unpackUpdateJars site="${tmpsite}/eclipse" output="${tmpsite}/new/eclipse" />
240 :     <!-- copy root files (if applicable?) -->
241 :     <copy todir="${tmpsite}/new/eclipse">
242 :     <fileset dir="${tmpsite}/eclipse">
243 :     <include name="*" />
244 :     </fileset>
245 :     </copy>
246 :     <zip destfile="${targetZip}" basedir="${tmpsite}/new" />
247 :     <delete dir="${tmpsite}" />
248 :     </target>
249 :    
250 : nickb 1.10 <target name="removeRootFilesFromMaster"
251 :     description="Use this to purge any rootfiles from the Master zip, and either create a new zip or replace an existing one"
252 :     >
253 :     <property name="sourceZip" value="${buildDirectory}/${buildLabel}/${masterZip}" />
254 :     <!-- can override defaults here -->
255 :     <property name="targetZip" value="${buildDirectory}/${buildLabel}/${masterZip}" />
256 :     <!-- can override defaults here -->
257 : nickb 1.1 <zip destfile="${sourceZip}_" update="true">
258 : nickb 1.63 <zipfileset src="${sourceZip}" dirmode="775" filemode="664" includes="**/*.jar, **/*.jar.pack.gz, **/pack.properties, *.jar, site.xml" />
259 : nickb 1.1 </zip>
260 : nickb 1.10 <move file="${sourceZip}_" tofile="${targetZip}" overwrite="true" verbose="false" failonerror="true" />
261 : nickb 1.1 </target>
262 :    
263 :     <!-- remove all but *.jar & *.jar.pack.gz from Master zip so it can be used for Update site generation -->
264 :     <target name="removeFeatureAndPluginFoldersFromMasterZip">
265 :     <zip destfile="${buildDirectory}/${buildLabel}/${masterZip}.tmp" update="true">
266 : nickb 1.10 <zipfileset src="${buildDirectory}/${buildLabel}/${masterZip}"
267 :     dirmode="775"
268 :     filemode="664"
269 :     includes="**/plugins/*.jar, **/plugins/*.jar.pack.gz, **/features/*.jar, **/features/*.jar.pack.gz"
270 :     />
271 : nickb 1.1 </zip>
272 :     <move file="${buildDirectory}/${buildLabel}/${masterZip}.tmp" tofile="${buildDirectory}/${buildLabel}/${masterZip}" overwrite="true" />
273 :     </target>
274 :    
275 : nickb 1.149 <!--poll file for change in attributes: while running /usr/bin/sign, you can watch ${java.io.tmpdir}/jarsigner for progress, where ${java.io.tmpdir} == /tmp -->
276 : nickb 1.105 <target name="checkForSignedZip">
277 : nickb 1.12 <if>
278 : nickb 1.33 <equals arg1="${buildServerUser}" arg2="" />
279 : nickb 1.12 <then>
280 : nickb 1.105 <exec dir="${buildDirectory}" executable="ls" outputProperty="-checkResults">
281 : nickb 1.12 <arg line="${execline}" />
282 :     </exec>
283 :     </then>
284 :     <else>
285 : nickb 1.105 <exec dir="${buildDirectory}" executable="ssh" outputProperty="-checkResults">
286 : nickb 1.12 <arg line="${execline}" />
287 :     </exec>
288 :     </else>
289 :     </if>
290 : nickb 1.14
291 :     <if>
292 : nickb 1.105 <or>
293 :     <!-- failure conditions -->
294 :     <contains string="${-checkResults}" substring="Host key verification failed." casesensitive="no" />
295 :     <contains string="${-checkResults}" substring="Permission denied, please try again." casesensitive="no" />
296 :     <contains string="${-checkResults}" substring="Received disconnect from " casesensitive="no" />
297 :     <contains string="${-checkResults}" substring="Too many authentication failures for" casesensitive="no" />
298 :     <contains string="${-checkResults}" substring="ssh: dashBuild: Name or service not known" casesensitive="no" />
299 :     </or>
300 : nickb 1.14 <then>
301 : nickb 1.105 <fail>Error!
302 :     Build cannot connect to ${buildServerUser}:
303 :     ----------
304 :     ${-checkresults}
305 :     ----------
306 :     Check your ssh keys and ensure you are authorized to connect as ${buildServerUser}.
307 :     You can also set a different default value in build.properties for buildServerUser if needed.
308 :    
309 :     </fail>
310 : nickb 1.14 </then>
311 :     </if>
312 : nickb 1.105 <echo>${-checkResults}</echo>
313 :     <condition property="-foundSignedZip">
314 :     <or>
315 : nickb 1.1 <not>
316 : nickb 1.105 <contains string="${-checkResults}" substring="No such file or directory" casesensitive="no" />
317 : nickb 1.1 </not>
318 : nickb 1.105 <contains string="${-checkResults}" substring="bash: line 0: cd:" casesensitive="no" />
319 :     </or>
320 : nickb 1.1 </condition>
321 :     </target>
322 :    
323 : nickb 1.104 <target name="signMasterZip" if="sign" unless="skipSign">
324 : nickb 1.105 <antcall target="-timestamp" inheritAll="false" />
325 : nickb 1.33 <!-- if running as hudson, use simple path in workspace; if running commandline, connect over ssh to remote staging.priv dir -->
326 : nickb 1.30 <if>
327 : nickb 1.32 <or>
328 :     <contains string="${user.name}" substring="hudson" />
329 :     <contains string="${user.home}" substring="hudson" />
330 :     </or>
331 : nickb 1.30 <then>
332 :     <property name="buildServerUser" value="" />
333 : nickb 1.34 <property name="signingDir" value="${writableBuildRoot}/signing" />
334 : nickb 1.30 <mkdir dir="${signingDir}" />
335 :     </then>
336 :     <else>
337 :     <!-- user with write perms in staging dir & permission to run /usr/bin/sign -->
338 :     <property name="buildServerUser" value="dashBuild@build.eclipse.org" />
339 :     <property name="signingDir" value="/home/data/httpd/download-staging.priv/commonBuild" />
340 :     </else>
341 :     </if>
342 : nickb 1.1
343 :     <property name="packtmp" value="${buildDirectory}/packtmp" />
344 : nickb 1.15 <!-- eg., /home/data/httpd/download-staging.priv/commonBuild/I200902091923-out -->
345 : nickb 1.30 <property name="signingDirOutput" value="${signingDir}/${buildId}-out" />
346 :     <property name="outputFile" value="${signingDirOutput}/${masterZip}" />
347 : nickb 1.15 <!-- valid values are mail|nomail -->
348 : nickb 1.1 <property name="mailStatus" value="nomail" />
349 :    
350 : nickb 1.12
351 : nickb 1.105 <antcall target="-timestamp" inheritAll="false" />
352 : nickb 1.1 <mkdir dir="${packtmp}" />
353 :     <move file="${buildDirectory}/${buildLabel}/${masterZip}" tofile="${packtmp}/${masterZip}" />
354 :     <!-- add pack.properties file that specifies effort level -->
355 : nickb 1.103 <zip destfile="${packtmp}/${masterZip}" update="true">
356 : nickb 1.104 <fileset dir="${relengCommonScriptsDir}" includes="pack.properties" />
357 : nickb 1.103 </zip>
358 : nickb 1.10
359 : nickb 1.32 <if>
360 : nickb 1.33 <equals arg1="${buildServerUser}" arg2="" />
361 : nickb 1.32 <then>
362 :     <echo message="Signing ${masterZip} in ${signingDir} on localhost ..." />
363 :     </then>
364 :     <else>
365 :     <echo message="Signing ${masterZip} as ${buildServerUser} in ${signingDir} ..." />
366 :     </else>
367 :     </if>
368 : nickb 1.1
369 :     <!--push drop to staging directory-->
370 : nickb 1.105 <antcall target="-timestamp" inheritAll="false" />
371 :     <echo message="Push ${masterZip} to staging directory" />
372 : nickb 1.12 <if>
373 : nickb 1.33 <equals arg1="${buildServerUser}" arg2="" />
374 : nickb 1.12 <then>
375 : nickb 1.30 <copy file="${packtmp}/${masterZip}" todir="${signingDir}" />
376 :     <chmod perm="ugo+rw" file="${signingDir}/${masterZip}" output="${buildDirectory}/signing.txt" append="true" />
377 : nickb 1.12 </then>
378 :     <else>
379 :     <exec dir="${packtmp}" executable="scp" output="${buildDirectory}/signing.txt">
380 : nickb 1.30 <arg line="${masterZip} ${buildServerUser}:${signingDir}" />
381 : nickb 1.12 </exec>
382 :     <exec dir="${buildDirectory}" executable="ssh" output="${buildDirectory}/signing.txt" append="true">
383 : nickb 1.30 <arg line="${buildServerUser} &quot;/bin/chmod ugo+rw ${signingDir}/${masterZip}&quot;" />
384 : nickb 1.12 </exec>
385 :     </else>
386 :     </if>
387 : nickb 1.105
388 :     <property name="signed.zip.check.interval.seconds" value="180" />
389 :     <property name="signed.zip.check.limit" value="15" />
390 :    
391 : nickb 1.1 <!--invoke sign script and wait-->
392 : nickb 1.105 <antcall target="-timestamp" inheritAll="false" />
393 :     <echo>Invoke sign script and wait ${signed.zip.check.limit} x ${signed.zip.check.interval.seconds} seconds</echo>
394 : nickb 1.12 <if>
395 : nickb 1.13 <and>
396 : nickb 1.33 <equals arg1="${buildServerUser}" arg2="" />
397 : nickb 1.13 <available file="/usr/bin/sign" type="file" />
398 :     </and>
399 : nickb 1.12 <then>
400 : nickb 1.30 <exec dir="${signingDir}" executable="/usr/bin/sign" output="${buildDirectory}/signing.txt" append="true">
401 :     <arg line="${signingDir}/${masterZip} ${mailStatus} ${signingDirOutput}" />
402 : nickb 1.12 </exec>
403 :     </then>
404 :     <else>
405 :     <exec dir="." executable="ssh" output="${buildDirectory}/signing.txt" append="true">
406 : nickb 1.30 <arg line="${buildServerUser} &quot;cd ${signingDir}; /usr/bin/sign ${signingDir}/${masterZip} ${mailStatus} ${signingDirOutput}&quot;"
407 : nickb 1.12 />
408 :     </exec>
409 :     </else>
410 :     </if>
411 : nickb 1.1
412 : nickb 1.12 <if>
413 : nickb 1.105 <available file="${buildDirectory}/signing.txt" type="file" />
414 : nickb 1.12 <then>
415 : nickb 1.105 <loadfile property="signing.log" srcfile="${buildDirectory}/signing.txt" failonerror="false" />
416 :     <if>
417 :     <contains string="${signing.log}" substring="Permission denied" />
418 :     <then>
419 :     <echo>Error!
420 :     Signing process has returned a Permission denied error:
421 :     ----------
422 :     ${signing.log}
423 :     ----------
424 :     Please report a bug to webmaster@eclipse.org quoting this message.
425 :    
426 :     </echo>
427 :     <antcall target="signMasterZipHasFailed" />
428 :     </then>
429 :     <else>
430 :    
431 :     <!-- Wait for signed build to be available -->
432 :     <trycatch>
433 :     <try>
434 :     <retry retrycount="${signed.zip.check.limit}">
435 :     <sequential>
436 :     <echo>Sleep for ${signed.zip.check.interval.seconds} seconds...</echo>
437 :     <sleep seconds="${signed.zip.check.interval.seconds}" />
438 :     <antcall target="-timestamp" inheritAll="false" />
439 :     <if>
440 :     <equals arg1="${buildServerUser}" arg2="" />
441 :     <then>
442 :     <antcallback target="checkForSignedZip" return="-foundSignedZip">
443 :     <param name="execline" value="${outputFile}" />
444 :     </antcallback>
445 :     </then>
446 :     <else>
447 :     <antcallback target="checkForSignedZip" return="-foundSignedZip">
448 :     <param name="execline" value="${buildServerUser} &quot;ls ${outputFile}&quot;" />
449 :     </antcallback>
450 :     </else>
451 :     </if>
452 :     <if>
453 :     <not>
454 :     <isset property="-foundSignedZip" />
455 :     </not>
456 :     <then>
457 :     <!-- Force the <retry> to loop -->
458 :     <fail>Zip unavailable - will try again in ${signed.zip.check.interval.seconds} seconds...</fail>
459 :     </then>
460 :     </if>
461 :     </sequential>
462 :     </retry>
463 :     </try>
464 :     <!-- catch BuildException and throw it away -->
465 :     <catch />
466 :     </trycatch>
467 :     <if>
468 :     <isset property="-foundSignedZip" />
469 :     <then>
470 :     <!-- if we got the ${outputFile}, retrieve it via copy or scp, then clean up -->
471 :     <if>
472 :     <equals arg1="${buildServerUser}" arg2="" />
473 :     <then>
474 :     <copy file="${outputFile}" todir="${buildDirectory}/${buildLabel}" />
475 :     <delete includeEmptyDirs="true">
476 :     <fileset dir="${signingDirOutput}" />
477 :     <fileset file="${signingDir}/${masterZip}" />
478 :     </delete>
479 :     </then>
480 :     <else>
481 :     <exec dir="." executable="scp" output="${buildDirectory}/signing.txt" append="true">
482 :     <arg line="${buildServerUser}:${outputFile} ${buildDirectory}/${buildLabel}" />
483 :     </exec>
484 :     <exec dir="." executable="ssh" output="${buildDirectory}/signing.txt" append="true">
485 :     <arg line="${buildServerUser} &quot;/bin/rm -rf ${signingDirOutput} ${signingDir}/${masterZip}&quot;" />
486 :     </exec>
487 :     </else>
488 :     </if>
489 :     </then>
490 :     <else>
491 :     <echo>Warning!
492 :     Signed zip check failed after ${signed.zip.check.limit} checks every ${signed.zip.check.interval.seconds} seconds.
493 :     Check ${buildDirectory}/signing.txt for any signs of error which might explain this failure.
494 :     </echo>
495 :     <antcall target="signMasterZipHasFailed" />
496 :     </else>
497 :     </if>
498 :    
499 :     </else>
500 :     </if>
501 : nickb 1.12 </then>
502 :     </if>
503 : nickb 1.105 </target>
504 : nickb 1.1
505 : nickb 1.105 <target name="signMasterZipHasFailed">
506 :     <echo>Build will proceed w/ unsigned, unprocessed Master zip, ${masterZip}</echo>
507 :     <!-- get an unsigned Master zip where we need it -->
508 :     <copy file="${packtmp}/${masterZip}" todir="${buildDirectory}/${buildLabel}" />
509 :     <!-- cleanup -->
510 : nickb 1.12 <if>
511 : nickb 1.33 <equals arg1="${buildServerUser}" arg2="" />
512 : nickb 1.12 <then>
513 :     <delete includeEmptyDirs="true">
514 : nickb 1.30 <fileset dir="${signingDirOutput}" />
515 :     <fileset file="${signingDir}/${masterZip}" />
516 : nickb 1.12 </delete>
517 :     </then>
518 :     <else>
519 :     <exec dir="." executable="ssh" output="${buildDirectory}/signing.txt" append="true">
520 : nickb 1.30 <arg line="${buildServerUser} &quot;/bin/rm -rf ${signingDirOutput} ${signingDir}/${masterZip}&quot;" />
521 : nickb 1.12 </exec>
522 :     </else>
523 :     </if>
524 : nickb 1.1 </target>
525 :    
526 : nickb 1.134 <target name="get.PACK200_JAVA_HOME">
527 :     <!-- update location of jvm arguments: use JAVA60_HOME or JAVA50_HOME if running w/ a 1.4 JDK; else use JAVA_HOME -->
528 :     <for param="pack200home"
529 :     list=" ${JAVA50_HOME}/jre, ${JAVA50_HOME}, ${JAVA60_HOME}/jre, ${JAVA60_HOME}, ${JAVA_HOME}/jre, ${JAVA_HOME}"
530 :     delimiter=", "
531 :     >
532 :     <sequential>
533 :     <if>
534 :     <or>
535 :     <available file="@{pack200home}/bin/pack200" type="file" />
536 :     <available file="@{pack200home}/bin/pack200.exe" type="file" />
537 :     </or>
538 :     <then>
539 :     <property name="PACK200_JAVA_HOME" value="@{pack200home}" />
540 :     </then>
541 :     </if>
542 :     </sequential>
543 :     </for>
544 :     </target>
545 :    
546 : nickb 1.1 <target name="packMasterZip" unless="skipPack">
547 : nickb 1.10 <if>
548 : nickb 1.55 <os family="windows" />
549 : nickb 1.10 <then>
550 : nickb 1.56 <echo>
551 :     ** Sorry, pack200 processing is not yet supported on Windows. See http://bugs.eclipse.org/268405 **
552 :     </echo>
553 : nickb 1.10 </then>
554 : nickb 1.55 <else>
555 :     <property name="packtmp" value="${buildDirectory}/packtmp" />
556 :     <delete dir="${packtmp}" quiet="true" />
557 :     <mkdir dir="${packtmp}" />
558 :     <move file="${buildDirectory}/${buildLabel}/${masterZip}" tofile="${packtmp}/${masterZip}" />
559 :    
560 :     <!-- copy pack200 script into ${buildDirectory}/pack200tmp -->
561 :     <property name="pack200tmp" value="${buildDirectory}/pack200tmp" />
562 :     <delete dir="${pack200tmp}" quiet="true" />
563 :     <mkdir dir="${pack200tmp}" />
564 :     <copy file="${relengCommonScriptsDir}/pack200" tofile="${pack200tmp}/pack200" />
565 : nickb 1.12
566 : nickb 1.55 <!-- use default pack.properties if not exist in project's releng -->
567 : nickb 1.41 <if>
568 : nickb 1.55 <not>
569 :     <available file="${pack200tmp}/pack.properties" type="file" />
570 :     </not>
571 : nickb 1.41 <then>
572 : nickb 1.55 <copy file="${relengCommonScriptsDir}/pack.properties" todir="${pack200tmp}" />
573 : nickb 1.41 </then>
574 :     </if>
575 : nickb 1.1
576 : nickb 1.134 <antcallback target="get.PACK200_JAVA_HOME" return="PACK200_JAVA_HOME" />
577 : nickb 1.145 <antcallback target="get.baseoswsarch" return="baseoswsarch" />
578 : nickb 1.55
579 :     <if>
580 :     <and>
581 :     <isset property="PACK200_JAVA_HOME" />
582 :     </and>
583 :     <then>
584 : nickb 1.134 <echo>Pack with ${PACK200_JAVA_HOME}/bin/pack200</echo>
585 :     <replace file="${pack200tmp}/pack200" token="@pack200@" value="${PACK200_JAVA_HOME}/bin/pack200" />
586 : nickb 1.55 <chmod file="${pack200tmp}/pack200" perm="755" />
587 : nickb 1.37
588 : nickb 1.55 <!--condition jar if it is not pushed to eclipse.org for signing-->
589 :     <condition property="repack" value="-repack">
590 : nickb 1.104 <or>
591 :     <not>
592 :     <isset property="sign" />
593 :     </not>
594 :     <isset property="skipSign" />
595 :     </or>
596 : nickb 1.55 </condition>
597 :     <property name="repack" value="" />
598 : nickb 1.37
599 : nickb 1.55 <!--pack200-->
600 :     <java jar="${eclipse.home}/plugins/org.eclipse.equinox.launcher.jar"
601 :     fork="true"
602 :     timeout="10800000"
603 :     jvm="${PACK200_JAVA_HOME}/bin/java"
604 :     failonerror="true"
605 :     maxmemory="768m"
606 :     error="${buildDirectory}/errorlog.txt"
607 :     dir="${buildDirectory}"
608 :     output="${buildDirectory}/jarprocessorlog.txt"
609 :     >
610 : nickb 1.97 <jvmarg value="-showversion" />
611 : nickb 1.55 <jvmarg value="-Dorg.eclipse.update.jarprocessor.pack200=${pack200tmp}" />
612 : nickb 1.145 <arg line=" -consolelog -application org.eclipse.update.core.siteOptimizer" />
613 :     <arg line=" -jarProcessor -verbose -outputDir ${buildLabel} -processAll -pack ${repack} ${packtmp}/${masterZip}" />
614 :     <arg line=" ${baseoswsarch}" />
615 : nickb 1.55 </java>
616 : nickb 1.1
617 : nickb 1.55 <delete dir="${packtmp}" />
618 :     <delete dir="${pack200tmp}" />
619 :     </then>
620 :     <else>
621 :     <echo>Warning!
622 : nickb 1.58 Could not find pack200 executable
623 : nickb 1.37 in ${JAVA_HOME},
624 :     in ${JAVA60_HOME} or
625 :     in ${JAVA50_HOME}
626 : nickb 1.1
627 : nickb 1.93 No packed jars (.jar.pack.gz) will be produced for this build.
628 :     </echo>
629 : nickb 1.55 </else>
630 :     </if>
631 : nickb 1.37 </else>
632 :     </if>
633 : nickb 1.1 </target>
634 :    
635 : nickb 1.58 <!-- generate a p2 repo / update site from Master zip; if packed jars available, use those; if not, use normal jars -->
636 : nickb 1.71 <target name="buildUpdate" description="Generate or reuse site.xml + p2 metadata for update site; package site as archived p2 repo (zip)">
637 : nickb 1.63 <antcall target="buildMasterZip" />
638 :     <antcall target="processMasterZip" />
639 :    
640 : nickb 1.58 <propertyregex property="updateZip"
641 :     input="${masterZip}"
642 :     defaultvalue="${masterZip}"
643 :     regexp="-Master-"
644 :     replace="-Update-"
645 :     casesensitive="false"
646 :     override="true"
647 :     />
648 :    
649 : nickb 1.71 <!-- because buildZips depends on buildUpdate, we only want to do this once; if the output updateZip already exists, don't redo this step -->
650 :     <if>
651 :     <not>
652 :     <available file="${buildDirectory}/${buildLabel}/${updateZip}" type="file" />
653 :     </not>
654 :     <then>
655 :     <property name="p2tmp" value="${buildDirectory}/p2tmp" />
656 :     <mkdir dir="${p2tmp}" />
657 :     <unzip src="${buildDirectory}/${buildLabel}/${masterZip}" dest="${p2tmp}" overwrite="true" />
658 : nickb 1.98 <var name="updateSiteJarDir" value="${p2tmp}/eclipse" />
659 : nickb 1.71
660 : nickb 1.81 <!-- [275202] TODO: support injecting other jars into the update site -->
661 : nickb 1.82
662 : nickb 1.71 <!-- determine if the update site will contain .jar.pack.gz or .jar -->
663 :     <var name="pack200Files" value="" />
664 :     <for param="packedJar">
665 :     <path>
666 :     <fileset dir="${updateSiteJarDir}" includes="**/*.jar.pack.gz" />
667 :     </path>
668 :     <sequential>
669 :     <if>
670 :     <available file="@{packedJar}" type="file" />
671 :     <then>
672 :     <var name="pack200Files" value="-reusePack200Files" />
673 : nickb 1.89 <!-- https://bugs.eclipse.org/bugs/show_bug.cgi?id=272109#c13 :: remove the plugin jars from the site so they won't be in the metadata
674 :     only problem w/ this approach is that any jars which were NOT packed by an exclusion rule will be deleted w/o a packed counterpart
675 :     -->
676 : nickb 1.90 <!-- tests failed to run (p2.director install fail) with this change -->
677 :     <!-- <delete dir="${updateSiteJarDir}/plugins" includes="*.jar"/> -->
678 : nickb 1.71 </then>
679 :     </if>
680 :     </sequential>
681 :     </for>
682 :    
683 : nickb 1.98 <!-- allow user-defined category.xml with expandable featureid.version variables -->
684 : nickb 1.58 <if>
685 : nickb 1.98 <available file="${relengBuilderDir}/category.xml" type="file" />
686 : nickb 1.58 <then>
687 : nickb 1.98 <echo>Using ${relengBuilderDir}/category.xml template for p2 repo / update site categories...</echo>
688 :     <for param="featureJar">
689 :     <path>
690 :     <fileset dir="${updateSiteJarDir}/features" includes="*.jar" />
691 :     </path>
692 :     <sequential>
693 :     <var name="feature.jarfile" unset="true" />
694 :     <var name="feature.id" unset="true" />
695 :     <var name="feature.version" unset="true" />
696 :     <propertyregex property="feature.jarfile"
697 :     defaultvalue="@{featureJar}"
698 :     input="@{featureJar}"
699 :     regexp=".+/features/([^/]+\.jar)"
700 :     replace="\1"
701 :     override="true"
702 :     />
703 :     <propertyregex property="feature.id"
704 :     defaultvalue="${feature.jarfile}"
705 :     input="${feature.jarfile}"
706 :     regexp="([^_]+)_(\d+\.\d+\.\d+\..+)\.jar"
707 :     replace="\1"
708 :     override="true"
709 :     />
710 :     <propertyregex property="feature.version"
711 :     defaultvalue="${feature.jarfile}"
712 :     input="${feature.jarfile}"
713 :     regexp="([^_]+)_(\d+\.\d+\.\d+\..+)\.jar"
714 :     replace="\2"
715 :     override="true"
716 :     />
717 :     <property name="${feature.id}.version" value="${feature.version}" />
718 :     <var name="feature.jarfile" unset="true" />
719 :     <var name="feature.id" unset="true" />
720 :     <var name="feature.version" unset="true" />
721 :     </sequential>
722 :     </for>
723 : nickb 1.71 <if>
724 : nickb 1.98 <equals arg1="${buildAlias}" arg2="${buildID}" />
725 : nickb 1.71 <then>
726 : nickb 1.98 <property name="category.name" value="${zipPrefix} ${version} ${buildID}" />
727 : nickb 1.71 </then>
728 : nickb 1.98 <else>
729 :     <property name="category.name" value="${zipPrefix} ${buildAlias} ${buildID}" />
730 :     </else>
731 : nickb 1.71 </if>
732 : nickb 1.98 <loadfile property="site.xml.transformed" srcfile="${relengBuilderDir}/category.xml">
733 :     <filterchain>
734 :     <expandproperties />
735 :     </filterchain>
736 :     </loadfile>
737 :     <echo file="${updateSiteJarDir}/site.xml" message="${site.xml.transformed}" />
738 : nickb 1.58 </then>
739 : nickb 1.71 <else>
740 :     <antcall target="buildSiteXml" />
741 :     </else>
742 : nickb 1.58 </if>
743 :    
744 : nickb 1.98 <!-- use unpacked features due to bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=269199, 273519 -->
745 :     <copy todir="${buildDirectory}/${buildLabel}/${updateZip}_tmp">
746 :     <fileset dir="${updateSiteJarDir}" includes="features/*.jar, site.xml" />
747 :     </copy>
748 : nickb 1.97 <for param="jarfile">
749 :     <path>
750 :     <fileset dir="${updateSiteJarDir}" includes="plugins/*.jar" />
751 :     </path>
752 :     <sequential>
753 :     <var name="jarname" unset="true" />
754 :     <basename property="jarname" file="@{jarfile}" />
755 :     <if>
756 :     <!-- add the jar.pack.gz if it exists; otherwise add the unpacked jar -->
757 :     <available file="@{jarfile}.pack.gz" type="file" />
758 :     <then>
759 : nickb 1.98 <copy todir="${buildDirectory}/${buildLabel}/${updateZip}_tmp">
760 : nickb 1.97 <fileset dir="${updateSiteJarDir}" includes="plugins/${jarname}.pack.gz" />
761 : nickb 1.98 </copy>
762 : nickb 1.97 </then>
763 :     <else>
764 : nickb 1.98 <copy todir="${buildDirectory}/${buildLabel}/${updateZip}_tmp">
765 : nickb 1.97 <fileset dir="${updateSiteJarDir}" includes="plugins/${jarname}" />
766 : nickb 1.98 </copy>
767 : nickb 1.97 </else>
768 :     </if>
769 :     </sequential>
770 :     </for>
771 : nickb 1.98
772 :     <antcall target="p2.meta">
773 :     <param name="updateSiteDir" value="${updateSiteJarDir}" />
774 :     </antcall>
775 :    
776 :     <zip destfile="${buildDirectory}/${buildLabel}/${updateZip}" update="true">
777 :     <fileset dir="${buildDirectory}/${buildLabel}/${updateZip}_tmp" includes="features/*.jar, plugins/*.jar*, site.xml" />
778 :     <fileset dir="${updateSiteJarDir}" includes="artifacts.jar, content.jar" />
779 :     </zip>
780 :    
781 :     <delete dir="${buildDirectory}/${buildLabel}/${updateZip}_tmp" quiet="true" />
782 : nickb 1.61 </then>
783 : nickb 1.58 </if>
784 :     </target>
785 :    
786 : nickb 1.88 <target name="p2.meta" description="Generate p2 metadata for a folder w/ site.xml and features/ plugins/">
787 : nickb 1.98 <!-- must be set when calling this task-->
788 :     <property name="updateSiteDir" value="" />
789 :    
790 : nickb 1.88 <!-- debugging
791 :     <echoproperties format="text" destfile="${updateSiteJarDir}/echoproperties.txt" />
792 :     <exec executable="/usr/bin/find"
793 :     failifexecutionfails="false"
794 :     append="true"
795 :     output="${updateSiteJarDir}/find.all.files.txt"
796 :     dir="${updateSiteJarDir}"
797 :     error="${updateSiteJarDir}/find.all.files.txt"
798 :     />
799 :     debugging -->
800 : nickb 1.134
801 :     <antcallback target="get.PACK200_JAVA_HOME" return="PACK200_JAVA_HOME" />
802 : nickb 1.145 <antcallback target="get.baseoswsarch" return="baseoswsarch" />
803 :    
804 : nickb 1.88 <for param="launcherjar">
805 :     <path>
806 :     <fileset dir="${relengBaseBuilderDir}/plugins" includes="org.eclipse.equinox.launcher_*.jar" />
807 :     </path>
808 :     <sequential>
809 :     <!-- See http://wiki.eclipse.org/Equinox_p2_Metadata_Generator -->
810 : nickb 1.134 <echo>Run p2 metadata generator with ${PACK200_JAVA_HOME}</echo>
811 : nickb 1.88 <java jar="@{launcherjar}"
812 :     fork="true"
813 :     timeout="10800000"
814 : nickb 1.134 jvm="${PACK200_JAVA_HOME}/bin/java"
815 : nickb 1.88 failonerror="false"
816 : nickb 1.148 maxmemory="512m"
817 : nickb 1.88 taskname="p2.meta"
818 :     >
819 :     <classpath>
820 :     <fileset dir="${relengBaseBuilderDir}/plugins" includes="org.eclipse.equinox.launcher_*.jar" />
821 :     <pathelement location="${relengBaseBuilderDir}/plugins" />
822 :     </classpath>
823 :     <arg line=" org.eclipse.equinox.launcher.Main -application org.eclipse.equinox.p2.metadata.generator.EclipseGenerator" />
824 : nickb 1.98 <arg line=" -updateSite ${updateSiteDir}/ -site file:${updateSiteDir}/site.xml" />
825 :     <arg line=" -metadataRepository file:${updateSiteDir}/ -metadataRepositoryName &quot;${projectid} Update Site&quot;" />
826 :     <arg line=" -artifactRepository file:${updateSiteDir}/ -artifactRepositoryName &quot;${projectid} Artifacts&quot;" />
827 : nickb 1.88 <arg line=" -compress -noDefaultIUs -reusePack200Files" />
828 : nickb 1.145 <arg line=" ${baseoswsarch}" />
829 : nickb 1.88 </java>
830 :     </sequential>
831 :     </for>
832 :     </target>
833 :    
834 : nickb 1.58 <target name="buildSiteXml" description="Generate a site.xml to contain the features in a category">
835 :     <!-- TODO: given a list of features, produce site.xml so they're contained in a default category (or, fix bug 269226 so we don't need this) -->
836 :     <!-- TODO: support <site mirrorsURL="" associatedSites="" etc.> ? -->
837 : nickb 1.61 <echo>Generating site.xml for use with p2 repo / update site categories...</echo>
838 : nickb 1.58 <echo file="${updateSiteJarDir}/site.xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</echo>
839 :     <if>
840 :     <equals arg1="${pack200Files}" arg2="-reusePack200Files" />
841 :     <then>
842 :     <echo append="true" file="${updateSiteJarDir}/site.xml">&lt;site pack200="true"&gt;</echo>
843 :     </then>
844 :     <else>
845 :     <echo append="true" file="${updateSiteJarDir}/site.xml">&lt;site&gt;</echo>
846 :     </else>
847 :     </if>
848 :    
849 :     <if>
850 : nickb 1.126 <or>
851 :     <equals arg1="${buildAlias}" arg2="${buildID}" />
852 :     <contains string="${buildAlias}" substring="-SNAPSHOT" />
853 :     </or>
854 : nickb 1.58 <then>
855 : nickb 1.98 <property name="category.name" value="${zipPrefix} ${version} ${buildID}" />
856 : nickb 1.58 </then>
857 :     <else>
858 : nickb 1.98 <property name="category.name" value="${zipPrefix} ${buildAlias} ${buildID}" />
859 : nickb 1.58 </else>
860 :     </if>
861 :    
862 :     <echo append="true" file="${updateSiteJarDir}/site.xml"> &lt;description&gt;To install these features, point Eclipse at this site.&lt;/description&gt;
863 :    
864 :     &lt;!-- ${category.name} --&gt;
865 :     &lt;category-def label="${category.name}" name="${category.name}"&gt;
866 :     &lt;description&gt;${category.name}: contains all features in this build.&lt;/description&gt;
867 :     &lt;/category-def&gt;
868 :     </echo>
869 :    
870 :     <for param="featureJar">
871 :     <path>
872 :     <fileset dir="${updateSiteJarDir}/features" includes="*.jar" />
873 :     </path>
874 :     <sequential>
875 :     <var name="feature.jarfile" unset="true" />
876 :     <var name="feature.id" unset="true" />
877 :     <var name="feature.version" unset="true" />
878 :     <propertyregex property="feature.jarfile"
879 :     defaultvalue="@{featureJar}"
880 :     input="@{featureJar}"
881 :     regexp=".+/features/([^/]+\.jar)"
882 :     replace="\1"
883 :     override="true"
884 :     />
885 :     <propertyregex property="feature.id"
886 :     defaultvalue="${feature.jarfile}"
887 :     input="${feature.jarfile}"
888 :     regexp="([^_]+)_(\d+\.\d+\.\d+\..+)\.jar"
889 :     replace="\1"
890 :     override="true"
891 :     />
892 :     <propertyregex property="feature.version"
893 :     defaultvalue="${feature.jarfile}"
894 :     input="${feature.jarfile}"
895 :     regexp="([^_]+)_(\d+\.\d+\.\d+\..+)\.jar"
896 :     replace="\2"
897 :     override="true"
898 :     />
899 :     <echo append="true" file="${updateSiteJarDir}/site.xml"> &lt;feature id="${feature.id}" version="${feature.version}" url="features/${feature.jarfile}" patch="false"&gt;
900 :     &lt;category name="${category.name}"/&gt;
901 : nickb 1.61 &lt;/feature&gt;
902 :     </echo>
903 : nickb 1.58 <var name="feature.jarfile" unset="true" />
904 :     <var name="feature.id" unset="true" />
905 :     <var name="feature.version" unset="true" />
906 :     </sequential>
907 :     </for>
908 :     <echo append="true" file="${updateSiteJarDir}/site.xml">
909 :     &lt;/site&gt;
910 :     </echo>
911 :     </target>
912 :    
913 : nickb 1.63 <target name="buildMasterZip" description="only do this step if there's no Master zip already created; called by buildZips and buildUpdate">
914 :     <if>
915 :     <not>
916 :     <available file="${buildDirectory}/${buildLabel}/${masterZip}" type="file" />
917 :     </not>
918 :     <then>
919 :     <antcall target="-timestamp" inheritall="false" />
920 :    
921 :     <!-- build Master Zip using "outputUpdateJars=true" in build.properties so we get ONLY jars, not mix of folders & jars -->
922 :     <ant antfile="${relengCommonBuilderDir}/build.xml" target="main">
923 :     <property name="component" value="builder/all" />
924 :     </ant>
925 :    
926 :     <antcall target="-timestamp" inheritall="false" />
927 :    
928 : nickb 1.105 <echo>Signing control properties:
929 :     sign = ${sign}
930 :     skipSign = ${skipSign}
931 :     domainNamespace = ${domainNamespace}</echo>
932 : nickb 1.63 <antcall target="signMasterZip">
933 :     <param name="mailStatus" value="nomail" />
934 :     </antcall>
935 :    
936 :     <!-- Unpack jars to ALL zip with mix of folders & jars -->
937 :     <antcall target="unpackUpdateJarsAndRepack">
938 :     <param name="sourceZip" value="${buildDirectory}/${buildLabel}/${masterZip}" />
939 :     <param name="targetZip" value="${buildDirectory}/${buildLabel}/${allZip}" />
940 :     </antcall>
941 :     </then>
942 :     </if>
943 :     </target>
944 :    
945 :     <target name="processMasterZip" description="only do this step once">
946 :     <if>
947 :     <not>
948 :     <available file="${buildDirectory}/processMasterZip.done" type="file" />
949 :     </not>
950 :     <then>
951 : nickb 1.68 <antcall target="-timestamp" inheritall="false" />
952 : nickb 1.71
953 : nickb 1.63 <!-- pack the master zip: to skip this step, set skipPack=true in your .releng/build.properties -->
954 :     <antcall target="packMasterZip" />
955 :    
956 :     <antcall target="-timestamp" inheritall="false" />
957 :     <echo file="${buildDirectory}/processMasterZip.done" message="processMasterZip.done=true" />
958 :     </then>
959 :     </if>
960 :     </target>
961 :    
962 : nickb 1.71 <!-- [248509, 271851] use p2 publisher to create SDKs once it's ready & documented -->
963 :     <target name="run.publisher">
964 :     </target>
965 :    
966 : nickb 1.84 <!-- Required properties are:
967 :     p2.director.installIU [csv list], p2.director.input.repo [csv list], and p2.director.destination [directory]
968 :     Optional properties are:
969 :     p2.director.bundlepool, p2.director.extraArgs
970 :     -->
971 :     <!--
972 :     TODO: install from update site zips: need to fetch them, unzip them, install from them, and clean up
973 :     repositoryURLs=\
974 :     http://www.eclipse.org/modeling/download.php?r=1&amp;file=/modeling/emf/emf/downloads/drops/2.4.2/R200902171115/emf-sdo-xsd-Update-2.4.2.zip,\
975 :     http://www.eclipse.org/gef/download.php?r=1&amp;file=/tools/gef/downloads/drops/3.4.2/R200902171642/GEF-Update-3.4.2.zip
976 :     featureIDsToInstall=org.eclipse.emf,org.eclipse.gef
977 :     -->
978 :     <target name="run.director" description="install from p2 repos">
979 : nickb 1.146 <antcall target="-timestamp" inheritall="false" />
980 :    
981 : nickb 1.111 <!-- installType = feature or plugin -->
982 :     <property name="p2.director.installType" value="feature" />
983 : nickb 1.84 <property name="p2.director.installIU" value="${mainFeatureToBuildID}" />
984 : nickb 1.134 <property name="p2.director.input.repo" value="jar:file:${buildDirectory}/${buildLabel}/${updateZip}!/" />
985 : nickb 1.84 <property name="p2.director.destination" value="${install}/eclipse" />
986 :     <property name="p2.director.bundlepool" value="${p2.director.destination}" />
987 : nickb 1.134 <!-- Eclipse 3.4: use deprecated org.eclipse.equinox.p2.director.app.application;
988 :     Eclipse 3.5 (osgi.framework.version=3.5+): use org.eclipse.equinox.p2.director to allow installing multiple IUs in a single operation -->
989 :     <if>
990 :     <contains string="${osgi.framework.version}" substring="3.4." />
991 :     <then>
992 :     <echo>Using deprecated Eclipse 3.4 org.eclipse.equinox.p2.director.app.application</echo>
993 :     <property name="p2.director.application" value="org.eclipse.equinox.p2.director.app.application" />
994 :     </then>
995 :     <else>
996 :     <property name="p2.director.application" value="org.eclipse.equinox.p2.director" />
997 :     </else>
998 :     </if>
999 :    
1000 : nickb 1.72 <!-- could pass in args such as '-p2.os linux -p2.ws gtk -p2.arch x86' -->
1001 : nickb 1.71 <property name="p2.director.extraArgs" value="" />
1002 : nickb 1.134 <!-- to avoid using mirrors when fetching, use -Declipse.p2.mirrors=false -->
1003 :     <property name="p2.director.extraVmArgs" value="" />
1004 : nickb 1.88
1005 :     <!-- verify that the URLs are valid - for zips, need to fetch them & unzip them, then clean up after -->
1006 :     <property name="p2repoZipsTmp" value="${buildDirectory}/p2repoZipsTmp" />
1007 :     <mkdir dir="${p2repoZipsTmp}" />
1008 :     <var name="p2.director.input.repo.cleaned" value="" />
1009 :     <for param="repoURL" delimiter=", " list="${p2.director.input.repo}">
1010 :     <sequential>
1011 :     <if>
1012 : nickb 1.134 <!-- prefetch remote repo zips and treat them as local repos -->
1013 : nickb 1.88 <and>
1014 :     <contains string="@{repoURL}" substring=".zip" />
1015 :     <or>
1016 :     <contains string="@{repoURL}" substring="http://" />
1017 :     <contains string="@{repoURL}" substring="https://" />
1018 :     <contains string="@{repoURL}" substring="ftp://" />
1019 :     </or>
1020 :     </and>
1021 :     <then>
1022 :     <propertyregex property="repoFile"
1023 :     input="@{repoURL}"
1024 :     defaultvalue="@{repoURL}"
1025 :     regexp=".+/([^/]+.zip)"
1026 :     replace="\1"
1027 :     casesensitive="false"
1028 :     override="true"
1029 :     />
1030 :     <ant target="getDep" antfile="${relengCommonBuilderDir}/tools/scripts/getDependencies.xml">
1031 :     <property name="url" value="@{repoURL}" />
1032 :     <property name="file" value="${repoFile}" />
1033 :     <property name="unpackDest" value="${p2repoZipsTmp}/${repoFile}_" />
1034 :     </ant>
1035 :     <if>
1036 :     <not>
1037 :     <and>
1038 :     <or>
1039 :     <available file="${p2repoZipsTmp}/${repoFile}_/artifacts.jar" type="file" />
1040 :     <available file="${p2repoZipsTmp}/${repoFile}_/artifacts.xml" type="file" />
1041 :     </or>
1042 :     <or>
1043 :     <available file="${p2repoZipsTmp}/${repoFile}_/content.jar" type="file" />
1044 :     <available file="${p2repoZipsTmp}/${repoFile}_/content.xml" type="file" />
1045 :     </or>
1046 :     </and>
1047 :     </not>
1048 :     <then>
1049 :     <if>
1050 :     <available file="${p2repoZipsTmp}/${repoFile}_/site.xml" type="file" />
1051 :     <then>
1052 :     <echo>Generating metadata for this update site</echo>
1053 :     <antcall target="p2.meta">
1054 : nickb 1.98 <param name="updateSiteDir" value="${p2repoZipsTmp}/${repoFile}_" />
1055 : nickb 1.88 <param name="projectid" value="${repoFile}" />
1056 :     </antcall>
1057 :     </then>
1058 :     <else>
1059 :     <fail>Update site in ${repoFile} contains no site.xml and no p2 metadata. Cannot proceed.</fail>
1060 :     </else>
1061 :     </if>
1062 :     </then>
1063 :     </if>
1064 : nickb 1.128 <zip destfile="${p2repoZipsTmp}/${repoFile}" update="false" basedir="${p2repoZipsTmp}/${repoFile}_" />
1065 :     <delete dir="${p2repoZipsTmp}/${repoFile}_" includeemptydirs="true" quiet="true" />
1066 :     <var name="p2.director.input.repo.cleaned"
1067 :     value="${p2.director.input.repo.cleaned},jar:file:${p2repoZipsTmp}/${repoFile}!/"
1068 :     />
1069 : nickb 1.88 </then>
1070 :     <elseif>
1071 :     <or>
1072 :     <contains string="@{repoURL}" substring="http://" />
1073 :     <contains string="@{repoURL}" substring="https://" />
1074 :     <contains string="@{repoURL}" substring="ftp://" />
1075 : nickb 1.134 <contains string="@{repoURL}" substring="file:" />
1076 : nickb 1.88 </or>
1077 :     <then>
1078 :     <var name="p2.director.input.repo.cleaned" value="${p2.director.input.repo.cleaned},@{repoURL}" />
1079 :     </then>
1080 :     </elseif>
1081 :     <else>
1082 :     <var name="p2.director.input.repo.cleaned" value="${p2.director.input.repo.cleaned},file:@{repoURL}" />
1083 :     </else>
1084 :     </if>
1085 :     </sequential>
1086 :     </for>
1087 :     <!-- trim prefix "," -->
1088 :     <propertyregex property="p2.director.input.repo.cleaned"
1089 :     input="${p2.director.input.repo.cleaned}"
1090 :     defaultvalue="${p2.director.input.repo.cleaned}"
1091 :     regexp=",(.+)"
1092 :     replace="\1"
1093 :     override="true"
1094 :     />
1095 : nickb 1.72 <mkdir dir="${p2.director.bundlepool}" />
1096 : nickb 1.71 <!-- See http://wiki.eclipse.org/Equinox_p2_director_application/Examples/Install_into_eclipse_using_SDKProfile -->
1097 : nickb 1.111 <if>
1098 :     <equals arg1="${p2.director.installType}" arg2="feature" />
1099 :     <then>
1100 : nickb 1.134 <property name="p2.director.installIU.cmd" value="-installIU ${p2.director.installIU}.feature.group" />
1101 : nickb 1.111 </then>
1102 :     <else>
1103 : nickb 1.134 <property name="p2.director.installIU.cmd" value="-installIU ${p2.director.installIU}" />
1104 : nickb 1.111 </else>
1105 :     </if>
1106 :    
1107 : nickb 1.134 <antcallback target="get.PACK200_JAVA_HOME" return="PACK200_JAVA_HOME" />
1108 : nickb 1.145 <antcallback target="get.baseoswsarch" return="baseoswsarch" />
1109 : nickb 1.134
1110 :     <!-- find launcher jar: if eclipse unpacked from SDK zip, use that launcher; if not available, fall back to basebuilder's launcher -->
1111 :     <mkdir dir="${p2.director.destination}/plugins" />
1112 :     <for param="launcherjar">
1113 :     <path>
1114 :     <fileset dir="${relengBaseBuilderDir}/plugins" includes="org.eclipse.equinox.launcher_*.jar" />
1115 :     <fileset dir="${p2.director.destination}/plugins" includes="org.eclipse.equinox.launcher_*.jar" />
1116 :     </path>
1117 :     <sequential>
1118 :     <if>
1119 :     <available file="@{launcherjar}" type="file" />
1120 :     <then>
1121 :     <var name="p2.director.launcher.jar" value="@{launcherjar}" />
1122 :     <var name="p2.director.launcher.jar.dir" unset="true" />
1123 :     <dirname property="p2.director.launcher.jar.dir" file="@{launcherjar}" />
1124 :     </then>
1125 :     </if>
1126 :     </sequential>
1127 :     </for>
1128 :    
1129 :     <!-- collect all available pre-existing repos for on-disk reuse -->
1130 :     <var name="p2.director.metadataRepository" value="" />
1131 :     <var name="p2.director.artifactRepository" value="" />
1132 :     <!-- ${install}/eclipse, -->
1133 :     <for param="sourcedir" list="${p2.director.destination}, ${relengBaseBuilderDir}, ${buildDirectory}" delimiter=", ">
1134 :     <sequential>
1135 :     <if>
1136 :     <and>
1137 :     <not>
1138 :     <contains string="${p2.director.input.repo.cleaned}"
1139 :     substring="@{sourcedir}/p2/org.eclipse.equinox.p2.engine/profileRegistry/SDKProfile.profile"
1140 :     />
1141 :     </not>
1142 :     <not>
1143 :     <contains string="${p2.director.metadataRepository}"
1144 :     substring="@{sourcedir}/p2/org.eclipse.equinox.p2.engine/profileRegistry/SDKProfile.profile"
1145 :     />
1146 :     </not>
1147 :     <available file="@{sourcedir}/p2/org.eclipse.equinox.p2.engine/profileRegistry/SDKProfile.profile" type="dir" />
1148 :     </and>
1149 :     <then>
1150 :     <var name="p2.director.metadataRepository"
1151 :     value="${p2.director.metadataRepository},file:@{sourcedir}/p2/org.eclipse.equinox.p2.engine/profileRegistry/SDKProfile.profile"
1152 :     />
1153 :     </then>
1154 :     </if>
1155 :     <if>
1156 :     <and>
1157 :     <not>
1158 :     <contains string="${p2.director.input.repo.cleaned}" substring="@{sourcedir}" />
1159 :     </not>
1160 :     <not>
1161 :     <contains string="${p2.director.artifactRepository}" substring="@{sourcedir}" />
1162 :     </not>
1163 :     <or>
1164 :     <available file="@{sourcedir}/artifacts.xml" type="dir" />
1165 :     <available file="@{sourcedir}/artifacts.jar" type="dir" />
1166 :     </or>
1167 :     </and>
1168 :     <then>
1169 :     <var name="p2.director.artifactRepository" value="${p2.director.artifactRepository},file:@{sourcedir}" />
1170 :     </then>
1171 :     </if>
1172 :     </sequential>
1173 :     </for>
1174 :     <!-- trim prefix "," -->
1175 :     <propertyregex property="p2.director.artifactRepository"
1176 :     defaultvalue="${p2.director.artifactRepository}"
1177 :     input="${p2.director.artifactRepository}"
1178 :     regexp=",(.+)"
1179 :     replace="\1"
1180 :     override="true"
1181 :     />
1182 :     <propertyregex property="p2.director.metadataRepository"
1183 :     defaultvalue="${p2.director.metadataRepository}"
1184 :     input="${p2.director.metadataRepository}"
1185 :     regexp=",(.+)"
1186 :     replace="\1"
1187 :     override="true"
1188 :     />
1189 :    
1190 :     <!--
1191 :     p2.director.application = ${p2.director.application}
1192 :     p2.director.installIU.cmd = ${p2.director.installIU.cmd}
1193 :     p2.director.launcher.jar = ${p2.director.launcher.jar}
1194 :     p2.director.launcher.jar.dir = ${p2.director.launcher.jar.dir}
1195 :     p2.director.metadataRepository = ${p2.director.metadataRepository}
1196 :     p2.director.artifactRepository = ${p2.director.artifactRepository}
1197 :     -->
1198 :     <echo>
1199 :     p2.director.input.repo.cleaned = ${p2.director.input.repo.cleaned}
1200 :     p2.director.destination = ${p2.director.destination}
1201 :    
1202 :     </echo>
1203 :    
1204 : nickb 1.146 <antcall target="-timestamp" inheritall="false" />
1205 :    
1206 : nickb 1.134 <java jar="${p2.director.launcher.jar}"
1207 :     fork="true"
1208 : nickb 1.148 timeout="10800000"
1209 : nickb 1.134 jvm="${PACK200_JAVA_HOME}/bin/java"
1210 :     failonerror="true"
1211 : nickb 1.148 maxmemory="512m"
1212 : nickb 1.134 taskname="p2.dir"
1213 :     >
1214 :     <classpath>
1215 :     <fileset dir="${p2.director.launcher.jar.dir}" includes="org.eclipse.equinox.launcher_*.jar" />
1216 :     <pathelement location="${p2.director.launcher.jar.dir}" />
1217 :     </classpath>
1218 : nickb 1.84 <arg line=" -application ${p2.director.application}" />
1219 : nickb 1.134 <arg line=" -nosplash -consoleLog" />
1220 :     <arg line=" -flavor tooling -roaming -profile SDKProfile ${p2.director.installIU.cmd}" />
1221 : nickb 1.72 <arg line=" -destination ${p2.director.destination} -bundlepool ${p2.director.bundlepool}" />
1222 : nickb 1.134 <arg line=" -metadataRepository ${p2.director.input.repo.cleaned},${p2.director.metadataRepository}" />
1223 :     <arg line=" -artifactRepository ${p2.director.input.repo.cleaned},${p2.director.artifactRepository}" />
1224 : nickb 1.71 <arg line=" -profileProperties org.eclipse.update.install.features=true" />
1225 : nickb 1.72 <arg line=" ${p2.director.extraArgs}" />
1226 : nickb 1.145 <arg line=" ${baseoswsarch}" />
1227 : nickb 1.72 <arg line=" -vmargs -Declipse.p2.data.area=${p2.director.destination}/p2 -Declipse.p2.MD5Check=false" />
1228 : nickb 1.134 <arg line=" ${p2.director.extraVmArgs}" />
1229 :     </java>
1230 : nickb 1.88
1231 :     <!-- cleanup temp dir -->
1232 :     <delete dir="${p2repoZipsTmp}" />
1233 : nickb 1.146 <antcall target="-timestamp" inheritall="false" />
1234 : nickb 1.71 </target>
1235 :    
1236 :     <target name="buildZips" depends="buildUpdate">
1237 : nickb 1.63 <antcall target="buildMasterZip" />
1238 :    
1239 :     <antcall target="-timestamp" inheritall="false" />
1240 :    
1241 : nickb 1.71 <property name="ziptmp" value="${buildDirectory}/ziptmp" />
1242 :    
1243 : nickb 1.63 <!-- build SDK -->
1244 :     <zip destfile="${buildDirectory}/${buildLabel}/${SDKZip}" update="true">
1245 :     <zipfileset src="${buildDirectory}/${buildLabel}/${allZip}"
1246 :     dirmode="775"
1247 :     filemode="664"
1248 : nickb 1.110 excludes="**/*.pack.gz, **/pack.properties, **/features/*.jar, **/${domainNamespace}.*.all*, **/${domainNamespace}.*.all*/**"
1249 : nickb 1.63 />
1250 :     </zip>
1251 : nickb 1.71
1252 : nickb 1.63 <!-- build runtime from SDK -->
1253 :     <zip destfile="${buildDirectory}/${buildLabel}/${zipPrefix}-runtime${incubation}-${buildAlias}.zip" update="true">
1254 :     <zipfileset src="${buildDirectory}/${buildLabel}/${SDKZip}"
1255 :     dirmode="775"
1256 :     filemode="664"
1257 : nickb 1.76 excludes="**/${domainNamespace}.*.examples*, **/${domainNamespace}.*.examples*/**, **/${domainNamespace}.*.sdk*, **/${domainNamespace}.*.sdk*/**, **/${domainNamespace}.*.all*, **/${domainNamespace}.*.all*/**, **/${domainNamespace}.*.doc*, **/${domainNamespace}.*.doc*/**, **/${domainNamespace}.*.source*, **/${domainNamespace}.*.source*/**, **/*src.zip"
1258 : nickb 1.63 >
1259 : nickb 1.76 <include name="**/${projNamespace}*" />
1260 :     <include name="**/${projNamespace}*/**" />
1261 : nickb 1.63 </zipfileset>
1262 :     <zipfileset src="${buildDirectory}/${buildLabel}/${allZip}"
1263 :     dirmode="775"
1264 :     filemode="664"
1265 :     id="rootfiles"
1266 :     includes="**/eclipse/epl-v10.html, **/eclipse/notice.html"
1267 :     />
1268 :     </zip>
1269 :    
1270 : nickb 1.71 <!-- build examples from ALL zip -->
1271 : nickb 1.63 <zip destfile="${buildDirectory}/${buildLabel}/${zipPrefix}-examples${incubation}-${buildAlias}.zip" update="true">
1272 :     <zipfileset src="${buildDirectory}/${buildLabel}/${allZip}" dirmode="775" filemode="664">
1273 : nickb 1.76 <include name="**/${domainNamespace}.*.example*" />
1274 :     <include name="**/${domainNamespace}.*.example*/**" />
1275 : nickb 1.63 </zipfileset>
1276 :     <zipfileset refid="rootfiles" />
1277 :     </zip>
1278 :    
1279 : nickb 1.108 <!--
1280 :     to do other non-standard packaging (or to clean out third party stuff)
1281 :     use buildExtra.xml#extraPackaging
1282 :     -->
1283 : nickb 1.117 <antcall target="buildExtra.xml">
1284 :     <param name="theTarget" value="extraPackaging" />
1285 : nickb 1.118 <param name="showWarning" value="true" />
1286 : nickb 1.117 </antcall>
1287 :    
1288 :     <antcall target="processMasterZip" />
1289 :     </target>
1290 :    
1291 :     <target name="buildExtra.xml" description="call buildExtra.xml and run a specific target if it exists; fail silently if showWarning not true">
1292 :     <property name="theTarget" value="getDependencies" />
1293 :     <property name="showWarning" value="false" />
1294 : nickb 1.63 <if>
1295 :     <available file="${relengBuilderDir}/buildExtra.xml" type="file" />
1296 :     <then>
1297 : nickb 1.108 <var name="buildExtra.xml.file" unset="true" />
1298 :     <loadfile property="buildExtra.xml.file" srcFile="${relengBuilderDir}/buildExtra.xml" />
1299 :     <if>
1300 : nickb 1.117 <contains string="${buildExtra.xml.file}" substring="target name=&quot;${theTarget}&quot;" />
1301 : nickb 1.108 <then>
1302 : nickb 1.117 <subant target="${theTarget}"
1303 :     description="Run project's ${relengBuilderDir}/buildExtra.xml#${theTarget}"
1304 : nickb 1.108 antfile="buildExtra.xml"
1305 :     buildpath="${relengBuilderDir}"
1306 :     inheritAll="true"
1307 :     failOnError="false"
1308 :     />
1309 :     <var name="buildExtra.xml.file" unset="true" />
1310 :     </then>
1311 :     <else>
1312 : nickb 1.117 <if>
1313 :     <equals arg1="${showWarning}" arg2="true" />
1314 :     <then>
1315 :     <echo>Note:
1316 :     Found buildExtra.xml but no ${theTarget} task. Nothing to do!
1317 : nickb 1.108 </echo>
1318 : nickb 1.117 </then>
1319 :     </if>
1320 : nickb 1.108 </else>
1321 :     </if>
1322 : nickb 1.63 </then>
1323 :     </if>
1324 :     </target>
1325 :    
1326 :     <target name="buildTests">
1327 :     <ant antfile="${relengCommonBuilderDir}/build.xml" target="main">
1328 :     <property name="component" value="builder/tests" />
1329 :     </ant>
1330 :     </target>
1331 :    
1332 : nickb 1.1 <target name="create.label.properties" unless="label.properties.exists">
1333 :     <mkdir dir="${buildDirectory}" />
1334 :     <!--store the build label information in a file-->
1335 : nickb 1.23 <echo file="${buildDirectory}/label.properties" append="true">buildType=${buildType}
1336 :     </echo>
1337 :     <echo file="${buildDirectory}/label.properties" append="true">buildId=${buildId}
1338 :     </echo>
1339 :     <echo file="${buildDirectory}/label.properties" append="true">timestamp=${timestamp}
1340 :     </echo>
1341 :     <echo file="${buildDirectory}/label.properties" append="true">buildLabel=${buildLabel}
1342 :     </echo>
1343 :     <echo file="${buildDirectory}/label.properties" append="true">buildAlias=${buildAlias}
1344 :     </echo>
1345 : nickb 1.78 <if>
1346 :     <isset property="forceContextQualifier" />
1347 :     <then>
1348 :     <echo file="${buildDirectory}/label.properties" append="true">forceContextQualifier=${forceContextQualifier}
1349 :     </echo>
1350 :     </then>
1351 :     </if>
1352 : nickb 1.1 </target>
1353 :    
1354 : nickb 1.30 <target name="cleanup">
1355 : nickb 1.22 <if>
1356 : nickb 1.130
1357 :     <!-- if noclean property is true, don't clean up.
1358 :     or, if noclean file exists (tests failed), and noclean
1359 :     property is either not set or is true, don't clean up
1360 :     -->
1361 : nickb 1.30 <or>
1362 : nickb 1.130 <istrue value="${noclean}" />
1363 :     <and>
1364 :     <available file="${buildDir}/noclean" type="file" />
1365 :     <or>
1366 :     <not>
1367 :     <isset property="noclean" />
1368 :     </not>
1369 :     <istrue value="${noclean}" />
1370 :     </or>
1371 :     </and>
1372 : nickb 1.30 </or>
1373 : nickb 1.22 <then>
1374 : nickb 1.71 <echo>The follow temporary files/folders should be deleted from your build:
1375 : nickb 1.73 ${buildDir}/*-AllFeaturesAndPlugins-*.zip*
1376 : nickb 1.71 ${buildDir}/*-Master-*.zip*
1377 : nickb 1.22 ${buildDir}/eclipse
1378 :     ${buildDir}/testing</echo>
1379 : nickb 1.30 </then>
1380 :     <else>
1381 :     <echo>Remove temp dirs in ${buildDir}</echo>
1382 : nickb 1.129 <delete dir="${buildDir}/eclipse" followsymlinks="false" includeemptydirs="true" defaultexcludes="false" />
1383 :     <delete dir="${buildDir}/testing" followsymlinks="false" includeemptydirs="true" defaultexcludes="false" />
1384 : nickb 1.73 <delete>
1385 : nickb 1.74 <fileset dir="${buildDir}" includes="*-Master-*.zip*, *-AllFeaturesAndPlugins-*.zip*" />
1386 : nickb 1.73 </delete>
1387 : nickb 1.22 </else>
1388 :     </if>
1389 : nickb 1.1 </target>
1390 :    
1391 : nickb 1.141 <!-- deprecated, old way using ant to call shell to start vnc then call ant -->
1392 : nickb 1.1 <target name="test">
1393 :     <property name="test.xml" value="../org.eclipse.releng.basebuilder/plugins/org.eclipse.build.tools/scripts/test.xml" />
1394 : nickb 1.40 <if>
1395 : nickb 1.141 <equals arg1="${baseos}" arg2="linux" />
1396 : nickb 1.40 <then>
1397 : nickb 1.141 <ant antfile="${test.xml}">
1398 :     <property name="shell" value="runtests.sh" />
1399 :     <property name="tester" value="${basedir}/builder/tests" />
1400 :     </ant>
1401 : nickb 1.40 </then>
1402 :     <else>
1403 : nickb 1.141 <antcall target="testLocal" />
1404 : nickb 1.40 </else>
1405 :     </if>
1406 : nickb 1.1 </target>
1407 :    
1408 : nickb 1.141 <!-- this target copied & modified from org.eclipse.releng.basebuilder/plugins/org.eclipse.build.tools/scripts/test.xml -->
1409 :     <target name="testLocal" description="New fully Ant-based test runner method for use on Linux, Mac, or Windows using default display port 0.0">
1410 :     <property name="buildcfg" value="${buildDir}/build.cfg" />
1411 : nickb 1.59 <if>
1412 : nickb 1.141 <available file="${buildcfg}" />
1413 : nickb 1.56 <then>
1414 : nickb 1.141 <property file="${buildcfg}" />
1415 : nickb 1.56 </then>
1416 : nickb 1.59 <else>
1417 : nickb 1.141 <fail message="ERROR! Can't find ${buildcfg}" />
1418 : nickb 1.59 </else>
1419 :     </if>
1420 : nickb 1.141
1421 :     <property name="dropLocation" value="${buildDirectory}" />
1422 :     <property name="clean" value="true" />
1423 :     <property name="tester" value="${basedir}/builder/tests" />
1424 :     <property name="testingDir" value="${buildDir}/testing/${buildLabel}/testing" />
1425 :     <property name="customTest" value="${tester}/customTest.xml" />
1426 :     <property name="testing.properties" value="${tester}/testing.properties" />
1427 :     <property file="${testing.properties}" />
1428 :    
1429 :     <delete dir="${testDir}" quiet="true" />
1430 :     <mkdir dir="${testDir}" />
1431 :     <property name="testResults" value="${dropLocation}/${buildLabel}/testresults" />
1432 :    
1433 :     <!--set up testing directory so we can resolve test.properties file-->
1434 :     <antcall target="expandTestFrameworkZip">
1435 :     <param name="expandTestFrameworkZip.sourceDir" value="${dropLocation}/${buildLabel}" />
1436 :     <param name="expandTestFrameworkZip.targetDir" value="${testDir}" />
1437 :     </antcall>
1438 :    
1439 :     <ant antfile="${tester}/test.xml" />
1440 :    
1441 :     <mkdir dir="${testResults}" />
1442 :     <mkdir dir="${testResults}/consolelogs" />
1443 :    
1444 :     <copy todir="${testResults}">
1445 :     <fileset dir="${executionDir}/results" />
1446 :     </copy>
1447 :    
1448 :     <if>
1449 :     <available file="${executionDir}/${consolelog}" type="file" />
1450 :     <then>
1451 :     <copy todir="${testResults}/consolelogs" file="${executionDir}/${consolelog}" />
1452 :     </then>
1453 :     </if>
1454 : nickb 1.1 </target>
1455 :    
1456 : nickb 1.141 <target name="expandTestFrameworkZip">
1457 :     <property name="expandTestFrameworkZip.sourceDir" value="" />
1458 :     <property name="expandTestFrameworkZip.targetDir" value="" />
1459 :     <if>
1460 :     <!-- local file available as part of this build -->
1461 :     <available file="${expandTestFrameworkZip.sourceDir}" type="dir" />
1462 :     <then>
1463 :     <if>
1464 :     <available file="${expandTestFrameworkZip.sourceDir}/${testFramework}" type="file" />
1465 :     <then>
1466 :     <echo>Unpack tests ${expandTestFrameworkZip.sourceDir}/${testFramework} to ${expandTestFrameworkZip.targetDir}</echo>
1467 :     <unzip dest="${expandTestFrameworkZip.targetDir}" overwrite="true">
1468 :     <fileset dir="${expandTestFrameworkZip.sourceDir}" includes="**/${testFramework}" />
1469 :     </unzip>
1470 :     </then>
1471 :     <else>
1472 :     <!-- search for a differently-named local file as part of this build -->
1473 :     <!-- (workaround for bug when using 'incubation=' and old shell-script based test harness) -->
1474 :     <echo>Unpack tests *-Automated-Tests-*.zip or *-automated-tests-*.zip to ${expandTestFrameworkZip.targetDir}</echo>
1475 :     <unzip dest="${expandTestFrameworkZip.targetDir}" overwrite="true">
1476 :     <fileset dir="${expandTestFrameworkZip.sourceDir}" includes="**/*-Automated-Tests-*.zip, **/*-automated-tests-*.zip" />
1477 :     </unzip>
1478 :     </else>
1479 :     </if>
1480 :     </then>
1481 :     <elseif>
1482 :     <!-- remote URL to zip from previous build -->
1483 :     <or>
1484 :     <contains string="${testFramework}" substring="http://" />
1485 :     <contains string="${testFramework}" substring="https://" />
1486 :     <contains string="${testFramework}" substring="ftp://" />
1487 :     </or>
1488 :     <then>
1489 :     <echo>Unpack tests ${testFramework} to ${expandTestFrameworkZip.targetDir}</echo>
1490 :     <propertyregex property="testFrameworkFile"
1491 :     input="${testFramework}"
1492 :     defaultvalue="${testFramework}"
1493 :     regexp=".+/([^/]+.zip)"
1494 :     replace="\1"
1495 :     casesensitive="false"
1496 :     override="true"
1497 :     />
1498 :     <ant target="getDep" antfile="${relengCommonBuilderDir}/tools/scripts/getDependencies.xml">
1499 :     <property name="url" value="${testFramework}" />
1500 :     <property name="file" value="${testFrameworkFile}" />
1501 :     <property name="unpackDest" value="${expandTestFrameworkZip.targetDir}" />
1502 :     </ant>
1503 :     </then>
1504 :     </elseif>
1505 :     <elseif>
1506 :     <!-- local file available as part of a previous build -->
1507 :     <available file="${testFramework}" type="file" />
1508 :     <then>
1509 :     <echo>Unpack tests ${testFramework} to ${expandTestFrameworkZip.targetDir}</echo>
1510 :     <unzip dest="${expandTestFrameworkZip.targetDir}" overwrite="true" src="${testFramework}" />
1511 :     </then>
1512 :     </elseif>
1513 :     <else>
1514 :     <fail>Error!
1515 :     Could not unpack tests ${testFramework} to ${expandTestFrameworkZip.targetDir}!
1516 :     </fail>
1517 :     </else>
1518 :     </if>
1519 : nickb 1.46 </target>
1520 :    
1521 : nickb 1.1 <target name="publish">
1522 : nickb 1.22 <echo message="Copy static files to build root folder" />
1523 : nickb 1.1 <copy todir="${buildDirectory}/${buildLabel}" overwrite="true">
1524 : nickb 1.30 <fileset dir="${relengCommonBuilderDir}/staticDropFiles" />
1525 : nickb 1.1 </copy>
1526 : nickb 1.67
1527 : nickb 1.22 <echo message="Move generated zips to build root folder" />
1528 : nickb 1.141 <move todir="${buildDir}" failonerror="false" overwrite="true">
1529 : nickb 1.22 <fileset dir="${buildDirectory}/${buildLabel}" />
1530 :     </move>
1531 :    
1532 :     <!-- generate a log of any compiler problems, warnings, errors, or failures -->
1533 :     <echo>Generate compilelogs/summary.txt</echo>
1534 :     <if>
1535 :     <available file="${buildDir}/compilelogs" type="dir" />
1536 :     <then>
1537 : nickb 1.147 <antfetch return="compilelogs.summary" antfile="${relengCommonScriptsDir}/getCompilerResults.xml" target="run">
1538 :     <property name="dir" value="${buildDir}/compilelogs" />
1539 :     </antfetch>
1540 :     <if>
1541 :     <and>
1542 :     <isset property="compilelogs.summary" />
1543 :     <not>
1544 :     <equals arg1="${compilelogs.summary}" arg2="" />
1545 :     </not>
1546 :     </and>
1547 :     <then>
1548 :     <echo file="${buildDir}/compilelogs/summary.txt">${compilelogs.summary}
1549 :     </echo>
1550 :     </then>
1551 :     </if>
1552 : nickb 1.22 </then>
1553 :     </if>
1554 : nickb 1.75
1555 :     <!-- https://bugs.eclipse.org/bugs/show_bug.cgi?id=266374#c4: create index files for subdirs -->
1556 :     <for param="dir" list="testresults, compilelogs" delimiter=", ">
1557 :     <sequential>
1558 : nickb 1.77 <if>
1559 :     <available file="${buildDir}/@{dir}" type="dir" />
1560 :     <then>
1561 :     <for param="subdir">
1562 :     <path>
1563 :     <dirset dir="${buildDir}/@{dir}" />
1564 :     </path>
1565 :     <sequential>
1566 :     <copy file="${buildDir}/index.php" todir="@{subdir}" />
1567 :     </sequential>
1568 :     </for>
1569 :     </then>
1570 :     </if>
1571 : nickb 1.75 </sequential>
1572 :     </for>
1573 : nickb 1.1 </target>
1574 :    
1575 :     <target name="generateDigests">
1576 : nickb 1.45 <!-- Ant 1.7.x required for format="MD5SUM" -->
1577 :     <for param="zip">
1578 :     <path>
1579 :     <fileset dir="${buildDirectory}/${buildLabel}">
1580 :     <include name="*.zip" />
1581 :     </fileset>
1582 :     </path>
1583 :     <sequential>
1584 : nickb 1.52 <checksum file="@{zip}" format="MD5SUM" fileext=".md5" />
1585 : nickb 1.45 </sequential>
1586 :     </for>
1587 : nickb 1.1 </target>
1588 :    
1589 : nickb 1.23 <!--
1590 :     given a list of platforms & dependencies, assemble one or more all in ones
1591 : nickb 1.18 by copying the eclipse zip/tar.gz, then adding deps + SDK into it
1592 :     -->
1593 :     <target name="packAllInOnes" depends="init" description="create one or more all-in-one archives">
1594 : nickb 1.105 <antcall target="-timestamp" inheritAll="false" />
1595 : nickb 1.18 <!-- defaults, if not set in buildAll.xml -->
1596 :     <if>
1597 :     <not>
1598 :     <isset property="allInOnePrefix" />
1599 :     </not>
1600 :     <then>
1601 :     <property name="allInOnePrefix" value="${projectName}-all-in-one" />
1602 :     </then>
1603 :     </if>
1604 :     <if>
1605 :     <not>
1606 :     <isset property="allInOnePlatforms" />
1607 :     </not>
1608 :     <then>
1609 :     <property name="allInOnePlatforms" value="linux-gtk,win32,macosx-carbon" />
1610 :     </then>
1611 :     </if>
1612 :     <if>
1613 :     <not>
1614 :     <isset property="allInOneEclipseBase" />
1615 :     </not>
1616 :     <then>
1617 :     <property name="allInOneEclipseBase" value="SDK" />
1618 :     </then>
1619 :     </if>
1620 :     <if>
1621 :     <not>
1622 :     <isset property="allInOneInputs" />
1623 :     </not>
1624 :     <then>
1625 :     <property name="allInOneInputs" value="${allZip}" />
1626 :     </then>
1627 :     </if>
1628 :     <if>
1629 :     <not>
1630 :     <isset property="allInOneInputExtras" />
1631 :     </not>
1632 :     <then>
1633 :     <property name="allInOneInputExtras" value="" />
1634 :     </then>
1635 :     </if>
1636 :     <if>
1637 :     <not>
1638 :     <isset property="allInOneBuildTypes" />
1639 :     </not>
1640 :     <then>
1641 :     <property name="allInOneBuildTypes" value="S,R" />
1642 :     </then>
1643 :     </if>
1644 : nickb 1.139
1645 : nickb 1.18 <if>
1646 : nickb 1.140 <not>
1647 :     <isset property="incubation" />
1648 :     </not>
1649 : nickb 1.18 <then>
1650 :     <property name="incubation" value="" />
1651 :     </then>
1652 :     </if>
1653 :    
1654 :     <for param="allInOneBuildType" list="${allInOneBuildTypes}">
1655 :     <sequential>
1656 :     <if>
1657 :     <equals arg1="${buildType}" arg2="@{allInOneBuildType}" />
1658 :     <then>
1659 :     <echo message="Generating type ${buildType} All-In-One archive(s) ..." />
1660 :     <var name="allInOneArchiveTmp" value="${buildDirectory}/${buildLabel}/allInOneArchiveTmp" />
1661 :    
1662 :     <!-- for all the platform suffixes to build... -->
1663 :     <for param="platformSuffix" list="${allInOnePlatforms}">
1664 :     <sequential>
1665 :     <if>
1666 :     <equals arg1="@{platformSuffix}" arg2="win32" />
1667 :     <then>
1668 :     <var name="allInOneArchiveSuffix" value=".zip" />
1669 :     </then>
1670 :     <else>
1671 :     <var name="allInOneArchiveSuffix" value=".tar" />
1672 :     </else>
1673 :     </if>
1674 :     <if>
1675 :     <equals arg1="@{platformSuffix}" arg2="win32" />
1676 :     <then>
1677 :     <var name="eclipseSuffix" value=".zip" />
1678 :     </then>
1679 :     <else>
1680 :     <var name="eclipseSuffix" value=".tar.gz" />
1681 :     </else>
1682 :     </if>
1683 :     <var name="allInOneArchive"
1684 :     value="${allInOnePrefix}-@{platformSuffix}${incubation}-${buildAlias}${allInOneArchiveSuffix}"
1685 :     />
1686 :     <var name="allInOneArchivePath" value="${buildDirectory}/${buildLabel}/${allInOneArchive}" />
1687 :    
1688 :     <!-- get the Eclipse bundle if not already downloaded: only need linux-gtk to build, but need others to package up all-in-ones -->
1689 : nickb 1.118 <!-- <echo message="orig eclipse.base.file = ${eclipse.base.file}" /> -->
1690 : nickb 1.18 <propertyregex property="thisEclipseFile"
1691 : nickb 1.118 input="${eclipse.base.file}"
1692 : nickb 1.18 regexp="(eclipse-)(SDK-)(.+)(-linux-gtk\.tar\.gz)"
1693 :     replace="\1${allInOneEclipseBase}-\3-@{platformSuffix}${eclipseSuffix}"
1694 :     casesensitive="false"
1695 :     />
1696 : nickb 1.118 <!-- <echo message="this eclipse.base.file = ${thisEclipseFile}" /> -->
1697 : nickb 1.18 <if>
1698 :     <not>
1699 :     <available file="${downloadsDir}/${thisEclipseFile}" type="file" />
1700 :     </not>
1701 :     <then>
1702 : nickb 1.118 <!-- <echo message="orig eclipse.base.url = ${eclipse.base.url}" /> -->
1703 : nickb 1.18 <propertyregex property="thisEclipseURL"
1704 : nickb 1.118 input="${eclipse.base.url}"
1705 : nickb 1.18 regexp="(.+eclipse-)(SDK-)(.+)(-linux-gtk\.tar\.gz)"
1706 :     replace="\1${allInOneEclipseBase}-\3-@{platformSuffix}${eclipseSuffix}"
1707 :     casesensitive="false"
1708 :     />
1709 : nickb 1.118 <!-- <echo message="this eclipse.base.url = ${thisEclipseURL}" /> -->
1710 : nickb 1.105 <antcall target="-timestamp" inheritAll="false" />
1711 : nickb 1.18 <get src="${thisEclipseURL}" dest="${downloadsDir}/${thisEclipseFile}" usetimestamp="true" />
1712 :     <touch file="${downloadsDir}/${thisEclipseFile}" />
1713 :     </then>
1714 :     </if>
1715 :    
1716 : nickb 1.105 <antcall target="-timestamp" inheritAll="false" />
1717 : nickb 1.18
1718 :     <!-- unpack project's SDK and/or ALL zip -->
1719 :     <for param="allInOneInput" list="${allInOneInputs}">
1720 :     <sequential>
1721 : nickb 1.105 <antcall target="-timestamp" inheritAll="false" />
1722 : nickb 1.18 <!-- <echo message="Add @{allInOneInput} into ${allInOneArchiveTmp} ..." /> -->
1723 :     <unzip src="${buildDirectory}/${buildLabel}/@{allInOneInput}" dest="${allInOneArchiveTmp}/eclipse/dropins/" />
1724 :     </sequential>
1725 :     </for>
1726 :     <!-- unpack each dep -->
1727 : nickb 1.19 <for param="dependency.file" list="${required.dependency.files}">
1728 : nickb 1.18 <sequential>
1729 : nickb 1.105 <antcall target="-timestamp" inheritAll="false" />
1730 : nickb 1.19 <!-- <echo message="Add @{dependency.file} into ${allInOneArchiveTmp} ..." /> -->
1731 :     <unzip src="${downloadsDir}/@{dependency.file}" dest="${allInOneArchiveTmp}/eclipse/dropins/" />
1732 : nickb 1.18 </sequential>
1733 :     </for>
1734 :     <!-- unpack extra deps (if any) -->
1735 : nickb 1.19 <for param="extra.dependency.file" list="${allInOneInputExtras}">
1736 : nickb 1.18 <sequential>
1737 : nickb 1.105 <antcall target="-timestamp" inheritAll="false" />
1738 : nickb 1.19 <!-- <echo message="Add @{extra.dependency.file} into ${allInOneArchiveTmp} ..." /> -->
1739 :     <unzip src="${downloadsDir}/@{extra.dependency.file}" dest="${allInOneArchiveTmp}/eclipse/dropins/" />
1740 : nickb 1.18 </sequential>
1741 :     </for>
1742 :    
1743 : nickb 1.105 <antcall target="-timestamp" inheritAll="false" />
1744 : nickb 1.18 <!-- <echo message="Create ${allInOneArchive} from ${thisEclipseFile} ..." /> -->
1745 :     <if>
1746 :     <equals arg1="@{platformSuffix}" arg2="win32" />
1747 :     <then>
1748 :     <!-- copy & rename the Eclipse SDK -->
1749 :     <copy file="${downloadsDir}/${thisEclipseFile}" tofile="${allInOneArchivePath}" />
1750 :    
1751 :     <!-- add deps + project files -->
1752 :     <zip destfile="${allInOneArchivePath}" update="true">
1753 :     <fileset dir="${allInOneArchiveTmp}" />
1754 :     </zip>
1755 :     </then>
1756 :     <else>
1757 :     <!-- copy & rename the Eclipse SDK -->
1758 :     <gunzip src="${downloadsDir}/${thisEclipseFile}" dest="${allInOneArchivePath}" />
1759 :     <exec executable="/bin/tar" dir="${allInOneArchiveTmp}" failonerror="true">
1760 :     <arg line="upf ${allInOneArchivePath} eclipse" />
1761 :     </exec>
1762 :     <gzip src="${allInOneArchivePath}" destfile="${allInOneArchivePath}.gz" />
1763 :     <delete file="${allInOneArchivePath}" />
1764 :     </else>
1765 :     </if>
1766 :     <var name="thisEclipseFile" unset="true" />
1767 :     <var name="thisEclipseURL" unset="true" />
1768 :     </sequential>
1769 :     </for>
1770 : nickb 1.105 <antcall target="-timestamp" inheritAll="false" />
1771 : nickb 1.18 <delete dir="${allInOneArchiveTmp}" includeemptydirs="true" quiet="true" failonerror="false" />
1772 :     </then>
1773 :     </if>
1774 :     </sequential>
1775 :     </for>
1776 :     </target>
1777 :    
1778 : nickb 1.82 <!-- DEBUG:
1779 :     To test this script locally to see what output it will generate (particularly re: URL parsing) in build.cfg,
1780 :     set "localtest" = "true" in "genBuildCfgInit" target, then run the "genBuildCfg" target and watch console output
1781 :     -->
1782 : nickb 1.23 <target name="genBuildCfgInit" depends="init">
1783 :     <!--
1784 :     INPUTS:
1785 :    
1786 :     for overall start.sh / buildAll.xml
1787 :    
1788 :     + cvs/svn details for .releng project
1789 :     (must be set, but can be a local dir rather than VCS path)
1790 :     + projectid (must be set, eg., modeling.emf.cdo or tools.gef)
1791 :     buildTimestamp (opt, will generate)
1792 :     buildType (opt, def N)
1793 :     buildAlias (opt, for specially-named milestones & RC builds, eg., "1.0.0M7")
1794 :     writableBuildRoot (eg., ${WORKSPACE} for Hudson builds, or if non-standard value used)
1795 :     version (if not set in build.properties)
1796 :     basebuilderBranch (if not set in build.properties)
1797 :     javaHome (if not set in build.properties)
1798 :     downloadsDir (if not set in build.properties)
1799 :    
1800 : nickb 1.29 for buildAllHelper.xml#genBuildCfg, only need three values
1801 : nickb 1.23
1802 :     projectid
1803 :     relengBuilderDir (OR buildDir)
1804 :     dependencyURLs (comma-separated list of required dependencies, if not set in project's build.properties)
1805 :     -->
1806 :    
1807 : nickb 1.100 <property name="localtest" value="false" />
1808 : nickb 1.23 <if>
1809 : nickb 1.134 <istrue value="${localtest}" />
1810 : nickb 1.23 <then>
1811 :     <property name="debug" value="true" />
1812 :     <property name="downloadZipsIfNotFound" value="false" />
1813 :     </then>
1814 :     <else>
1815 :     <property name="debug" value="false" />
1816 :     <property name="downloadZipsIfNotFound" value="true" />
1817 :     </else>
1818 :     </if>
1819 :    
1820 :     <!-- MUST BE SET COMMANDLINE if not already defined in project's releng/build.properties
1821 :     -Dprojectid=top.proj.sub (modeling.emf.cdo) or proj.sub (tools.myproject) -->
1822 :     <property name="projectid" value="tools.myproject" />
1823 : nickb 1.76 <antcallback target="projectid2names" return="topprojectName, projectName, subprojectName" />
1824 : nickb 1.23
1825 :     <if>
1826 :     <not>
1827 :     <isset property="buildTimestamp" />
1828 :     </not>
1829 :     <then>
1830 :     <if>
1831 :     <isset property="buildDir" />
1832 :     <then>
1833 :     <!-- generate buildTimestamp as last folder in buildDir's path -->
1834 :     <propertyregex property="buildTimestamp"
1835 : nickb 1.137 defaultvalue="NONE"
1836 : nickb 1.23 input="${buildDir}"
1837 :     casesensitive=""
1838 :     regexp="(.+)/([NIMSR])([^/]+)"
1839 :     replace="\3"
1840 :     override="true"
1841 :     />
1842 : nickb 1.137 <if>
1843 :     <equals arg1="${buildTimestamp}" arg2="NONE" />
1844 :     <then>
1845 : nickb 1.138 <var name="buildTimestamp" unset="true" />
1846 : nickb 1.137 <tstamp>
1847 :     <format property="buildTimestamp" pattern="yyyyMMddHHmm" />
1848 :     </tstamp>
1849 :     <echo>Ant generated: buildTimestamp=${buildTimestamp}</echo>
1850 :     </then>
1851 :     </if>
1852 : nickb 1.23 </then>
1853 :     <else>
1854 :     <tstamp>
1855 : nickb 1.26 <format property="buildTimestamp" pattern="yyyyMMddHHmm" />
1856 : nickb 1.23 </tstamp>
1857 : nickb 1.26 <echo>Ant generated: buildTimestamp=${buildTimestamp}</echo>
1858 : nickb 1.23 </else>
1859 :     </if>
1860 :     </then>
1861 :     </if>
1862 :    
1863 :     <if>
1864 :     <not>
1865 :     <isset property="buildType" />
1866 :     </not>
1867 :     <then>
1868 :     <if>
1869 :     <isset property="buildDir" />
1870 :     <then>
1871 :     <!-- generate buildType as first letter of last folder in buildDir's path -->
1872 :     <propertyregex property="buildType"
1873 :     defaultvalue="${buildDir}"
1874 :     input="${buildDir}"
1875 :     casesensitive=""
1876 :     regexp="(.+)/([NIMSR])([^/]+)"
1877 :     replace="\2"
1878 :     override="true"
1879 :     />
1880 :     </then>
1881 :     <else>
1882 :     <property name="buildType" value="N" />
1883 :     </else>
1884 :     </if>
1885 :     </then>
1886 :     </if>
1887 :    
1888 :     <if>
1889 :     <not>
1890 :     <isset property="buildDir" />
1891 :     </not>
1892 :     <then>
1893 :     <if>
1894 :     <isset property="relengBuilderDir" />
1895 :     <then>
1896 :     <!-- generate buildDir as relengBuilderDir's parent -->
1897 :     <propertyregex property="buildDir"
1898 :     defaultvalue="${relengBuilderDir}"
1899 :     input="${relengBuilderDir}"
1900 :     casesensitive=""
1901 :     regexp="(.+)/([^/]+)"
1902 :     replace="\1"
1903 :     override="true"
1904 :     />
1905 :     </then>
1906 :     <else>
1907 : nickb 1.24 <!-- convert projectid to path -->
1908 : nickb 1.30 <propertyregex property="projectPath"
1909 :     defaultValue="${projectid}"
1910 :     input="${projectid}"
1911 :     casesensitive="false"
1912 :     regexp="\."
1913 :     replace="/"
1914 :     override="true"
1915 :     />
1916 : nickb 1.23 <property name="buildDir"
1917 : nickb 1.34 value="${writableBuildRoot}/${projectPath}/downloads/drops/${version}/${buildType}${buildTimestamp}"
1918 : nickb 1.23 />
1919 :     </else>
1920 :     </if>
1921 :     </then>
1922 :     </if>
1923 : nickb 1.30 <mkdir dir="${buildDir}" />
1924 : nickb 1.23
1925 :     <!-- CAN BE SET COMMANDLINE: -Dbuildcfg=/path/to/build.cfg -->
1926 :     <if>
1927 :     <not>
1928 :     <isset property="buildcfg" />
1929 :     </not>
1930 :     <then>
1931 :     <if>
1932 :     <isset property="buildDir" />
1933 :     <then>
1934 :     <property name="buildcfg" value="${buildDir}/build.cfg" />
1935 :     </then>
1936 :     <else>
1937 :     <property name="buildcfg" value="${basedir}/build.cfg" />
1938 :     </else>
1939 :     </if>
1940 :     </then>
1941 :     </if>
1942 :    
1943 :     <!-- start with a clean file every time -->
1944 :     <if>
1945 :     <available file="${buildcfg}" type="file" />
1946 :     <then>
1947 :     <delete file="${buildcfg}" />
1948 :     </then>
1949 :     </if>
1950 :    
1951 :     </target>
1952 :    
1953 : nickb 1.82 <!-- DEBUG:
1954 :     To test this script locally to see what output it will generate (particularly re: URL parsing) in build.cfg,
1955 :     set "localtest" = "true" in "genBuildCfgInit" target, then run the "genBuildCfg" target and watch console output
1956 :     -->
1957 : nickb 1.23 <target name="genBuildCfg" depends="genBuildCfgInit" description="Create build.cfg file">
1958 :    
1959 :     <antcallback target="createBuildConfigFile" return="buildcfg" />
1960 :     <echo>Created ${buildcfg}</echo>
1961 :     <property file="${buildcfg}" />
1962 : nickb 1.30 <mkdir dir="${downloadsDir}" />
1963 :     <mkdir dir="${buildDir}" />
1964 : nickb 1.23
1965 : nickb 1.114 <if>
1966 : nickb 1.134 <isfalse value="${localtest}" />
1967 : nickb 1.114 <then>
1968 :     <!-- determine the type of maps used in the build -->
1969 :     <antcallback target="collectMapTypes" return="mapTypes" />
1970 :     <echo>Found these map entry types: ${mapTypes}</echo>
1971 :     </then>
1972 :     </if>
1973 : nickb 1.107
1974 : nickb 1.23 <!-- generate URL-related properties -->
1975 :     <antcallback target="collectURLs" return="numURLs" />
1976 :     <echo>Found ${numURLs} dependency URLs</echo>
1977 :    
1978 :     </target>
1979 :    
1980 :     <target name="createBuildConfigFile">
1981 :    
1982 : nickb 1.120 <!-- dump all commandline vars set above as they should override anything set in .properties files below: see also buildAll.xml#runEclipse -->
1983 : nickb 1.124 <antcallback return="commandlineArgsList" target="initCommandlineArgsList" />
1984 : nickb 1.30 <echo file="${buildcfg}" append="true">
1985 :     # Commandline variables override default values set below
1986 : nickb 1.33
1987 :     # Note that this file is meant to be read by Ant, not shell,
1988 : nickb 1.30 # so only the first assignment of a variable will stick
1989 : nickb 1.33 # If parsing this file, make sure to stop after the first
1990 : nickb 1.30 # variable is found.
1991 : nickb 1.33
1992 : nickb 1.23 </echo>
1993 : nickb 1.120 <for param="clv" list="${commandlineArgsList}" delimiter=",
1994 :     ">
1995 : nickb 1.23 <sequential>
1996 :     <if>
1997 :     <isset property="@{clv}" />
1998 :     <then>
1999 :     <echo file="${buildcfg}" append="true">@{clv}=${@{clv}}
2000 :     </echo>
2001 :     </then>
2002 :     </if>
2003 :     </sequential>
2004 :     </for>
2005 :    
2006 :     <if>
2007 :     <isset property="localSourceCheckoutDir" />
2008 :     <then>
2009 :     <echo file="${buildcfg}" append="true">
2010 :    
2011 :     # build from local source instead of VCS repo?
2012 :     skipFetch=true
2013 :     localSourceCheckoutDir=${localSourceCheckoutDir}
2014 :     </echo>
2015 : nickb 1.83 <property name="forceContextQualifier" value="v${buildTimestamp}" />
2016 : nickb 1.23 </then>
2017 :     </if>
2018 : nickb 1.79
2019 : nickb 1.78 <if>
2020 :     <isset property="forceContextQualifier" />
2021 :     <then>
2022 : nickb 1.116 <echo file="${buildcfg}" append="true">
2023 :     forceContextQualifier=${forceContextQualifier}
2024 :     </echo>
2025 : nickb 1.80 </then>
2026 :     </if>
2027 : nickb 1.119
2028 :     <if>
2029 : nickb 1.127 <or>
2030 :     <not>
2031 :     <isset property="packageFeaturesIncludedBinaries" />
2032 :     </not>
2033 : nickb 1.121 <istrue value="${packageFeaturesIncludedBinaries}" />
2034 : nickb 1.127 </or>
2035 : nickb 1.119 <then>
2036 :     <echo file="${buildcfg}" append="true">
2037 :     runPackager=true
2038 :     </echo>
2039 :     </then>
2040 :     </if>
2041 :    
2042 : nickb 1.80 <if>
2043 :     <isset property="fetchTag" />
2044 :     <then>
2045 : nickb 1.115 <echo file="${buildcfg}" append="true">
2046 :     fetchTag=${fetchTag}
2047 :     </echo>
2048 : nickb 1.78 </then>
2049 :     </if>
2050 : nickb 1.23
2051 : nickb 1.58 <!-- linux + windows, want parent of .../jre or ...\jre
2052 :     mac, just use ${java.home}
2053 : nickb 1.54 -->
2054 : nickb 1.51 <propertyregex property="JAVA_HOME_PARENT"
2055 :     defaultvalue="${java.home}"
2056 :     input="${java.home}"
2057 :     casesensitive="false"
2058 :     regexp="(.+)([^/\\]+)(/|\\)jre"
2059 :     replace="\1\2"
2060 :     override="true"
2061 :     />
2062 : nickb 1.54
2063 : nickb 1.23 <echo file="${buildcfg}" append="true">
2064 :    
2065 :     # Environment variables
2066 :     HOME=${user.home}
2067 : nickb 1.51 JAVA_HOME=${JAVA_HOME_PARENT}
2068 :     java.home=${JAVA_HOME}
2069 : nickb 1.47 ANT_HOME=${ant.home}
2070 : nickb 1.51 ANT=${ant.home}/bin/ant
2071 :    
2072 : nickb 1.23 #Platform details
2073 :     </echo>
2074 :    
2075 :     <!-- TODO: is this redundant to what's in buildAll.xml? -->
2076 :    
2077 :     <!-- os name -->
2078 :     <if>
2079 :     <equals arg1="${os.name}" arg2="linux" casesensitive="false" />
2080 :     <then>
2081 :     <echo file="${buildcfg}" append="true">baseos=linux
2082 :     </echo>
2083 :     </then>
2084 :     <elseif>
2085 :     <and>
2086 :     <contains string="${os.name}" substring="64" casesensitive="false" />
2087 :     <contains string="${os.name}" substring="win" casesensitive="false" />
2088 :     </and>
2089 :     <then>
2090 :     <echo file="${buildcfg}" append="true">baseos=win64
2091 :     </echo>
2092 :     </then>
2093 :     </elseif>
2094 :     <elseif>
2095 :     <contains string="${os.name}" substring="win" casesensitive="false" />
2096 :     <then>
2097 :     <echo file="${buildcfg}" append="true">baseos=win32
2098 :     </echo>
2099 :     </then>
2100 :     </elseif>
2101 :     <elseif>
2102 :     <contains string="${os.name}" substring="mac" casesensitive="false" />
2103 :     <then>
2104 :     <echo file="${buildcfg}" append="true">baseos=macosx
2105 :     </echo>
2106 :     </then>
2107 :     </elseif>
2108 :     <else>
2109 :     <echo file="${buildcfg}" append="true">baseos=${os.name}
2110 :     </echo>
2111 :     </else>
2112 :     </if>
2113 :    
2114 :     <!-- architecture -->
2115 :     <if>
2116 :     <or>
2117 :     <equals arg1="${os.arch}" arg2="i386" />
2118 :     <equals arg1="${os.arch}" arg2="i486" />
2119 :     <equals arg1="${os.arch}" arg2="i586" />
2120 :     <equals arg1="${os.arch}" arg2="i686" />
2121 :     </or>
2122 :     <then>
2123 :     <echo file="${buildcfg}" append="true">basearch=x86
2124 :     </echo>
2125 :     </then>
2126 :     <elseif>
2127 :     <equals arg1="${os.arch}" arg2="amd64" />
2128 :     <then>
2129 :     <echo file="${buildcfg}" append="true">basearch=x86_64
2130 :     </echo>
2131 :     </then>
2132 :     </elseif>
2133 :     <elseif>
2134 :     <equals arg1="${os.arch}" arg2="ppc64" />
2135 :     <then>
2136 :     <echo file="${buildcfg}" append="true">basearch=ppc64
2137 :     </echo>
2138 :     </then>
2139 :     </elseif>
2140 :     <else>
2141 :     <echo file="${buildcfg}" append="true">basearch=${os.arch}
2142 :     </echo>
2143 :     </else>
2144 :     </if>
2145 :    
2146 :     <!-- window system -->
2147 :     <if>
2148 :     <equals arg1="${os.name}" arg2="linux" casesensitive="false" />
2149 :     <then>
2150 :     <echo file="${buildcfg}" append="true">basews=gtk
2151 :     </echo>
2152 :     </then>
2153 :     <elseif>
2154 :     <and>
2155 :     <contains string="${os.name}" substring="64" casesensitive="false" />
2156 :     <contains string="${os.name}" substring="win" casesensitive="false" />
2157 :     </and>
2158 :     <then>
2159 :     <echo file="${buildcfg}" append="true">basews=win64
2160 :     </echo>
2161 :     </then>
2162 :     </elseif>
2163 :     <elseif>
2164 :     <contains string="${os.name}" substring="win" casesensitive="false" />
2165 :     <then>
2166 :     <echo file="${buildcfg}" append="true">basews=win32
2167 :     </echo>
2168 :     </then>
2169 :     </elseif>
2170 :     <elseif>
2171 :     <contains string="${os.name}" substring="mac" casesensitive="false" />
2172 :     <then>
2173 : nickb 1.142 <if>
2174 : nickb 1.144 <isset property="osgi.ws" />
2175 : nickb 1.142 <then>
2176 : nickb 1.143 <echo file="${buildcfg}" append="true">#for osgi.ws=${osgi.ws}
2177 : nickb 1.144 basews=${osgi.ws}
2178 : nickb 1.142 </echo>
2179 :     </then>
2180 :     <else>
2181 : nickb 1.144 <!-- default to carbon, not cocoa? -->
2182 : nickb 1.143 <echo file="${buildcfg}" append="true">#for osgi.ws=${osgi.ws}
2183 :     basews=carbon
2184 : nickb 1.23 </echo>
2185 : nickb 1.142 </else>
2186 :     </if>
2187 : nickb 1.23 </then>
2188 :     </elseif>
2189 :     </if>
2190 :    
2191 :     <!-- merge other properties files into build.cfg so in order of override priority, and expand variables -->
2192 : nickb 1.82 <if>
2193 : nickb 1.134 <isfalse value="${localtest}" />
2194 : nickb 1.82 <then>
2195 :    
2196 :     <loadfile property="builder.build.properties.file" srcFile="${relengBuilderDir}/build.properties">
2197 :     <filterchain>
2198 :     <expandproperties />
2199 :     </filterchain>
2200 :     </loadfile>
2201 :     <property file="${relengBuilderDir}/build.properties" />
2202 :     <loadfile property="common.build.properties.file" srcFile="${relengCommonBuilderDir}/build.properties">
2203 :     <filterchain>
2204 :     <expandproperties />
2205 :     </filterchain>
2206 :     </loadfile>
2207 :     <property file="${relengCommonBuilderDir}/build.properties" />
2208 :     <loadfile property="server.properties.file" srcFile="${relengCommonBuilderDir}/server.properties">
2209 :     <filterchain>
2210 :     <expandproperties />
2211 :     </filterchain>
2212 :     </loadfile>
2213 :     <property file="${relengCommonBuilderDir}/server.properties" />
2214 :     </then>
2215 :     </if>
2216 : nickb 1.23 <echo file="${buildcfg}" append="true">
2217 :    
2218 :     ## Load ${relengBuilderDir}/build.properties ##
2219 :     ${builder.build.properties.file}
2220 :    
2221 :     ## Load ${relengCommonBuilderDir}/build.properties ##
2222 :     ${common.build.properties.file}
2223 :    
2224 :     ## Load ${relengCommonBuilderDir}/server.properties ##
2225 :     ${server.properties.file}
2226 :    
2227 :     </echo>
2228 :    
2229 :     <echo file="${buildcfg}" append="true">
2230 :     # yet more path variables
2231 :     baseLocation=${buildDir}/eclipse
2232 :     testBase=${buildDir}/testing
2233 :    
2234 :     # label.properties variables
2235 :     buildId=${buildType}${buildTimestamp}
2236 :     buildID=${buildType}${buildTimestamp}
2237 :     timestamp=${buildTimestamp}
2238 :     buildDateStamp=${buildTimestamp}
2239 :     buildLabel=${buildType}${buildTimestamp}
2240 :     </echo>
2241 :    
2242 :     <if>
2243 :     <isset property="buildAlias" />
2244 :     <then>
2245 :     <echo file="${buildcfg}" append="true">buildAlias=${buildAlias}</echo>
2246 :     </then>
2247 :     <else>
2248 :     <echo file="${buildcfg}" append="true">buildAlias=${buildType}${buildTimestamp}</echo>
2249 :     </else>
2250 :     </if>
2251 :     </target>
2252 :    
2253 :     <target name="collectURLs">
2254 :     <!-- TODO: allow override for projects that use Google Analytics to track downloads; eg., /modeling/download.php?file= -->
2255 :     <echo file="${buildcfg}" append="true">
2256 :    
2257 :     #Base download URL
2258 :     eclipse.download.url=http://www.eclipse.org/downloads/download.php?file=
2259 :    
2260 :     </echo>
2261 :    
2262 :     <var name="requirement.type" value="" />
2263 :     <var name="requirement.dropfile" value="" />
2264 :     <var name="required.dependency.files" value="" />
2265 :    
2266 :     <if>
2267 : nickb 1.134 <istrue value="${localtest}" />
2268 : nickb 1.23 <then>
2269 :     <!-- some sample URLs for testing; real build must pass in actual values as one long space separated string -->
2270 : nickb 1.82
2271 : nickb 1.23 <property name="dependencyURLs"
2272 :     value="
2273 : nickb 1.118 http://ftp.osuosl.org/pub/eclipse/eclipse/downloads/drops/R-3.5.1-200909170800/eclipse-RCP-3.5.1-win32.zip
2274 :     http://www.eclipse.org/downloads/download.php?r=1&amp;file=/eclipse/downloads/drops/R-3.5-200906111540/eclipse-SDK-3.5-linux-gtk.tar.gz
2275 : nickb 1.114 "
2276 :     />
2277 :     <property name="dependencyURLs"
2278 :     value="
2279 : nickb 1.118 ---------,
2280 : nickb 1.114 http://www.eclipse.org/downloads/download.php?r=1&amp;file=/eclipse/downloads/drops/R-3.5-200906111540/eclipse-SDK-3.5-linux-gtk.tar.gz
2281 :     ---------,
2282 : nickb 1.99 http://anonsvn.jboss.org/repos/repository.jboss.org/eclipse/galileo/emf-runtime-2.5.0RC2.zip,
2283 :     http://anonsvn.jboss.org/repos/repository.jboss.org/eclipse/galileo/xsd-runtime-2.5.0RC2.zip,
2284 :     http://anonsvn.jboss.org/repos/repository.jboss.org/eclipse/galileo/wtp-S-3.1RC2-20090526075706.zip,
2285 : nickb 1.114 http://anonsvn.jboss.org/repos/repository.jboss.org/eclipse/galileo/eclipse-SDK-3.5RC3-linux-gtk.tar.gz,
2286 :     ---------,
2287 :     http://repository.jboss.org/eclipse/galileo/eclipse-SDK-3.5-linux-gtk.tar.gz,
2288 :     http://repository.jboss.org/eclipse/galileo/GEF-runtime-3.5.0.zip,
2289 : nickb 1.99 ---------,
2290 : nickb 1.82 ftp://ftp.ussg.iu.edu/pub/eclipse/eclipse/downloads/drops/S-3.5M7-200904302300/eclipse-SDK-3.5M7-linux-gtk.tar.gz,
2291 :     http://download.eclipse.org/eclipse/downloads/drops/R-3.4.1-200809111700/eclipse-SDK-3.4.1-linux-gtk.tar.gz,
2292 :     ---------,
2293 :     http://ftp.ussg.iu.edu/eclipse/modeling/emf/emf/downloads/drops/2.5.0/S200905041408/emf-runtime-2.5.0M7.zip,
2294 :     http://download.eclipse.org/modeling/emf/emf/downloads/drops/2.4.1/R200808251517/emf-runtime-2.4.1.zip,
2295 :     ---------,
2296 :     http://ftp.ussg.iu.edu/eclipse/modeling/emf/emf/downloads/drops/2.5.0/S200905041408/xsd-runtime-2.5.0M7.zip,
2297 :     http://download.eclipse.org/modeling/emf/emf/downloads/drops/2.4.1/R200808251517/xsd-runtime-2.4.1.zip,
2298 :     ---------,
2299 :     http://ftp.ussg.iu.edu/eclipse/tools/gef/downloads/drops/3.5.0/S200905011522/GEF-SDK-3.5.0M7.zip,
2300 :     http://download.eclipse.org/tools/gef/downloads/drops/3.4.1/R200809101400/GEF-SDK-3.4.1.zip,
2301 :     ---------,
2302 :     http://ftp.ussg.iu.edu/eclipse/webtools/downloads/drops/R3.1/S-3.1M7-20090505073946/wtp-wst-sdk-S-3.1M7-20090505073946.zip,
2303 :     http://download.eclipse.org/webtools/downloads/drops/R3.0/R-3.0.3-20081113203138/wtp-wst-sdk-R-3.0.3-20081113203138.zip,
2304 :     ---------,
2305 :     http://www.eclipse.org/downloads/download.php?r=1&amp;file=/eclipse/downloads/drops/S-3.5M7-200904302300/eclipse-SDK-3.5M7-linux-gtk.tar.gz,
2306 :     ---------,
2307 : nickb 1.23 http://download.eclipse.org/eclipse/downloads/drops/R-3.4-200806172000/eclipse-SDK-3.4.1-linux-gtk-ppc.tar.gz,
2308 :     http://download.eclipse.org/eclipse/downloads/drops/R-3.4.1-200809111700/eclipse-SDK-3.4.1-linux-gtk.tar.gz,
2309 : nickb 1.60 http://download.eclipse.org/eclipse/downloads/drops/R-3.4.2-200902111700/eclipse-platform-3.4.2-win32.zip,
2310 :     http://download.eclipse.org/eclipse/downloads/drops/R-3.4.2-200902111700/swt-3.4.2-win32-win32-x86.zip,
2311 : nickb 1.82 ---------,
2312 : nickb 1.23 http://www.eclipse.org/modeling/download.php?file=/modeling/emf/emf/downloads/drops/2.5.0/S200902031500/emf-xsd-SDK-2.5.0M5.zip,
2313 :     http://download.eclipse.org/modeling/emf/emf/downloads/drops/2.4.0/R200806091234/emf-sdo-xsd-Examples-2.4.0.zip,
2314 :     http://download.eclipse.org/modeling/emf/emf/downloads/drops/2.4.1/R200808251517/emf-runtime-2.4.1.zip,
2315 :     http://download.eclipse.org/modeling/emf/emf/downloads/drops/2.4.1/R200808251517/xsd-runtime-2.4.1.zip,
2316 : nickb 1.82 ---------,
2317 : nickb 1.23 http://download.eclipse.org/tools/gef/downloads/drops/3.4.1/R200809101400/GEF-runtime-3.4.1.zip,
2318 : nickb 1.82 ---------,
2319 : nickb 1.23 http://download.eclipse.org/modeling/mdt/uml2/downloads/drops/2.2.0/R200806091546/mdt-uml2-SDK-2.2.0.zip,
2320 :     http://download.eclipse.org/modeling/mdt/ocl/downloads/drops/1.2.0/R200806091714/mdt-ocl-SDK-1.2.0.zip,
2321 :     http://download.eclipse.org/modeling/emf/validation/downloads/drops/1.2.0/R200806091804/emf-validation-SDK-1.2.0.zip,
2322 : nickb 1.82 ---------,
2323 : nickb 1.23 http://download.eclipse.org/webtools/downloads/drops/R3.0/R-3.0.3-20081113203138/wtp-wst-R-3.0.3-20081113203138.zip,
2324 : nickb 1.82 http://download.eclipse.org/webtools/downloads/drops/R3.0/R-3.0.4-20090213193639/wtp-jst-R-3.0.4-20090213193639.zip,
2325 :     http://download.eclipse.org/webtools/downloads/drops/R3.0/R-3.0.4-20090213193639/wtp-jst-Automated-Tests-R-3.0.4-20090213193639.zip,
2326 :     ---------,
2327 : nickb 1.23 http://download.eclipse.org/technology/dltk/downloads/drops/R1.0/S-1.0M4-200812290249/dltk-rse-S-1.0M4-200812290249-incubation.zip,
2328 :     http://download.eclipse.org/technology/dltk/downloads/drops/R1.0/S-1.0M4-200812290249/dltk-core-S-1.0M4-200812290249-incubation.zip,
2329 : nickb 1.82 ---------,
2330 : nickb 1.23 http://download.eclipse.org/tools/orbit/downloads/drops/R20080611105805/orbitBundles-R20080611105805.map,
2331 : nickb 1.82 http://download.eclipse.org/tools/cdt/releases/ganymede/dist/cdt-master-5.0.0.zip,
2332 :     ---------,
2333 : nickb 1.23 http://download.eclipse.org/eclipse/downloads/drops/R-3.4-200806172000/eclipse-SDK-3.4.1-linux-gtk-ppc.tar.gz,
2334 : nickb 1.82 http://download.eclipse.org/tools/cdt/releases/ganymede/dist/cdt-master-5.0.0.zip,
2335 :     ---------,
2336 : nickb 1.23 http://download.eclipse.org/eclipse/downloads/drops/S-3.5M5-200902021535/eclipse-SDK-3.5M5-linux-gtk-ppc.tar.gz
2337 : nickb 1.82 http://download.eclipse.org/tools/cdt/builds/6.0.0/I.I200902031437/cdt-master-6.0.0-I200902031437.zip,
2338 :     http://download.eclipse.org/birt/downloads/drops/M-R1-2.5M5-200902101827/birt-report-framework-2.5M5.zip,
2339 :     http://download.eclipse.org/modeling/emf/emf/downloads/drops/2.5.0/S200902031500/emf-runtime-2.5.0M5.zip,
2340 : nickb 1.23 "
2341 :     />
2342 :     </then>
2343 :    
2344 :     <elseif>
2345 :     <not>
2346 :     <!-- commandline -->
2347 :     <isset property="dependencyURLs" />
2348 :     </not>
2349 :     <then>
2350 :     <!-- load defined values in project's build.properties -->
2351 :     <property file="${relengBuilderDir}/build.properties" />
2352 :     </then>
2353 :     </elseif>
2354 :     </if>
2355 :    
2356 :     <var name="numURLs" value="0" />
2357 : nickb 1.111 <property name="dependencyURLs" value="" />
2358 : nickb 1.23 <for param="URL" list="${dependencyURLs}" delimiter=", ">
2359 :     <!-- check each URL to determine what type of req it is, and collect variables -->
2360 :     <sequential>
2361 :     <if>
2362 : nickb 1.134 <istrue value="${localtest}" />
2363 : nickb 1.23 <then>
2364 : nickb 1.82 <echo>@{URL}</echo>
2365 : nickb 1.23 </then>
2366 :     </if>
2367 : nickb 1.82 <if>
2368 :     <not>
2369 :     <equals arg1="@{URL}" arg2="---------" />
2370 :     </not>
2371 :     <then>
2372 :    
2373 :     <!-- trim off everything before ?file=/ and hostname -->
2374 :     <propertyregex property="requirement.dropfile"
2375 :     defaultvalue="@{URL}"
2376 :     input="@{URL}"
2377 :     casesensitive="false"
2378 :     regexp="((.+\?file=/|.+\&amp;file=/|.+\&amp;amp;file=/|.+/pub/)|(.+://[^/]+/))(.+)"
2379 :     replace="\4"
2380 :     override="true"
2381 :     />
2382 :     <!-- remove downloads/drops/version/buildID & file suffix, -->
2383 :     <propertyregex property="requirement.type.tmp"
2384 :     defaultvalue="${requirement.dropfile}"
2385 :     input="${requirement.dropfile}"
2386 :     casesensitive="true"
2387 :     regexp="(.+)(/downloads/drops/.+/|/releases/.+/|/builds/.+/)([^/]+)"
2388 :     select="\1-\3"
2389 :     override="true"
2390 :     />
2391 : nickb 1.23
2392 : nickb 1.82 <!-- <echo>0 ${requirement.type.tmp}</echo> -->
2393 :     <!-- extra cleanup for WTP, DLTK, CDT -->
2394 :     <propertyregex property="requirement.type.tmp"
2395 :     defaultvalue="${requirement.type.tmp}"
2396 :     input="${requirement.type.tmp}"
2397 :     casesensitive="true"
2398 :     regexp="(.+)-([\d\.NIMSR-]+).+"
2399 :     select="\1"
2400 :     override="true"
2401 :     />
2402 :     <!-- <echo>1 ${requirement.type.tmp}</echo> -->
2403 : nickb 1.23 <if>
2404 : nickb 1.118 <or>
2405 :     <contains string="${requirement.type.tmp}" substring="-RCP" casesensitive="false" />
2406 :     <contains string="${requirement.type.tmp}" substring="-platform" casesensitive="false" />
2407 :     <contains string="${requirement.type.tmp}" substring="-SDK" casesensitive="false" />
2408 :     </or>
2409 : nickb 1.23 <then>
2410 : nickb 1.118 <var name="requirement.type.suffix" value=".base" />
2411 : nickb 1.23 </then>
2412 :     </if>
2413 : nickb 1.82
2414 :     <propertyregex property="requirement.type.tmp"
2415 :     defaultvalue="${requirement.type.tmp}"
2416 :     input="${requirement.type.tmp}"
2417 :     casesensitive="true"
2418 :     regexp="(.+)-([\d\.NIMSR-]+)"
2419 :     select="\1"
2420 :     override="true"
2421 :     />
2422 :     <!-- <echo>2 ${requirement.type.tmp}</echo> -->
2423 :     <propertyregex property="requirement.type.tmp"
2424 :     defaultvalue="${requirement.type.tmp}"
2425 :     input="${requirement.type.tmp}"
2426 :     casesensitive="true"
2427 :     regexp="(.+)-([\d\.NIMSR]+)"
2428 :     select="\1"
2429 :     override="true"
2430 :     />
2431 :     <!-- <echo>3 ${requirement.type.tmp}</echo> -->
2432 :     <!-- switch / and - to . -->
2433 :     <propertyregex property="requirement.type.tmp"
2434 :     defaultvalue="${requirement.type.tmp}"
2435 :     input="${requirement.type.tmp}"
2436 :     casesensitive="false"
2437 :     regexp="[/-]+"
2438 :     replace="\."
2439 :     override="true"
2440 :     />
2441 : nickb 1.102 <!-- <echo>4 ${requirement.type.tmp}</echo> -->
2442 : nickb 1.101 <!-- trim prefix "repos.repository.jboss.org.eclipse.galileo." -->
2443 : nickb 1.99 <propertyregex property="requirement.type.tmp"
2444 :     defaultvalue="${requirement.type.tmp}"
2445 :     input="${requirement.type.tmp}"
2446 :     casesensitive=""
2447 : nickb 1.114 regexp="(repos\.repository\.jboss\.org\.eclipse\.galileo|eclipse\.galileo)\.(.+)"
2448 :     replace="\2"
2449 : nickb 1.99 override="true"
2450 :     />
2451 : nickb 1.102 <!-- <echo>5 ${requirement.type.tmp}</echo> -->
2452 : nickb 1.82 <!-- trim prefix "eclipse." -->
2453 :     <propertyregex property="requirement.type.tmp"
2454 :     defaultvalue="${requirement.type.tmp}"
2455 :     input="${requirement.type.tmp}"
2456 :     casesensitive=""
2457 :     regexp="eclipse\.(.+)"
2458 :     replace="\1"
2459 :     override="true"
2460 :     />
2461 :     <!-- dedupe: eclipse.eclipse.SDK ==> eclipse.SDK; modeling.emf.emf.emf.xsd.SDK ==> modeling.emf.xsd.SDK -->
2462 :     <var name="requirement.type" value="" />
2463 :     <for param="bit" list="${requirement.type.tmp}" delimiter=".">
2464 :     <sequential>
2465 :     <if>
2466 :     <not>
2467 :     <contains string="${requirement.type}" substring="@{bit}" casesensitive="false" />
2468 :     </not>
2469 :     <then>
2470 :     <var name="requirement.type" value="${requirement.type}.@{bit}" />
2471 :     </then>
2472 :     </if>
2473 :     </sequential>
2474 :     </for>
2475 :     <!-- trim prefix "." -->
2476 : nickb 1.23 <propertyregex property="requirement.type"
2477 :     defaultvalue="${requirement.type}"
2478 :     input="${requirement.type}"
2479 :     casesensitive=""
2480 : nickb 1.82 regexp="\.(.+)"
2481 :     replace="\1"
2482 : nickb 1.23 override="true"
2483 :     />
2484 : nickb 1.82 <!-- add suffix -->
2485 :     <if>
2486 :     <isset property="requirement.type.suffix" />
2487 :     <then>
2488 :     <propertyregex property="requirement.type"
2489 :     defaultvalue="${requirement.type}"
2490 :     input="${requirement.type}"
2491 :     casesensitive=""
2492 :     regexp="(.+)"
2493 :     replace="\1${requirement.type.suffix}"
2494 :     override="true"
2495 :     />
2496 :     </then>
2497 :     </if>
2498 : nickb 1.23
2499 : nickb 1.82 <propertyregex property="requirement.file"
2500 :     defaultvalue="@{URL}"
2501 :     input="@{URL}"
2502 :     casesensitive=""
2503 :     regexp=".+/([^\/]+)"
2504 :     replace="\1"
2505 :     override="true"
2506 :     />
2507 :     <propertyregex property="requirement.dir"
2508 :     defaultvalue="@{URL}"
2509 :     input="@{URL}"
2510 :     casesensitive=""
2511 :     regexp=".+/([^\/]+)"
2512 :     replace="\1"
2513 :     override="true"
2514 :     />
2515 :     <propertyregex property="requirement.buildurl"
2516 :     defaultvalue="${requirement.dropfile}"
2517 :     input="${requirement.dropfile}"
2518 :     casesensitive=""
2519 :     regexp="(.+)/([^\/]+)"
2520 :     replace="\1"
2521 :     override="true"
2522 :     />
2523 : nickb 1.23
2524 : nickb 1.82 <!-- define list of dependency files for use with buildAllHelper.xml#packAllInOnes; csv list called ${required.dependency.files} -->
2525 :     <if>
2526 :     <not>
2527 :     <contains string="${required.dependency.files}" substring="${requirement.file}" casesensitive="true" />
2528 :     </not>
2529 :     <then>
2530 :     <var name="required.dependency.files" value="${required.dependency.files},${requirement.file}" />
2531 :     </then>
2532 :     </if>
2533 :     <if>
2534 :     <equals arg1="${debug}" arg2="true" />
2535 :     <then>
2536 :     <echo># ${requirement.type}</echo>
2537 :     </then>
2538 :     </if>
2539 : nickb 1.23
2540 : nickb 1.82 <echo file="${buildcfg}" append="true">
2541 : nickb 1.23 # ${requirement.type}
2542 :     ${requirement.type}.url=@{URL}
2543 :     ${requirement.type}.file=${requirement.file}
2544 :     ${requirement.type}.dropfile=/${requirement.dropfile}
2545 :     ${requirement.type}.buildurl=/${requirement.buildurl}
2546 :    
2547 :     </echo>
2548 : nickb 1.82 <if>
2549 :     <equals arg1="${downloadZipsIfNotFound}" arg2="true" />
2550 :     <then>
2551 :     <antcall target="getZip">
2552 :     <param name="downloadsDir" value="${downloadsDir}" />
2553 :     <param name="theFile" value="${requirement.file}" />
2554 :     <param name="theURL" value="@{URL}" />
2555 :     </antcall>
2556 :     </then>
2557 :     </if>
2558 :     <var name="requirement.type.suffix" unset="true" />
2559 :    
2560 :     <math result="numURLs" operand1="${numURLs}" operation="+" operand2="1" datatype="int" />
2561 : nickb 1.23 </then>
2562 :     </if>
2563 :     </sequential>
2564 :     </for>
2565 :    
2566 :     <!-- define list of dependency files for use with buildAllHelper.xml#packAllInOnes; csv list called ${required.dependency.files} -->
2567 :     <!-- trim prefix "," -->
2568 :     <propertyregex property="required.dependency.files"
2569 :     defaultvalue="${required.dependency.files}"
2570 :     input="${required.dependency.files}"
2571 :     regexp=",(.+)"
2572 :     replace="\1"
2573 :     override="true"
2574 :     />
2575 :     <echo file="${buildcfg}" append="true">
2576 :     #csv list of ${numURLs} required dependency files: see buildAllHelper.xml#packAllInOnes
2577 :     required.dependency.files=${required.dependency.files}
2578 :     </echo>
2579 :    
2580 :     <!-- for debugging use only -->
2581 :     <if>
2582 :     <equals arg1="${debug}" arg2="true" />
2583 :     <then>
2584 :     <exec executable="cat">
2585 :     <arg line="${buildcfg}" />
2586 :     </exec>
2587 :     </then>
2588 :     </if>
2589 :    
2590 :     </target>
2591 :    
2592 : nickb 1.107 <!-- scan through the map files and decide what type of maps will be used by the build -->
2593 :     <target name="collectMapTypes">
2594 :     <if>
2595 :     <isset property="localSourceCheckoutDir" />
2596 :     <then>
2597 :     <property name="mapTypes" value="local" />
2598 :     </then>
2599 :     <else>
2600 :     <var name="mapTypes" value="" />
2601 :     <for param="file">
2602 :     <path>
2603 :     <fileset dir="${relengBuilderDir}/maps" includes="*.map" />
2604 :     </path>
2605 :     <sequential>
2606 :     <var name="map.file" unset="true" />
2607 :     <loadfile property="map.file" srcfile="@{file}" />
2608 :     <if>
2609 :     <contains string="${map.file}" substring="=SVN," casesensitive="false" />
2610 :     <then>
2611 :     <if>
2612 :     <not>
2613 :     <contains string="${mapTypes}" substring="SVN" />
2614 :     </not>
2615 :     <then>
2616 :     <var name="mapTypes" value="${mapTypes},SVN" />
2617 :     </then>
2618 :     </if>
2619 :     </then>
2620 :     </if>
2621 :     <if>
2622 :     <contains string="${map.file}" substring="=GET," />
2623 :     <then>
2624 :     <if>
2625 :     <not>
2626 :     <contains string="${mapTypes}" substring="GET" />
2627 :     </not>
2628 :     <then>
2629 :     <var name="mapTypes" value="${mapTypes},GET" />
2630 :     </then>
2631 :     </if>
2632 :     </then>
2633 :     </if>
2634 :     <if>
2635 :     <contains string="${map.file}" substring="cvs" />
2636 :     <then>
2637 :     <if>
2638 :     <not>
2639 :     <contains string="${mapTypes}" substring="CVS" />
2640 :     </not>
2641 :     <then>
2642 :     <var name="mapTypes" value="${mapTypes},CVS" />
2643 :     </then>
2644 :     </if>
2645 :     </then>
2646 :    
2647 :     </if>
2648 :     <var name="map.file" unset="true" />
2649 :     </sequential>
2650 :     </for>
2651 : nickb 1.108
2652 : nickb 1.107 <!-- trim prefix "," -->
2653 : nickb 1.108 <propertyregex property="mapTypes" defaultvalue="${mapTypes}" input="${mapTypes}" regexp=",(.+)" replace="\1" override="true" />
2654 : nickb 1.107 </else>
2655 :     </if>
2656 : nickb 1.108
2657 : nickb 1.107 <echo file="${buildcfg}" append="true">
2658 :    
2659 :     # map types used in this build (CVS, SVN, GET, local)
2660 :     mapTypes=${mapTypes}</echo>
2661 :     </target>
2662 :    
2663 : nickb 1.150 <!-- see ../../tests/buildAllHelper.tests.xml#test.projectid2names -->
2664 : nickb 1.23 <target name="projectid2names" description="Calculate *projectName variables from projectid">
2665 :     <propertyregex property="topprojectName"
2666 : nickb 1.150 defaultvalue="${projectid}"
2667 : nickb 1.23 input="${projectid}"
2668 :     casesensitive=""
2669 :     regexp="([^\.]+)\..+"
2670 :     replace="\1"
2671 :     override="true"
2672 :     />
2673 :     <propertyregex property="subprojectName"
2674 : nickb 1.150 defaultvalue="${projectid}"
2675 : nickb 1.23 input="${projectid}"
2676 :     casesensitive=""
2677 :     regexp=".+\.([^\.]+)"
2678 :     replace="\1"
2679 :     override="true"
2680 :     />
2681 :     <!-- projectName is either the middle piece if this regex matches, or ${subprojectName} if it doesn't -->
2682 :     <propertyregex property="projectName"
2683 : nickb 1.150 defaultvalue="NULL"
2684 : nickb 1.23 input="${projectid}"
2685 :     casesensitive=""
2686 : nickb 1.150 regexp=".+\.([^\.]+\.[^\.]+)\..+"
2687 : nickb 1.23 replace="\1"
2688 :     override="true"
2689 :     />
2690 : nickb 1.150 <if>
2691 :     <equals arg1="${projectName}" arg2="NULL" />
2692 :     <then>
2693 :     <propertyregex property="projectName"
2694 :     defaultvalue="${subprojectName}"
2695 :     input="${projectid}"
2696 :     casesensitive=""
2697 :     regexp=".+\.([^\.]+)\..+"
2698 :     replace="\1"
2699 :     override="true"
2700 :     />
2701 :     </then>
2702 :     </if>
2703 : nickb 1.23 </target>
2704 :    
2705 :     <target name="getZip">
2706 :     <if>
2707 :     <not>
2708 :     <available file="${downloadsDir}/${theFile}" />
2709 :     </not>
2710 :     <then>
2711 : nickb 1.30 <mkdir dir="${downloadsDir}" />
2712 : nickb 1.23 <get src="${theURL}" dest="${downloadsDir}/${theFile}" usetimestamp="true" />
2713 :     </then>
2714 :     </if>
2715 :     <touch file="${downloadsDir}/${theFile}" />
2716 :     </target>
2717 :    
2718 : nickb 1.89 <!-- TODO: support projectSetFiles = a dir, a file, or a CSV list of files -->
2719 :     <target name="fetchFromProjectSetFiles">
2720 :    
2721 :     <echo>projectSetFiles = ${projectSetFiles}</echo>
2722 :     <for param="psfEntry" delimiter=", " list="${projectSetFiles}">
2723 :     <sequential>
2724 :     <if>
2725 :     <available file="@{psfEntry}" type="file" />
2726 :     <then>
2727 :     <!-- load .psf into ${buildDirectory}/plugins/ and ${buildDirectory/features/ -->
2728 :     <echo>load @{psfEntry}</echo>
2729 :    
2730 :     <mkdir dir="${buildDir}/psf-checkout" />
2731 :     <!-- determine if file is cvs or svn -->
2732 : nickb 1.91
2733 : nickb 1.89 <!-- do checkout using latest ant4eclipse -->
2734 :     <!--
2735 :     <cvsGetProjectSet cvsreallyquiet="true"
2736 :     cvsUser="anonymous" cvsPwd=""
2737 :     command="checkout"
2738 :     projectSet="@{psfEntry}" workspace="${buildDir}/psf-checkout" />
2739 :     <svnGetProjectSet command="checkout" workspace="${buildDir}/psf-checkout"
2740 :     projectset="@{psfEntry}" />
2741 :     -->
2742 : nickb 1.91
2743 : nickb 1.89 <!-- set localsourcecheckoutdir = ${buildDir}/psf-checkout, and do -->
2744 :     </then>
2745 :     <elseif>
2746 :     <available file="@{psfEntry}" type="dir" />
2747 :     <then>
2748 :     <!-- load all .psfs in dir into ${buildDirectory}/plugins/ and ${buildDirectory/features/ -->
2749 : nickb 1.91 <echo>load all .psfs in dir @{psfEntry}</echo>
2750 : nickb 1.89 </then>
2751 :     </elseif>
2752 :     </if>
2753 :     </sequential>
2754 :     </for>
2755 :    
2756 :    
2757 :     <fail />
2758 :     </target>
2759 :    
2760 : nickb 1.133 <target name="fetchEclipseTestFrameworkSources">
2761 :     <!-- get missing o.e.test and o.e.a.o.junit if missing -->
2762 :     <for param="bundle" list="plugin@org.eclipse.test,fragment@org.eclipse.ant.optional.junit" keepgoing="true">
2763 :     <sequential>
2764 :     <propertyregex property="bundleName" input="@{bundle}" regexp="([^@]+)@([^@]+)" select="\2" casesensitive="false" override="true" />
2765 :     <if>
2766 :     <not>
2767 :     <available file="${buildDir}/eclipse/plugins/${bundleName}" type="dir" />
2768 :     </not>
2769 :     <then>
2770 :     <!-- fetch two test plugins from cvs via psf file -->
2771 :     <mkdir dir="${localSourceCheckoutDir}/test-temp" />
2772 : nickb 1.151 <if>
2773 :     <available file="${relengCommonBuilderDir}/psfs/test.cvs.psf" type="file" />
2774 :     <then>
2775 :     <cvsGetProjectSet cvsUser="anonymous"
2776 :     CvsPwd=""
2777 :     command="checkout"
2778 :     projectSet="${relengCommonBuilderDir}/psfs/test.cvs.psf"
2779 :     workspace="${localSourceCheckoutDir}/test-temp"
2780 :     />
2781 :     </then>
2782 :     <elseif>
2783 :     <!-- deprecated path -->
2784 :     <available file="${relengCommonBuilderDir}/psf/test.psf" type="file" />
2785 :     <then>
2786 :     <cvsGetProjectSet cvsUser="anonymous"
2787 :     CvsPwd=""
2788 :     command="checkout"
2789 :     projectSet="${relengCommonBuilderDir}/psf/test.psf"
2790 :     workspace="${localSourceCheckoutDir}/test-temp"
2791 :     />
2792 :     </then>
2793 :     </elseif>
2794 :     <else>
2795 :     <fail>Error!
2796 :     Cannot find
2797 :     ${buildDir}/eclipse/plugins/${bundleName}
2798 :     Cannot be check out ${bundleName} from psf file in
2799 :     ${relengCommonBuilderDir}
2800 :     Build cannot continue.
2801 :    
2802 :     Please check out
2803 :     ${bundleName}
2804 :     into
2805 :     ${localSourceCheckoutDir}/test
2806 :     or
2807 :     ${localSourceCheckoutDir}/tests
2808 :     to continue.
2809 :     </fail>
2810 :     </else>
2811 :     </if>
2812 : nickb 1.133
2813 :     <!-- copy plugins to where they're needed for the build -->
2814 :     <copy todir="${buildDir}/eclipse/plugins">
2815 :     <fileset dir="${localSourceCheckoutDir}/test-temp" />
2816 :     </copy>
2817 :    
2818 :     <!-- cache them for next time -->
2819 :     <mkdir dir="${localSourceCheckoutDir}/test" />
2820 :     <copy todir="${localSourceCheckoutDir}/test">
2821 :     <fileset dir="${localSourceCheckoutDir}/test-temp" />
2822 :     </copy>
2823 :    
2824 :     <!-- cleanup -->
2825 :     <delete dir="${localSourceCheckoutDir}/test-temp" includeemptydirs="true" quiet="true" />
2826 :     </then>
2827 :     </if>
2828 :     <var name="bundleName" unset="true" />
2829 :     </sequential>
2830 :     </for>
2831 :    
2832 :     <!-- check again; this time fail if not found -->
2833 :     <for param="bundle" list="plugin@org.eclipse.test,fragment@org.eclipse.ant.optional.junit" keepgoing="false">
2834 :     <sequential>
2835 :     <propertyregex property="bundleName" input="@{bundle}" regexp="([^@]+)@([^@]+)" select="\2" casesensitive="false" override="true" />
2836 :     <if>
2837 :     <not>
2838 :     <available file="${buildDir}/eclipse/plugins/${bundleName}" type="dir" />
2839 :     </not>
2840 :     <then>
2841 :     <echo message="ERROR! Can't find @{bundle} in ${buildDir}/eclipse/plugins/${bundleName}. Make sure your locally cached sources include this bundle."
2842 :     />
2843 :     </then>
2844 :     </if>
2845 :     <var name="bundleName" unset="true" />
2846 :     </sequential>
2847 :     </for>
2848 :     </target>
2849 :    
2850 : nickb 1.84 <!-- from a vcs raw dump, create a zip collecting everything into features/ and plugins/ so PDE can build it -->
2851 :     <target name="convertRawCheckoutToFeaturesAndPluginsDirs" depends="init">
2852 :     <property name="localSourceCheckoutDir" value="/home/nboldt/eclipse/workspace-jboss/org.eclipse.linuxtools.tree" />
2853 :    
2854 :     <!-- could be set to ${buildDirectory} if copying sources into a build-in-progress -->
2855 :     <property name="targetDir" value="${localSourceCheckoutDir}/ztmpDir" />
2856 :    
2857 :     <!-- set to false to include .svn folders and other metadata -->
2858 : nickb 1.88 <property name="defaultExcludes" value="true" />
2859 : nickb 1.84
2860 :     <mkdir dir="${targetDir}/features" />
2861 :     <mkdir dir="${targetDir}/plugins" />
2862 :     <for param="dir">
2863 :     <path>
2864 :     <!-- Use "localSourceCheckoutDirExcludes" in build.properties to define what to suppress from the VCS dump; eg., "/archive/" should be ignored in gef.tree -->
2865 : nickb 1.88 <dirset dir="${localSourceCheckoutDir}"
2866 :     includes="**/**, **/**/**, **/**/**/**"
2867 :     excludes="ztmpDir, ${localSourceCheckoutDirExcludes}"
2868 :     />
2869 : nickb 1.84 </path>
2870 :     <sequential>
2871 :     <if>
2872 : nickb 1.96 <not>
2873 :     <or>
2874 :     <!-- exclude paths which might be in the workspace which are NOT relevant here -->
2875 :     <contains string="@{dir}" substring=".metadata" />
2876 :     <contains string="@{dir}" substring="org.eclipse.releng.basebuilder" />
2877 :     <contains string="@{dir}" substring="org.eclipse.dash.common.releng" />
2878 :     </or>
2879 :     </not>
2880 : nickb 1.84 <then>
2881 : nickb 1.96 <var name="dir.flat" unset="true" />
2882 :     <!-- flatten path to get just the dir -->
2883 :     <basename property="dir.flat" file="@{dir}" />
2884 :     <!-- trim the "-feature" dir suffix off since we assume the featureid does not include it -->
2885 :     <propertyregex property="dir.flat"
2886 :     defaultvalue="${dir.flat}"
2887 :     input="${dir.flat}"
2888 :     regexp="([^/\\]+)-feature"
2889 :     replace="\1"
2890 :     override="true"
2891 :     />
2892 :     <if>
2893 :     <available file="@{dir}/feature.xml" type="file" />
2894 :     <then>
2895 :     <!-- <echo>Feature :: ${dir.flat} :: @{dir}</echo> -->
2896 :     <mkdir dir="${targetDir}/features/${dir.flat}" />
2897 :     <copy todir="${targetDir}/features/${dir.flat}">
2898 :     <fileset dir="@{dir}" includes="**" defaultexcludes="${defaultExcludes}" />
2899 :     </copy>
2900 :     </then>
2901 :     <elseif>
2902 :     <or>
2903 :     <available file="@{dir}/META-INF/MANIFEST.MF" type="file" />
2904 :     <available file="@{dir}/plugin.xml" type="file" />
2905 :     <available file="@{dir}/fragment.xml" type="file" />
2906 :     </or>
2907 :     <then>
2908 :     <!-- <echo>Plugin :: ${dir.flat} :: @{dir}</echo> -->
2909 :     <mkdir dir="${targetDir}/plugins/${dir.flat}" />
2910 :     <copy todir="${targetDir}/plugins/${dir.flat}">
2911 :     <fileset dir="@{dir}" includes="**" defaultexcludes="${defaultExcludes}" />
2912 :     </copy>
2913 :     </then>
2914 :     </elseif>
2915 :     <elseif>
2916 :     <or>
2917 :     <contains string="${dir.flat}" substring=".releng" />
2918 :     <contains string="${dir.flat}" substring=".updatesite" />
2919 :     <contains string="${dir.flat}" substring=".update-site" />
2920 :     <contains string="${dir.flat}" substring=".updates" />
2921 :     </or>
2922 :     <then>
2923 :     <!-- <echo>Releng :: ${targetDir} :: ${dir.flat} :: @{dir}</echo> -->
2924 :     <mkdir dir="${targetDir}/releng/${dir.flat}" />
2925 :     <copy todir="${targetDir}/releng/${dir.flat}">
2926 :     <fileset dir="@{dir}" includes="**" defaultexcludes="${defaultExcludes}" />
2927 :     </copy>
2928 :     </then>
2929 :     </elseif>
2930 :     </if>
2931 :     <var name="dir.flat" unset="true" />
2932 : nickb 1.84 </then>
2933 :     </if>
2934 :     </sequential>
2935 :     </for>
2936 :     </target>
2937 :    
2938 : nickb 1.63 <target name="collectMaps">
2939 :     <!-- [256201] merge mapfiles to root & rename -->
2940 :     <if>
2941 :     <available file="${buildDir}/directory.txt" type="file" />
2942 :     <then>
2943 :     <delete file="${buildDir}/directory.txt" />
2944 :     </then>
2945 :     </if>
2946 : nickb 1.135 <if>
2947 :     <available file="${relengBuilderDir}/maps" type="dir" />
2948 :     <then>
2949 :     <for param="file">
2950 :     <path>
2951 :     <fileset dir="${relengBuilderDir}/maps" includes="*.map" />
2952 :     </path>
2953 :     <sequential>
2954 :     <loadfile property="map.file" srcfile="@{file}" />
2955 :     <echo file="${buildDir}/directory.txt" append="true">
2956 : nickb 1.63 !*** @{file}
2957 :     ${map.file}
2958 :    
2959 :     </echo>
2960 : nickb 1.135 <var name="map.file" unset="true" />
2961 :     </sequential>
2962 :     </for>
2963 :     </then>
2964 :     <else>
2965 :     <echo file="${buildDir}/directory.txt" append="true">
2966 :     !*** No maps found in ${relengBuilderDir}/maps
2967 :     !*** Build from local sources in ${localSourceCheckoutDir}
2968 : nickb 1.66
2969 : nickb 1.135 </echo>
2970 :     </else>
2971 :     </if>
2972 : nickb 1.137
2973 : nickb 1.65 <!-- verify that if we're using SVN sources we have SVN support in basebuilder -->
2974 :     <loadfile property="directory.txt.contents" srcFile="${buildDir}/directory.txt" />
2975 :     <if>
2976 :     <and>
2977 :     <contains string="${directory.txt.contents}" substring="=SVN,,http" />
2978 :     <not>
2979 :     <available file="${relengBaseBuilderDir}/plugins/org.eclipse.pde.build.svn_1.0.1.v20070222.jar" type="file" />
2980 :     </not>
2981 :     </and>
2982 :     <then>
2983 :     <fail>Error!
2984 :     Map file(s) require SVN checkout support in PDE, but could not find
2985 :     ${relengBaseBuilderDir}/
2986 :     plugins/org.eclipse.pde.build.svn_1.0.1.v20070222.jar.
2987 :    
2988 :     You will need to manually add this jar if it cannot be done
2989 :     automatically via the build due to permission problems or other
2990 :     restrictions.
2991 :     </fail>
2992 :     </then>
2993 :     </if>
2994 : nickb 1.63 </target>
2995 :    
2996 : nickb 1.106 <!-- convert an svn directory tree into map format -->
2997 :     <target name="dir2svnmap">
2998 :     <property name="dir2map.reporoot" value="http://anonsvn.jboss.org/repos" />
2999 :     <property name="dir2map.repopath" value="jbosstools/trunk/foo" />
3000 :     <property name="dir2map.dir" value="/home/nboldt/eclipse/workspace-jboss/jbosstools-trunk/foo" />
3001 :     <property name="dir2map.map" value="/home/nboldt/eclipse/workspace-jboss/jbosstools-trunk/foo/releng/maps/project.map" />
3002 :     <property name="dir2map.exclude" value="**/releng/**, **/.svn/**, **/CVS/**" />
3003 :     <delete file="${dir2map.map}" quiet="true" />
3004 :     <echo file="${dir2map.map}">!*** Generated with org.eclipse.dash.common.releng/tools/scripts/buildAllHelper.xml#dir2svnmap task
3005 :     </echo>
3006 :     <for param="dir">
3007 :     <path>
3008 :     <dirset dir="${dir2map.dir}" excludes="${dir2map.exclude}">
3009 :     </dirset>
3010 :     </path>
3011 :     <sequential>
3012 :     <if>
3013 :     <not>
3014 :     <or>
3015 :     <!-- exclude paths which might be in the workspace which are NOT relevant here -->
3016 :     <contains string="@{dir}" substring=".metadata" />
3017 :     <contains string="@{dir}" substring="org.eclipse.releng.basebuilder" />
3018 :     <contains string="@{dir}" substring="org.eclipse.dash.common.releng" />
3019 :     </or>
3020 :     </not>
3021 :     <then>
3022 :     <var name="dir.flat" unset="true" />
3023 :     <var name="dir.svn" unset="true" />
3024 :     <!-- flatten path to get just the dir -->
3025 :     <basename property="dir.flat" file="@{dir}" />
3026 :     <!-- trim the "-feature" dir suffix off since we assume the featureid does not include it -->
3027 :     <propertyregex property="dir.flat"
3028 :     defaultvalue="${dir.flat}"
3029 :     input="${dir.flat}"
3030 :     regexp="([^/\\]+)-feature"
3031 :     replace="\1"
3032 :     override="true"
3033 :     />
3034 :    
3035 :     <!-- trim off the base dir to get just the path -->
3036 :     <pathconvert property="dir.svn">
3037 :     <path path="@{dir}" />
3038 :     <chainedmapper>
3039 :     <regexpmapper from="${dir2map.dir}/(.*)" to="\1" handledirsep="yes" />
3040 :     </chainedmapper>
3041 :     </pathconvert>
3042 :     <if>
3043 :     <available file="@{dir}/feature.xml" type="file" />
3044 :     <then>
3045 :     <!-- feature@org.jboss.tools.jmx.sdk.feature=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/features/org.jboss.tools.jmx.sdk.feature -->
3046 :     <echo append="true" file="${dir2map.map}">feature@${dir.flat}=SVN,,${dir2map.reporoot},,${dir2map.repopath}/${dir.svn}
3047 :     </echo>
3048 :     </then>
3049 :     <elseif>
3050 :     <or>
3051 :     <available file="@{dir}/META-INF/MANIFEST.MF" type="file" />
3052 :     <available file="@{dir}/plugin.xml" type="file" />
3053 :     <available file="@{dir}/fragment.xml" type="file" />
3054 :     </or>
3055 :     <then>
3056 :     <!-- plugin@org.jboss.tools.jmx.core=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/plugins/org.jboss.tools.jmx.core -->
3057 :     <echo append="true" file="${dir2map.map}">plugin@${dir.flat}=SVN,,${dir2map.reporoot},,${dir2map.repopath}/${dir.svn}
3058 :     </echo>
3059 :     </then>
3060 :     </elseif>
3061 :     </if>
3062 :     <var name="dir.flat" unset="true" />
3063 :     <var name="dir.svn" unset="true" />
3064 :     </then>
3065 :     </if>
3066 :     </sequential>
3067 :     </for>
3068 :     </target>
3069 :    
3070 : nickb 1.91 <!-- [278687] Supported target .psf file formats are:
3071 :     CVS, SVN-Subclipse, SVN-Subversive.
3072 :     Because Subclipse and Subversive formats are not the same, we need to produce
3073 :     TWO .psfs from each .map file.
3074 :    
3075 :     Maps with a mix of CVS and SVN will result in three .psfs (2 for the SVN entries, 1 for CVS);
3076 :     CVS .psf will have SVN entries commented out, SVN .psfs will have CVS entries commented out.
3077 :    
3078 :     Possible future considerations include
3079 :     HTTP map files (eg., Orbit jars)
3080 :     Git map files (?)
3081 :     -->
3082 :     <target name="map2psf" description="generate psfs/*.psf from every map file in maps/*.map">
3083 :     <if>
3084 :     <available file="${relengBuilderDir}/maps" type="dir" />
3085 :     <then>
3086 :     <mkdir dir="${relengBuilderDir}/psfs" />
3087 :    
3088 :     <!-- Process mapfiles for CVS content -->
3089 :     <for param="mapfile">
3090 :     <path>
3091 :     <fileset dir="${relengBuilderDir}/maps" includes="*.map">
3092 :     <contains text="CVS" casesensitive="false" />
3093 :     </fileset>
3094 :     </path>
3095 :     <sequential>
3096 :     <propertyregex property="psfdir"
3097 :     input="@{mapfile}"
3098 :     defaultvalue="@{mapfile}"
3099 :     regexp="/maps/.+"
3100 :     replace="/psfs/"
3101 :     override="true"
3102 :     />
3103 :     <propertyregex property="psffileprefix"
3104 :     input="@{mapfile}"
3105 :     defaultvalue="@{mapfile}"
3106 :     regexp=".+/maps/(.+).map"
3107 :     replace="\1"
3108 :     override="true"
3109 :     />
3110 :    
3111 :     <!-- create psf in cvs format -->
3112 :     <delete dir="${psfdir}" includes="${psffileprefix}.cvs.psf" />
3113 :     <var name="psffile" value="${psfdir}/${psffileprefix}.cvs.psf" />
3114 :     <concat destfile="${psffile}">
3115 :     <header filtering="no">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
3116 :     &lt;psf version="2.0"&gt;
3117 :     &lt;provider id="org.eclipse.team.cvs.core.cvsnature"&gt;
3118 : nickb 1.94
3119 : nickb 1.91 </header>
3120 :     <path path="@{mapfile}" />
3121 : nickb 1.94 <footer>
3122 :     &lt;/provider&gt;
3123 : nickb 1.91 &lt;/psf&gt;
3124 :     </footer>
3125 :     </concat>
3126 :     <!--
3127 :     FROM:
3128 :     \1 \2 \3 \4 \5 \6
3129 :     plugin@org.eclipse.gef=v20090306-1147,:pserver:anonymous@dev.eclipse.org:/cvsroot/tools,,org.eclipse.gef/plugins/org.eclipse.gef
3130 :     feature@org.eclipse.draw2d=v20090316-1158,:pserver:anonymous@dev.eclipse.org:/cvsroot/tools,,org.eclipse.gef/features/org.eclipse.draw2d-feature
3131 :     \1 \2 \3 \4
3132 :     plugin@org.eclipse.test=v20080313,:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse,
3133 :     fragment@org.eclipse.ant.optional.junit=v20070202,:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse,
3134 :     TO:
3135 :     <project reference="1.0,ROOT,PATH,MODULENAME,BRANCHorTAG"/>
3136 :     <project reference="1.0,:pserver:anonymous@dev.eclipse.org:/cvsroot/tools,path/to/org.eclipse.gef,org.eclipse.gef,v20090316"/>
3137 :     <project reference="1.0,:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse,org.eclipse.test"/>
3138 :     -->
3139 :     <replaceregexp file="${psffile}"
3140 :     match="(.+)@(.+)=([^,]+),([^,]+),([^,]*),([^,]+)"
3141 :     replace=" &lt;project reference=&quot;1.0,\4,\6,\2,\3&quot;/&gt;"
3142 :     flags="g"
3143 :     byline="true"
3144 :     />
3145 :     <replaceregexp file="${psffile}"
3146 :     match="(.+)@(.+)=([^,]+),([^,]+).*"
3147 :     replace=" &lt;project reference=&quot;1.0,\4,\2,\2,\3&quot;/&gt;"
3148 :     flags="g"
3149 :     byline="true"
3150 :     />
3151 :     <replaceregexp file="${psffile}" match="(\!\*|\#)(.+)" replace=" &lt;!-- \1\2 --&gt;" flags="g" byline="true" />
3152 :     <replaceregexp file="${psffile}" match="(.+)(=SVN,)(.+)" replace=" &lt;!-- \1\2\3 --&gt;" flags="g" byline="true" />
3153 : nickb 1.96 <replaceregexp file="${psffile}" match="///" replace="/" flags="g" />
3154 : nickb 1.95
3155 : nickb 1.91 <var name="psffile" unset="true" />
3156 :     <var name="psffileprefix" unset="true" />
3157 :     <var name="psfdir" unset="true" />
3158 :     </sequential>
3159 :     </for>
3160 :    
3161 :     <!-- Process mapfiles for SVN content -->
3162 :     <for param="mapfile">
3163 :     <path>
3164 :     <fileset dir="${relengBuilderDir}/maps" includes="*.map">
3165 :     <contains text="SVN" casesensitive="false" />
3166 :     </fileset>
3167 :     </path>
3168 :     <sequential>
3169 :     <propertyregex property="psfdir"
3170 :     input="@{mapfile}"
3171 :     defaultvalue="@{mapfile}"
3172 :     regexp="/maps/.+"
3173 :     replace="/psfs/"
3174 :     override="true"
3175 :     />
3176 :     <propertyregex property="psffileprefix"
3177 :     input="@{mapfile}"
3178 :     defaultvalue="@{mapfile}"
3179 :     regexp=".+/maps/(.+).map"
3180 :     replace="\1"
3181 :     override="true"
3182 :     />
3183 :    
3184 :     <!-- create psf in subversive format -->
3185 :     <delete dir="${psfdir}" includes="${psffileprefix}.subversive.psf" />
3186 :     <var name="psffile" value="${psfdir}/${psffileprefix}.subversive.psf" />
3187 :     <concat destfile="${psffile}">
3188 :     <header filtering="no">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
3189 :     &lt;psf version="2.0"&gt;
3190 :     &lt;provider id="org.eclipse.team.svn.core.svnnature"&gt;
3191 : nickb 1.94
3192 : nickb 1.91 </header>
3193 :     <path path="@{mapfile}" />
3194 : nickb 1.94 <footer>
3195 :     &lt;/provider&gt;
3196 : nickb 1.91 &lt;/psf&gt;
3197 :     </footer>
3198 :     </concat>
3199 :     <!--
3200 :     FROM:
3201 :     \1 \2 \3 \4 \5 \6
3202 :     feature@org.eclipse.vtp.feature.all=SVN,trunk,http://dev.eclipse.org/svnroot/technology/org.eclipse.vtp,Releng,org.eclipse.vtp.feature.all
3203 :     feature@org.jboss.tools.jmx.sdk.feature=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/features/org.jboss.tools.jmx.sdk.feature
3204 :     plugin@org.jboss.tools.jmx.core=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/plugins/org.jboss.tools.jmx.core
3205 : nickb 1.94 plugin@org.jboss.ide.eclipse.freemarker=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker
3206 : nickb 1.91
3207 :     \1 \2 \3 \4 \5 \6
3208 :     plugin@org.eclipse.linuxtools.changelog.doc=SVN,,http://dev.eclipse.org/svnroot/technology,,org.eclipse.linuxtools/changelog/trunk/org.eclipse.linuxtools.changelog.doc
3209 :     fragment@org.eclipse.linuxtools.changelog.parsers.java=SVN,,http://dev.eclipse.org/svnroot/technology,,org.eclipse.linuxtools/changelog/trunk/org.eclipse.linuxtools.changelog.javaparser
3210 :     feature@org.eclipse.linuxtools.changelog=SVN,,http://dev.eclipse.org/svnroot/technology,,org.eclipse.linuxtools/changelog/trunk/org.eclipse.linuxtools.changelog-feature
3211 :     TO (line breaks added for clarity; should be a single line of XML):
3212 :     <project reference="1.0.1,https://dev.eclipse.org/svnroot/technology/org.eclipse.vtp/Releng/trunk/org.eclipse.vtp.releng,org.eclipse.vtp.releng,
3213 :     0005dcf07f32001e162a94aa39f2ce50;
3214 :     https://dev.eclipse.org/svnroot/technology/org.eclipse.vtp/Releng/trunk/org.eclipse.vtp.releng;
3215 :     https://dev.eclipse.org/svnroot/technology/org.eclipse.vtp/Releng/trunk/org.eclipse.vtp.releng;
3216 :     branches;tags;trunk;true;ee007c2a-0a25-0410-9ab9-bf268980928c;
3217 :     https://dev.eclipse.org/svnroot/technology/org.eclipse.vtp;;false;;;22"/>
3218 : nickb 1.94 - or -
3219 :     <project reference="1.0.1,https://dev.eclipse.org/svnroot/technology/org.eclipse.vtp/Releng/trunk/org.eclipse.vtp.releng,org.eclipse.vtp.releng"/>
3220 : nickb 1.91 -->
3221 :     <!-- insanely verbose format -->
3222 :     <!-- <replaceregexp file="${psffile}"
3223 :     match="(.+)@(.+)=SVN,([^,]*),([^,]+),([^,]*),([^,]+)"
3224 :     replace=" &lt;project reference=&quot;1.0.1,\4/\5/\3/\6,\2,000;\4/\5/\3/\6;\4/\5/\3/\6;branches;tags;trunk;true;000;\4;;false;;;000&quot;/&gt;"
3225 :     flags="g"
3226 :     byline="true"
3227 :     /> -->
3228 :     <!-- simple format -->
3229 :     <replaceregexp file="${psffile}"
3230 : nickb 1.94 match="(.+)@(.+)=SVN,([^,]+),([^,]+),([^,]+),([^,]+)"
3231 : nickb 1.91 replace=" &lt;project reference=&quot;1.0.1,\4/\5/\3/\6,\2&quot;/&gt;"
3232 :     flags="g"
3233 :     byline="true"
3234 :     />
3235 : nickb 1.94 <replaceregexp file="${psffile}"
3236 :     match="(.+)@(.+)=SVN,,([^,]+),,([^,]+)"
3237 :     replace=" &lt;project reference=&quot;1.0.1,\3/\4,\2&quot;/&gt;"
3238 :     flags="g"
3239 :     byline="true"
3240 :     />
3241 : nickb 1.91 <replaceregexp file="${psffile}" match="(\!\*|\#)(.+)" replace=" &lt;!-- \1\2 --&gt;" flags="g" byline="true" />
3242 :     <replaceregexp file="${psffile}" match="(.+)(/cvs)(.+)" replace=" &lt;!-- \1\2\3 --&gt;" flags="g" byline="true" />
3243 : nickb 1.96 <replaceregexp file="${psffile}" match="///" replace="/" flags="g" />
3244 : nickb 1.91
3245 :     <!-- create psf in subclipse format -->
3246 :     <delete dir="${psfdir}" includes="${psffileprefix}.subclipse.psf" />
3247 :     <var name="psffile" value="${psfdir}/${psffileprefix}.subclipse.psf" />
3248 :     <concat destfile="${psffile}">
3249 :     <header filtering="no">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
3250 :     &lt;psf version="2.0"&gt;
3251 :     &lt;provider id="org.tigris.subversion.subclipse.core.svnnature"&gt;
3252 : nickb 1.94
3253 : nickb 1.91 </header>
3254 :     <path path="@{mapfile}" />
3255 : nickb 1.94 <footer>
3256 :     &lt;/provider&gt;
3257 : nickb 1.91 &lt;/psf&gt;
3258 :     </footer>
3259 :     </concat>
3260 :     <!--
3261 :     FROM:
3262 :     feature@org.eclipse.vtp.feature.all=SVN,trunk,http://dev.eclipse.org/svnroot/technology/org.eclipse.vtp,Releng,org.eclipse.vtp.feature.all
3263 :     feature@org.jboss.tools.jmx.sdk.feature=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/features/org.jboss.tools.jmx.sdk.feature
3264 :     plugin@org.jboss.tools.jmx.core=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/plugins/org.jboss.tools.jmx.core
3265 :     plugin@org.eclipse.linuxtools.changelog.doc=SVN,,http://dev.eclipse.org/svnroot/technology,,org.eclipse.linuxtools/changelog/trunk/org.eclipse.linuxtools.changelog.doc
3266 :     fragment@org.eclipse.linuxtools.changelog.parsers.java=SVN,,http://dev.eclipse.org/svnroot/technology,,org.eclipse.linuxtools/changelog/trunk/org.eclipse.linuxtools.changelog.javaparser
3267 :     feature@org.eclipse.linuxtools.changelog=SVN,,http://dev.eclipse.org/svnroot/technology,,org.eclipse.linuxtools/changelog/trunk/org.eclipse.linuxtools.changelog-feature
3268 :     TO:
3269 :     <project reference="0.9.3,svn://svn.jboss.org/repos/jbosstools/trunk/jmx/features/org.jboss.tools.jmx.sdk.feature,org.jboss.tools.jmx.sdk.feature"/>
3270 :     <project reference="0.9.3,svn://svn.jboss.org/repos/jbosstools/trunk/jmx/plugins/org.jboss.tools.jmx.core,org.jboss.tools.jmx.core"/>
3271 :     -->
3272 :     <replaceregexp file="${psffile}"
3273 :     match="(.+)@(.+)=SVN,([^,]*),([^,]+),([^,]*),([^,]+)"
3274 :     replace=" &lt;project reference=&quot;0.9.3,\4/\5/\3/\6,\2&quot;/&gt;"
3275 :     flags="g"
3276 :     byline="true"
3277 :     />
3278 : nickb 1.94 <replaceregexp file="${psffile}"
3279 :     match="(.+)@(.+)=SVN,,([^,]+),,([^,]+)"
3280 :     replace=" &lt;project reference=&quot;0.9.3,\3/\4,\2&quot;/&gt;"
3281 :     flags="g"
3282 :     byline="true"
3283 :     />
3284 : nickb 1.91 <replaceregexp file="${psffile}" match="(\!\*|\#)(.+)" replace=" &lt;!-- \1\2 --&gt;" flags="g" byline="true" />
3285 :     <replaceregexp file="${psffile}" match="(.+)(/cvs)(.+)" replace=" &lt;!-- \1\2\3 --&gt;" flags="g" byline="true" />
3286 : nickb 1.96 <replaceregexp file="${psffile}" match="///" replace="/" flags="g" />
3287 : nickb 1.91
3288 :     <var name="psffile" unset="true" />
3289 :     <var name="psffileprefix" unset="true" />
3290 :     <var name="psfdir" unset="true" />
3291 :     </sequential>
3292 :     </for>
3293 :     </then>
3294 :     <else>
3295 :     <echo>Warning!
3296 :     Map directory ${relengBuilderDir}/maps does not exist. Nothing to do!
3297 : nickb 1.93 </echo>
3298 : nickb 1.91 </else>
3299 :     </if>
3300 :     </target>
3301 : nickb 1.134
3302 :     <target name="provision.eclipse.build.base">
3303 :     <antcall target="provision.eclipse.base">
3304 :     <param name="provision.eclipse.base.target" value="${buildDir}" />
3305 :     </antcall>
3306 :     </target>
3307 :     <target name="provision.eclipse.test.base">
3308 :     <antcall target="provision.eclipse.base">
3309 :     <param name="provision.eclipse.base.target" value="${install}" />
3310 :     </antcall>
3311 :     </target>
3312 :     <target name="provision.eclipse.base">
3313 :     <property name="provision.eclipse.base.target" value="${buildDir}" />
3314 :     <if>
3315 :     <and>
3316 :     <isset property="eclipse.base.url" />
3317 :     <isset property="eclipse.base.file" />
3318 :     </and>
3319 :     <then>
3320 :     <echo message="Provision Eclipse base from ${eclipse.base.file} into ${provision.eclipse.base.target}..." />
3321 :     <ant target="getDep" antfile="${relengCommonBuilderDir}/tools/scripts/getDependencies.xml">
3322 :     <property name="url" value="${eclipse.base.url}" />
3323 :     <property name="file" value="${eclipse.base.file}" />
3324 :     <property name="unpackDest" value="${provision.eclipse.base.target}" />
3325 :     </ant>
3326 :     </then>
3327 :     <elseif>
3328 :     <not>
3329 :     <and>
3330 :     <isset property="repositoryURLs" />
3331 :     <or>
3332 :     <isset property="IUsToInstall" />
3333 :     <isset property="pluginIDsToInstall" />
3334 :     <isset property="featureIDsToInstall" />
3335 :     </or>
3336 :     </and>
3337 :     </not>
3338 :     <then>
3339 :     <fail>Error!
3340 :     Build cannot continue without a defined Eclipse base.
3341 :     ----------
3342 :     You must specify either
3343 :     dependencyURLs=http://download.eclipse.org/eclipse/downloads/drops/R-3.5-200906111540/eclipse-SDK-3.5-linux-gtk.tar.gz
3344 :     (or equivalent platform, RCP, etc.)
3345 :     or
3346 :     repositoryURLs=http://download.eclipse.org/eclipse/updates/3.5.x/
3347 :     featureIDsToInstall=org.eclipse.sdk
3348 :     (or equivalent update site repos + features/plugins to install;
3349 :     use featureIDsToInstall, pluginIDsToInstall and/or IUsToInstall)
3350 :     </fail>
3351 :     </then>
3352 :     </elseif>
3353 :     </if>
3354 :     </target>
3355 :    
3356 : nickb 1.145 <!-- collect values of os, ws, and arch if already set by launching Eclipse -->
3357 :     <target name="get.baseoswsarch">
3358 :     <if>
3359 :     <isset property="osgi.ws" />
3360 :     <then>
3361 :     <property name="baseoswsarch" value="-os ${osgi.os} -ws ${osgi.ws} -arch ${osgi.arch}" />
3362 :     </then>
3363 :     <elseif>
3364 :     <isset property="basews" />
3365 :     <then>
3366 :     <property name="baseoswsarch" value="-os ${baseos} -ws ${basews} -arch ${basearch}" />
3367 :     </then>
3368 :     </elseif>
3369 :     <else>
3370 :     <property name="baseoswsarch" value="" />
3371 :     </else>
3372 :     </if>
3373 :     </target>
3374 :    
3375 : nickb 1.129 </project>