blob: 22aa3a4d9886ef2c92bece0b84401c337fbbfe39 [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
21 file="${build.home}/releng.wtpbuilder/build.properties" />
22 <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
34 file="${testRoot}/releng.dali/maps/dependencies.properties" />
35 <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"
67 package="releng"
68 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
77 antfile="${build.home}/releng.wtpbuilder/distribution/wtp.tests/testdependency.xml">
78 <property
79 name="base.install.dir"
80 value="${testRoot}" />
81 <property
82 name="dependencyTargets"
83 value="${build.home}/releng.wtpbuilder/scripts/dependency/build.xml" />
84 </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
166 dir="${build.home}/releng.wtpbuilder/distribution/wtp.tests/testScripts" />
167 </copy>
168 <ant
169 antfile="${build.home}/releng.wtpbuilder/distribution/wtp.tests/build.xml"
170 target="runTestEclipse">
171 <property
172 name="testRoot"
173 value="${testRoot}" />
174 <property
175 name="testTarget"
176 value="" />
177 </ant>
178 <copy
179 file="${build.home}/releng.wtpbuilder/distribution/wtp.tests/templateFiles/index.php"
180 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>