Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 004571fc056485e6f22e1666ca6a09848fdd3394 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
<project default="nightly">

	<target name="hi">
		<echo message="${eclipse.home}"/>
	</target>
	
	<target name="build" depends="zips,test"/>
	<target name="nightly" depends="tag,zips,sign,generate.p2.metadata,test,update.index.html,copy"/>
	<target name="testbuild" depends="zips,test,copy"/>
	<target name="buildcopy" depends="zips,generate.p2.metadata,copy"/>
	<target name="cdtbuild" depends="tag,zips,test,upload"/>
	<target name="testpack" depends="zips,sign,pack,generate.p2.metadata,copy"/>
	
	<target name="init">
		<touch file="${user.home}/.cvspass" />
		<tstamp/>
		<property name="eclipseDist" value="/home/data/httpd/download.eclipse.org/eclipse/downloads/drops/S-3.6.2RC2-201101190834/eclipse-SDK-3.6.2RC2-linux-gtk.tar.gz"/>
		<property name="rseDist" value="/home/data/httpd/download.eclipse.org/dsdp/tm/downloads/drops/R-3.2-201006071030/RSE-SDK-3.2.zip"/>
		<property name="branchVersion" value="7.0.2"/>
		<property name="timestamp" value="${DSTAMP}${TSTAMP}" />
		<property name="forceContextQualifier" value="${timestamp}"/>
		<property name="buildingOSGi" value="true"/>
		<property name="buildDirectory" value="${basedir}/results"/>
		<property name="testDirectory" value="${buildDirectory}/test"/>
		<property name="baseLocation" value="${buildDirectory}/eclipse"/>
		<property name="pde.build.scripts" value="${eclipse.pdebuild.scripts}"/>
		<property name="collectingFolder" value="eclipse"/>
		<property name="archivePrefix" value="eclipse"/>
		<property name="buildType" value="I" />
		<property name="buildId" value="${buildType}${timestamp}"/>
		<property name="zipsdir" value="${buildDirectory}/${buildType}.${buildId}"/>
		<property name="masterFile" value="cdt-master-${branchVersion}-${buildId}.zip"/>
		<property name="masterFeature" value="org.eclipse.cdt.master_${branchVersion}.jar"/>
		<property name="cdtTest" value="org.eclipse.cdt.testing_7.0.0.${timestamp}"/>
		<property name="eclipseTest" value="org.eclipse.test_3.3.100"/>
		<property name="messagefile" value="message.in"/>
		<property name="mailto" value="vivkong@ca.ibm.com"/>
		<property name="eclipseRoot" value=":pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse"/>
		<property name="baseos" value="${osgi.os}"/>
		<property name="basews" value="${osgi.ws}"/>
		<property name="basearch" value="${osgi.arch}"/>
		<property name="tagbranch" value="-r cdt_7_0"/>
		<property name="tagname" value="v${timestamp}"/>
		<property name="testReports" value="${zipsdir}/testReports"/>
		<property name="junit-report-output" value="${testReports}"/>
		<!--property name="jvm1.5" value="/opt/public/common/ibm-java2-ppc-50/bin/java"/-->
		<property name="jvm1.5" value="java"/>
		<condition property="onWindows">
			<os family="windows"/>
		</condition>
		<mkdir dir="${buildDirectory}"/>
		<mkdir dir="${testReports}"/>
	</target>
	
	<target name="fetch" depends="init">
		<ant antfile="build.xml" dir="${pde.build.scripts}" target="preBuild">
			<property name="builder" value="${basedir}/platform"/>
		</ant>
		<ant antfile="build.xml" dir="${pde.build.scripts}" target="preBuild">
			<property name="builder" value="${basedir}/sdk"/>
		</ant>
		<ant antfile="build.xml" dir="${pde.build.scripts}" target="preBuild">
			<property name="builder" value="${basedir}/gdbjtag"/>
		</ant>
		<ant antfile="build.xml" dir="${pde.build.scripts}" target="preBuild">
			<property name="builder" value="${basedir}/lrparser"/>
		</ant>
		<ant antfile="build.xml" dir="${pde.build.scripts}" target="preBuild">
			<property name="builder" value="${basedir}/lrparser.sdk"/>
		</ant>
		<ant antfile="build.xml" dir="${pde.build.scripts}" target="preBuild">
			<property name="builder" value="${basedir}/upc"/>
		</ant>
		<ant antfile="build.xml" dir="${pde.build.scripts}" target="preBuild">
			<property name="builder" value="${basedir}/upc.sdk"/>
		</ant>
		<ant antfile="build.xml" dir="${pde.build.scripts}" target="preBuild">
			<property name="builder" value="${basedir}/xlc"/>
		</ant>
		<ant antfile="build.xml" dir="${pde.build.scripts}" target="preBuild">
			<property name="builder" value="${basedir}/xlc.sdk"/>
		</ant>
		<ant antfile="build.xml" dir="${pde.build.scripts}" target="preBuild">
			<property name="builder" value="${basedir}/util"/>
		</ant>
		<!--
		<ant antfile="build.xml" dir="${pde.build.scripts}" target="preBuild">
			<property name="builder" value="${basedir}/dsfgdb"/>
		</ant>
		-->
		<ant antfile="build.xml" dir="${pde.build.scripts}" target="preBuild">
			<property name="builder" value="${basedir}/memory"/>
		</ant>
		<ant antfile="build.xml" dir="${pde.build.scripts}" target="fetch">
			<property name="builder" value="${basedir}/platform"/>
		</ant>
		<ant antfile="build.xml" dir="${pde.build.scripts}" target="fetch">
			<property name="builder" value="${basedir}/sdk"/>
		</ant>
		<ant antfile="build.xml" dir="${pde.build.scripts}" target="fetch">
			<property name="builder" value="${basedir}/gdbjtag"/>
		</ant>
		<ant antfile="build.xml" dir="${pde.build.scripts}" target="fetch">
			<property name="builder" value="${basedir}/lrparser"/>
		</ant>
		<ant antfile="build.xml" dir="${pde.build.scripts}" target="fetch">
			<property name="builder" value="${basedir}/lrparser.sdk"/>
		</ant>
		<ant antfile="build.xml" dir="${pde.build.scripts}" target="fetch">
			<property name="builder" value="${basedir}/upc"/>
		</ant>
		<ant antfile="build.xml" dir="${pde.build.scripts}" target="fetch">
			<property name="builder" value="${basedir}/upc.sdk"/>
		</ant>
		<ant antfile="build.xml" dir="${pde.build.scripts}" target="fetch">
			<property name="builder" value="${basedir}/xlc"/>
		</ant>
		<ant antfile="build.xml" dir="${pde.build.scripts}" target="fetch">
			<property name="builder" value="${basedir}/xlc.sdk"/>
		</ant>
		<ant antfile="build.xml" dir="${pde.build.scripts}" target="fetch">
			<property name="builder" value="${basedir}/util"/>
		</ant>
		<!--
		<ant antfile="build.xml" dir="${pde.build.scripts}" target="fetch">
			<property name="builder" value="${basedir}/dsfgdb"/>
		</ant>
		-->
		<ant antfile="build.xml" dir="${pde.build.scripts}" target="fetch">
			<property name="builder" value="${basedir}/memory"/>
		</ant>
		<ant antfile="build.xml" dir="${pde.build.scripts}" target="fetch">
			<property name="builder" value="${basedir}/codan"/>
		</ant>
	</target>
	
	<target name="unzip" depends="init" unless="dontUnzip">
		<untar src="${eclipseDist}" dest="${buildDirectory}" compression="gzip"/>
		<unzip src="${rseDist}" dest="${buildDirectory}"/>
	</target>
	
	<target name="zips" depends="init,unzip">
		<ant antfile="build.xml" dir="${pde.build.scripts}">
			<property name="builder" value="${basedir}/master" />
		</ant>
		<concat destfile="${zipsdir}/compilelog.txt">
			<fileset dir="${buildDirectory}/plugins" includes="**/*@dot.log"/>
		</concat>
		<loadfile property="compileLog" srcFile="${zipsdir}/compilelog.txt"/>
		<condition property="hasErrors">
			<contains string="${compileLog}" substring=" ERROR "/>
		</condition>
		<copy file="buildindex.html" tofile="${zipsdir}/index.html"/>
		<replace file="${zipsdir}/index.html">
			<replacefilter token="@branchVersion@" value="${branchVersion}"/>
			<replacefilter token="@buildId@" value="${buildId}"/>
		</replace>
		<move file="${zipsdir}/${masterFile}" todir="${buildDirectory}"/>
		<unzip src="${buildDirectory}/${masterFile}" dest="${buildDirectory}/site"/>
		<!--
		<move file="${buildDirectory}/site/linux.gtk.x86/eclipse/epl-v10.html" todir="${buildDirectory}/site/eclipse"/>
		<move file="${buildDirectory}/site/linux.gtk.x86/eclipse/notice.html" todir="${buildDirectory}/site/eclipse"/>
		-->
		<copy file="epl-v10.html" tofile="${buildDirectory}/site/eclipse/epl-v10.html"/>
		<copy file="notice.html" tofile="${buildDirectory}/site/eclipse/notice.html"/>
		<copy file="buildsite.xml" tofile="${buildDirectory}/site/eclipse/site.xml"/>
		<replace file="${buildDirectory}/site/eclipse/site.xml">
			<replacefilter token="@buildVersion@" value="${branchVersion}"/>
			<replacefilter token="@timeStamp@" value="${timestamp}"/>
		</replace>
		<copy file="pack.properties" todir="${buildDirectory}/site/eclipse"/>
		<!-- for some reason LPG isn't getting picked up-->		
		<copy file="${buildDirectory}/plugins/net.sourceforge.lpg.lpgjavaruntime_1.1.0.v200803061910.jar"
			todir="${buildDirectory}/site/eclipse/plugins"/>
		
		<!-- remove the master feature from the update site -->
		<delete verbose="true" file="${buildDirectory}/site/eclipse/features/${masterFeature}"/>
		
		<zip destfile="${zipsdir}/${masterFile}"
			basedir="${buildDirectory}/site/eclipse"/>
	</target>
	
	<!--pack200-->
	<!-- this will pack the master zip using pack200 and generate p2 metadata based on the packed master zip-->
	<target name="pack" depends="init" unless="hasErrors">
    	<echo message="Pack200" />
    	<property name="launcher" value="${basedir}/tools/org.eclipse.releng.basebuilder/plugins/org.eclipse.equinox.launcher.jar"/>
        <java jar="${launcher}" fork="true" timeout="10800000" jvm="${jvm1.5}" failonerror="true" maxmemory="768m" dir="${buildDirectory}/eclipse">
            <arg line="-application org.eclipse.update.core.siteOptimizer" />
            <arg line="-jarProcessor"/>
        	<arg line="-verbose"/>
        	<arg line="-processAll"/>
        	<arg line="-pack"/>
        	<arg line="-outputDir ${zipsdir}/pack ${zipsdir}/${masterFile}"/>
        </java>
		
		<antcall target="generate.p2.metadata">
			<param name="p2dir" value="${zipsdir}/pack/p2"/>
			<param name="destination" value="${zipsdir}/pack/${masterFile}"/>
		</antcall>
	</target>
	
	<target name="generate.p2.metadata" depends="init" unless="hasErrors">
		<!-- unzip the signed master site -->
		<property name="p2dir" value="${zipsdir}/p2"/>
		<property name="destination" value="${zipsdir}/${masterFile}"/>
		
		<unzip src="${destination}" dest="${p2dir}"/>
		
		<!-- generate p2 metadata -->
		<antcall target="p2.metadata.generator">
			<param name="p2site" value="${p2dir}"/>
		</antcall>
		
		<!-- zip everything back up -->
		<zip destfile="${destination}"
			basedir="${p2dir}"/>
		<delete dir="${p2dir}"/>
	</target>
	
    <target name="p2.metadata.generator">
    	<echo message="Generate p2 Metadata" />
    	<property name="p2site" value="${zipsdir}/p2"/>
    	<property name="launcher" value="${basedir}/tools/org.eclipse.releng.basebuilder/plugins/org.eclipse.equinox.launcher.jar"/>
        <!--java jar="${launcher}" fork="true" timeout="10800000" jvm="${jvm1.5}" failonerror="true" maxmemory="768m" error="${zipsdir}/p2errorlog.txt" dir="${buildDirectory}/eclipse" output="${zipsdir}/p2metadata.txt"-->
    	<java jar="${launcher}" fork="true" timeout="10800000" jvm="${jvm1.5}" failonerror="true" maxmemory="768m" dir="${buildDirectory}/eclipse">
            <arg line="-application org.eclipse.equinox.p2.metadata.generator.EclipseGenerator" />
            <arg line="-updateSite ${p2site}"/>
        	<arg line="-site file:${p2site}/site.xml"/>
        	<arg line="-metadataRepository file:${p2site}"/>
        	<arg line="-metadataRepositoryName CDT Update Site"/>
        	<arg line="-artifactRepository file:${p2site}"/>
        	<arg line="-artifactRepositoryName CDT Artifacts"/>
        	<arg line="-compress"/>
        	<arg line="-reusePack200Files"/>
        	<arg line="-noDefaultIUs"/>
        	<arg line="-vmargs -Xmx256M"/>
        </java>
	</target>

	<target name="test" depends="init" unless="hasErrors">
		<record name="${testReports}/testsLog.txt" action="start" loglevel="verbose"/>
		<untar src="${eclipseDist}" dest="${testDirectory}" compression="gzip"/>
		<!--unzip src="${mylynDist}" dest="${testDirectory}/eclipse"/-->
		<unzip src="${zipsdir}/cdt-master-${branchVersion}-${buildId}.zip"
			dest="${testDirectory}/eclipse"/>
		<unzip src="${testDirectory}/eclipse/plugins/${cdtTest}.jar"
			dest="${testDirectory}/test/cdt"/>
		<unzip src="${testDirectory}/eclipse/plugins/${eclipseTest}.jar"
			dest="${testDirectory}/test/eclipse"/>		
		<delete file="${testDirectory}/eclipse/site.xml"/>
		<delete file="${testDirectory}/eclipse/pack.properties"/>
		<delete file="${testDirectory}/eclipse/artifacts.jar"/>
		<delete file="${testDirectory}/eclipse/content.jar"/>
		<ant antfile="test.xml" dir="${testDirectory}/test/cdt">
			<property name="eclipse-home" value="${testDirectory}/eclipse"/>
			<property name="library-file" value="${testDirectory}/test/eclipse/library.xml"/>
			<property name="os" value="${baseos}"/>
			<property name="ws" value="${basews}"/>
			<property name="arch" value="${basearch}"/>
		</ant>
		<xslt style="${basedir}/JUNIT.XSL"
			in="${testDirectory}/eclipse/org.eclipse.cdt.testing.xml"
			out="${zipsdir}/junits.html"/>
		<copy file="${testDirectory}/eclipse/org.eclipse.cdt.testing.xml"
		    tofile="${testReports}/org.eclipse.cdt.testing.xml"
		    failonerror="false"/>
		<record name="${testReports}/testsLog.txt" action="stop"/>
	</target>
	
	<target name="sign" depends="init" unless="hasErrors">
		<exec executable="sign">
			<arg value="${buildDirectory}/${buildType}.${buildId}/${masterFile}"/>
			<arg value="nomail"/>
			<arg value="${buildDirectory}/signed"/>
		</exec>
		<waitfor maxwait="30" maxwaitunit="minute">
			<available file="${buildDirectory}/signed/${masterFile}"/>
		</waitfor>
		<move file="${buildDirectory}/signed/${masterFile}" todir="${zipsdir}"/>
	</target>

	<target name="upload" depends="init" unless="hasErrors">
		<property name="remotedir" value="dschaefer@dev.eclipse.org:cdt/builds/${branchVersion}"/>
		<exec dir="${buildDirectory}" executable="scp">
			<arg line="${remotedir}/index.html index.html"/>
		</exec>
		<replace file="${buildDirectory}/index.html">
			<replacetoken><![CDATA[  <!-- add here -->]]></replacetoken>
			<replacevalue><![CDATA[  <li><a href="@buildType@.@buildId@/index.html">@buildId@</a></li>
  <!-- add here -->]]></replacevalue>
		</replace>
		<replace file="${buildDirectory}/index.html">
			<replacefilter token="@buildType@" value="${buildType}"/>
			<replacefilter token="@buildId@" value="${buildId}"/>
		</replace>
		<exec dir="${buildDirectory}" executable="scp">
			<arg line="index.html ${remotedir}/index.html"/>
		</exec>
		<exec dir="${buildDirectory}" executable="scp">
			<arg line="-r ${buildType}.${buildId} ${remotedir}"/>
		</exec>
	</target>
	
	<target name="update.index.html" depends="init" unless="hasErrors">
		<property name="copyToDir" value="/home/data/httpd/download.eclipse.org/tools/cdt/builds/${branchVersion}"/>
		<replace file="${copyToDir}/index.html">
			<replacetoken><![CDATA[  <!-- add here -->]]></replacetoken>
			<replacevalue><![CDATA[  <!-- add here -->
<li><a href="@buildType@.@buildId@/index.html">@buildId@</a></li>]]>
			</replacevalue>
		</replace>
		<replace file="${copyToDir}/index.html">
			<replacefilter token="@buildType@" value="${buildType}"/>
			<replacefilter token="@buildId@" value="${buildId}"/>
		</replace>
		<chmod file="${copyToDir}/index.html" perm="664"/>

	</target>
	
	<target name="copy" depends="init" unless="hasErrors">
		<property name="copyToDir" value="/home/data/httpd/download.eclipse.org/tools/cdt/builds/${branchVersion}"/>
		<mkdir dir="${copyToDir}/${buildType}.${buildId}"/>
		<copy todir="${copyToDir}/${buildType}.${buildId}">
			<fileset dir="${buildDirectory}/${buildType}.${buildId}"/>
		</copy>
		<chmod perm="g+w" dir="${copyToDir}">
			<dirset dir="${copyToDir}"/>
		</chmod>
		<!-- Create symlink to latest build -->
		<symlink action="delete" link="${copyToDir}/latest" failonerror="false"/>
		<symlink link="${copyToDir}/latest" resource="${copyToDir}/${buildType}.${buildId}" overwrite="true"/>

	</target>

	<target name="mail" depends="init">
		<antcall target="mailPass"/>
		<antcall target="mailFail"/>
	</target>
	
	<target name="mailPass" unless="hasErrors">
		<copy file="${messagefile}" tofile="message.txt" overwrite="true"/>
		<replace file="message.txt">
			<replacefilter token="@branchVersion@" value="${branchVersion}"/>
			<replacefilter token="@buildId@" value="${buildId}"/>
		</replace>
		<mail subject="CDT ${branchVersion} Build ${buildId} completed"
 			tolist="${mailto}" from="dschaefer@qnx.com">
			<message src="message.txt"/>
		</mail>
	</target>

	<target name="mailFail" if="hasErrors">
		<mail subject="CDT ${branchVersion} Build ${buildId} failed"
			tolist="${mailto}" from="dschaefer@qnx.com">
			<message src="compilelog.txt"/>
		</mail>
	</target>

	<target name="tag" depends="init">
		<property name="cdtTag" value="${tagname}"/>
		<cvs cvsroot="/cvsroot/tools" command="rtag ${tagbranch} ${tagname} org.eclipse.cdt"/>
	</target>

</project>

Back to the top