Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: a1f0e5117d5523843339aa0bef3fe83ece6a869e (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
<project default="build">

	<target name="hi">
		<echo message="${eclipse.home}"/>
	</target>
	
	<target name="build" depends="zips,test"/>
	<target name="cdtbuild" depends="zips,test,upload"/>
	
	<target name="init">
		<touch file="${user.home}/.cvspass" />
		<tstamp/>
		<property name="branchVersion" value="3.0.0"/>
		<property name="timestamp" value="${DSTAMP}${TSTAMP}" />
		<property name="buildDirectory" value="${basedir}/results" />
		<property name="baseLocation" value="${buildDirectory}/eclipse"/>
		<property name="pde.build.scripts" value="${eclipse.home}/plugins/org.eclipse.pde.build_3.1.0/scripts"/>
		<property name="eclipseZip" value="eclipse-SDK.zip"/>
		<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="milestonedir" value="${buildDirectory}/${milestone}"/>
		<property name="buildingOSGi" value="true"/>
		<property name="messagefile" value="message.in"/>
		<property name="mailto" value="cdt-test-dev@eclipse.org"/>
		<property name="cdtuser" value="nobody"/>
		<property name="cdtpasswd" value="home"/>
		<property name="remotedir" value="${cdtuser}@download1.eclipse.org:cdt/builds/${branchVersion}"/>
		<property name="eclipseRoot" value=":pserver:anonymous@dev.eclipse.org:/home/eclipse"/>
		<property name="baseos" value="${osgi.os}"/>
		<property name="basews" value="${osgi.ws}"/>
		<property name="basearch" value="${osgi.arch}"/>
		<condition property="onWindows">
			<os family="windows"/>
		</condition>
		<mkdir dir="${buildDirectory}"/>
	</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="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>
	</target>
	
	<target name="unzip" depends="init" unless="dontUnzip">
		<untar src="${eclipseZip}" dest="${buildDirectory}" compression="gzip"/>
	</target>
	
	<target name="zips" depends="init,unzip">
		<ant antfile="build.xml" dir="${pde.build.scripts}">
			<property name="builder" value="${basedir}/platform" />

		</ant>
		<ant antfile="build.xml" dir="${pde.build.scripts}">
			<property name="builder" value="${basedir}/sdk" />
		</ant>
		<concat destfile="${zipsdir}/compilelog.txt">
			<fileset dir="${buildDirectory}/plugins" includes="**/*.bin.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>
	</target>

	<target name="tunzip" if="onWindows">
		<unzip src="${zipsdir}/org.eclipse.cdt-${branchVersion}-${buildId}-${osgi.os}.${osgi.arch}.zip" dest="${buildDirectory}"/>
	</target>

	<target name="tuntar" unless="onWindows">
		<untar src="${zipsdir}/org.eclipse.cdt-${branchVersion}-${buildId}-${osgi.os}.${osgi.arch}.tar.gz" dest="${buildDirectory}"
			compression="gzip"/>
	</target>

	<target name="test" depends="init" unless="hasErrors">
		<ant antfile="build.xml" dir="${pde.build.scripts}">
			<property name="builder" value="${basedir}/testing" />
		</ant>
		<antcall target="tunzip"/>
		<antcall target="tuntar"/>
		<unzip src="${zipsdir}/org.eclipse.cdt.testing-${branchVersion}-${buildId}.zip" dest="${buildDirectory}"/>
		<ant antfile="test.xml" dir="${buildDirectory}/eclipse/plugins/org.eclipse.cdt.testing_${branchVersion}">
			<property name="eclipse-home" value="${buildDirectory}/eclipse"/>
			<property name="library-file" value="${buildDirectory}/eclipse/plugins/org.eclipse.test_3.1.0/library.xml"/>
			<property name="os" value="${baseos}"/>
			<property name="ws" value="${basews}"/>
			<property name="arch" value="${basearch}"/>
		</ant>
		<xslt style="${buildDirectory}/eclipse/plugins/org.eclipse.test/JUNIT.XSL"
			in="${buildDirectory}/eclipse/org.eclipse.cdt.testing.xml"
			out="${zipsdir}/junits.html"/>
	</target>
	
	<target name="upload" depends="init" unless="hasErrors">
		<exec dir="${buildDirectory}" executable="expect">
			<arg line="${basedir}/myscp ${cdtpasswd} ${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="expect">
			<arg line="${basedir}/myscp ${cdtpasswd} index.html ${remotedir}/index.html"/>
		</exec>
		<exec dir="${buildDirectory}" executable="expect">
			<arg line="${basedir}/myscp ${cdtpasswd} -r ${buildType}.${buildId} ${remotedir}"/>
		</exec>
	</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="dschaefe@ca.ibm.com">
			<message src="message.txt"/>
		</mail>
	</target>

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

</project>

Back to the top