blob: 37a9beb381650c91f6483b763ec2963b8eda9122 [file] [log] [blame]
david_williamsa3e48362007-08-22 04:21:50 +00001<project
2 default="main"
3 basedir=".">
ndai91f5c9b2006-03-12 13:56:45 +00004
david_williamsa3e48362007-08-22 04:21:50 +00005 <!--
6 Required inputs:
7
8 build.home
9 buildType
10 buildId
11 timestamp
12 build.stream [optional]
13 build.committers [optional]
14 testTarget [optional]
15 -->
ndai91f5c9b2006-03-12 13:56:45 +000016
david_williamsa3e48362007-08-22 04:21:50 +000017 <property environment="env" />
ndai91f5c9b2006-03-12 13:56:45 +000018
david_williamsa3e48362007-08-22 04:21:50 +000019 <target name="main">
20 <property
david_williamsd4b1fd32008-01-02 04:16:52 +000021 file="${build.home}/${env.RELENG_BUILDER}/build.properties" />
david_williamsa3e48362007-08-22 04:21:50 +000022 <property
23 name="local.cache.dir"
24 value="${env.LOCAL_PREREQS_CACHE}" />
25 <property
26 name="testRoot"
27 value="${build.home}/testRoot" />
28 <delete
29 dir="${testRoot}"
30 failonerror="false" />
31 <mkdir dir="${testRoot}" />
32 <antcall target="getReleng" />
33 <property
david_williams0085b792007-11-17 08:34:56 +000034 file="${testRoot}/${env.RELENGDALI}/maps/dependencies.properties" />
david_williamsa3e48362007-08-22 04:21:50 +000035 <antcall target="getDependencies" />
36 <condition
37 property="wtp-sdk"
38 value="wtp-sdk-${buildId}.zip"
39 else="wtp-sdk-${buildType}-${buildId}-${timestamp}.zip">
40 <available file="${local.cache.dir}/wtp-sdk-${buildId}.zip" />
41 </condition>
42 <condition
43 property="wtp-wst-tests"
44 value="wtp-wst-Automated-Tests-${buildId}.zip"
45 else="wtp-wst-Automated-Tests-${buildType}-${buildId}-${timestamp}.zip">
46 <available
47 file="${local.cache.dir}/wtp-wst-Automated-Tests-${buildId}.zip" />
48 </condition>
49 <condition
50 property="wtp-jst-tests"
51 value="wtp-jst-Automated-Tests-${buildId}.zip"
52 else="wtp-jst-Automated-Tests-${buildType}-${buildId}-${timestamp}.zip">
53 <available
54 file="${local.cache.dir}/wtp-jst-Automated-Tests-${buildId}.zip" />
55 </condition>
56 <antcall target="run" />
57 <antcall target="upload" />
58 <antcall target="clean" />
59 </target>
ndai91f5c9b2006-03-12 13:56:45 +000060
david_williamsa3e48362007-08-22 04:21:50 +000061 <target name="getReleng">
62 <property
63 name="releng.tag"
64 value="v${buildType}${timestamp}" />
65 <cvs
66 cvsRoot=":pserver:anonymous@dev.eclipse.org:/cvsroot/webtools"
david_williams957ca732007-11-17 01:39:24 +000067 package="${env.RELENG}"
david_williamsa3e48362007-08-22 04:21:50 +000068 dest="${testRoot}"
69 command="export"
70 tag="${releng.tag}"
71 quiet="${env.CVS_QUIET}"
72 reallyquiet="${env.CVS_REALLY_QUIET}" />
73 </target>
ndai91f5c9b2006-03-12 13:56:45 +000074
david_williamsa3e48362007-08-22 04:21:50 +000075 <target name="getDependencies">
76 <ant
david_williamsd4b1fd32008-01-02 04:16:52 +000077 antfile="${build.home}/${env.RELENG_BUILDER}/distribution/wtp.tests/testdependency.xml">
david_williamsa3e48362007-08-22 04:21:50 +000078 <property
79 name="base.install.dir"
80 value="${testRoot}" />
81 <property
82 name="dependencyTargets"
david_williamsd4b1fd32008-01-02 04:16:52 +000083 value="${build.home}/${env.RELENG_BUILDER}/scripts/dependency/build.xml" />
david_williamsa3e48362007-08-22 04:21:50 +000084 </ant>
85 <antcall target="getAndInstallWTP">
86 <param
87 name="file"
88 value="wtp-sdk-${buildId}.zip" />
89 </antcall>
90 <antcall target="getAndInstallWTP">
91 <param
92 name="file"
93 value="wtp-sdk-${buildType}-${buildId}-${timestamp}.zip" />
94 </antcall>
95 <antcall target="getAndInstallWTP">
96 <param
97 name="file"
98 value="wtp-wst-Automated-Tests-${buildId}.zip" />
99 </antcall>
100 <antcall target="getAndInstallWTP">
101 <param
102 name="file"
103 value="wtp-wst-Automated-Tests-${buildType}-${buildId}-${timestamp}.zip" />
104 </antcall>
105 <antcall target="getAndInstallWTP">
106 <param
107 name="file"
108 value="wtp-jst-Automated-Tests-${buildId}.zip" />
109 </antcall>
110 <antcall target="getAndInstallWTP">
111 <param
112 name="file"
113 value="wtp-jst-Automated-Tests-${buildType}-${buildId}-${timestamp}.zip" />
114 </antcall>
115 </target>
ndai91f5c9b2006-03-12 13:56:45 +0000116
david_williamsa3e48362007-08-22 04:21:50 +0000117 <target name="getAndInstallWTP">
118 <available
119 file="${local.cache.dir}/${file}"
120 property="file.exists" />
121 <antcall target="getWTP" />
122 <available
123 file="${local.cache.dir}/${file}"
124 property="file.exists" />
125 <antcall target="installWTP" />
126 </target>
ndai91f5c9b2006-03-12 13:56:45 +0000127
david_williamsa3e48362007-08-22 04:21:50 +0000128 <target name="getWTP">
129 <condition
130 property="file.url"
131 value="http://download.eclipse.org/webtools/committers/drops/${buildType}-${buildId}-${timestamp}"
132 else="http://download.eclipse.org/webtools/downloads/drops/${buildType}-${buildId}-${timestamp}">
133 <isset property="build.committers" />
134 </condition>
135 <antcall target="getWTP2" />
136 </target>
ndai91f5c9b2006-03-12 13:56:45 +0000137
david_williamsa3e48362007-08-22 04:21:50 +0000138 <target
139 name="getWTP2"
140 unless="file.exists">
141 <property
142 name="file.url"
143 value="http://download.eclipse.org/webtools/downloads/drops/${buildType}-${buildId}-${timestamp}" />
144 <get
145 dest="${local.cache.dir}/${file}"
146 src="${file.url}/${file}"
147 ignoreerrors="true" />
148 </target>
ndai91f5c9b2006-03-12 13:56:45 +0000149
david_williamsa3e48362007-08-22 04:21:50 +0000150 <target
151 name="installWTP"
152 if="file.exists">
153 <unzip
154 src="${local.cache.dir}/${file}"
155 dest="${testRoot}"
156 overwrite="true" />
157 </target>
ndai91f5c9b2006-03-12 13:56:45 +0000158
david_williamsa3e48362007-08-22 04:21:50 +0000159 <target name="run">
160 <mkdir dir="${testRoot}/results/consolelogs" />
161 <copy
162 todir="${testRoot}"
163 flatten="true"
164 overwrite="true">
165 <fileset
david_williamsd4b1fd32008-01-02 04:16:52 +0000166 dir="${build.home}/${env.RELENG_BUILDER}/distribution/wtp.tests/testScripts" />
david_williamsa3e48362007-08-22 04:21:50 +0000167 </copy>
168 <ant
david_williamsd4b1fd32008-01-02 04:16:52 +0000169 antfile="${build.home}/${env.RELENG_BUILDER}/distribution/wtp.tests/build.xml"
david_williamsa3e48362007-08-22 04:21:50 +0000170 target="runTestEclipse">
171 <property
172 name="testRoot"
173 value="${testRoot}" />
174 <property
175 name="testTarget"
176 value="" />
177 </ant>
178 <copy
david_williamsd4b1fd32008-01-02 04:16:52 +0000179 file="${build.home}/${env.RELENG_BUILDER}/distribution/wtp.tests/templateFiles/index.php"
david_williamsa3e48362007-08-22 04:21:50 +0000180 todir="${testRoot}/results/index.php"
181 overwrite="true" />
182 </target>
183
184 <target
185 name="upload"
186 if="login">
187 <condition
188 property="upload.path"
189 else="~/downloads/webtools/downloads/drops/${buildType}-${buildId}-${timestamp}/testResults/${config}"
190 value="~/downloads/webtools/committers/drops/${buildType}-${buildId}-${timestamp}/testResults/${config}">
191 <isset property="build.committers" />
192 </condition>
193 <exec
194 executable="ssh"
195 dir="${build.home}">
196 <arg
197 line="${login}@download1.eclipse.org mkdir ${upload.path}" />
198 </exec>
199 <exec
200 executable="scp"
201 dir="${build.home}">
202 <arg
203 line="-r ./testRoot/results ${login}@download1.eclipse.org:${upload.path}" />
204 </exec>
205 </target>
206
207 <target
208 name="clean"
209 if="clean">
210 <delete
211 dir="${testRoot}"
212 failonerror="false" />
213 <delete
214 file="${local.cache.dir}/${wtp-sdk}"
215 failonerror="false" />
216 <delete
217 file="${local.cache.dir}/${wtp-wst-tests}"
218 failonerror="false" />
219 <delete
220 file="${local.cache.dir}/${wtp-jst-tests}"
221 failonerror="false" />
222 </target>
ndai91f5c9b2006-03-12 13:56:45 +0000223
224</project>