blob: a16c744e1522fa0867411176ae00f38961e5554a [file] [log] [blame]
jeffliu925d2c92006-03-07 07:38:36 +00001<project default="main" basedir=".">
2
3 <!--
4 Required inputs:
5
6 build.home
7 buildType
8 buildId
9 timestamp
10 baseos
11 basews
12 basearch
13 build.committers [optional]
14 testTarget [optional]
15 -->
16
17 <target name="main">
18 <property file="${build.home}/releng.wtpbuilder/build.properties"/>
19 <property name="local.cache.dir" value="${build.home}/${build.local.repository}"/>
20 <property name="testRoot" value="${build.home}/testRoot"/>
21 <delete dir="${testRoot}"/>
22 <mkdir dir="${testRoot}"/>
23 <antcall target="getReleng"/>
24 <property file="${testRoot}/releng/maps/dependencies.properties"/>
25 <antcall target="getDependencies"/>
26 <condition property="wtp-sdk" value="wtp-sdk-${buildId}.zip" else="wtp-sdk-${buildType}-${buildId}-${timestamp}.zip">
27 <available file="${local.cache.dir}/wtp-sdk-${buildId}.zip"/>
28 </condition>
29 <condition property="wtp-wst-tests" value="wtp-wst-Automated-Tests-${buildId}.zip" else="wtp-wst-Automated-Tests-${buildType}-${buildId}-${timestamp}.zip">
30 <available file="${local.cache.dir}/wtp-wst-Automated-Tests-${buildId}.zip"/>
31 </condition>
32 <condition property="wtp-jst-tests" value="wtp-jst-Automated-Tests-${buildId}.zip" else="wtp-jst-Automated-Tests-${buildType}-${buildId}-${timestamp}.zip">
33 <available file="${local.cache.dir}/wtp-jst-Automated-Tests-${buildId}.zip"/>
34 </condition>
35 <antcall target="run"/>
36 <antcall target="upload"/>
37 <antcall target="clean"/>
38 </target>
39
40 <target name="getReleng">
41 <property name="releng.tag" value="v${buildType}${timestamp}"/>
42 <cvs
43 cvsRoot=":pserver:anonymous@dev.eclipse.org:/cvsroot/webtools"
44 package="releng"
45 dest="${testRoot}"
46 command="export"
47 tag="${releng.tag}"
48 />
49 </target>
50
51 <target name="getDependencies">
52 <ant antfile="${build.home}/releng.wtpbuilder/distribution/wtp.tests/testdependency.xml">
53 <property name="base.install.dir" value="${testRoot}"/>
54 <property name="dependencyTargets" value="${build.home}/releng.wtpbuilder/scripts/dependency/build.xml"/>
55 </ant>
56 <antcall target="getAndInstallWTP">
57 <param name="file" value="wtp-sdk-${buildId}.zip" />
58 </antcall>
59 <antcall target="getAndInstallWTP">
60 <param name="file" value="wtp-sdk-${buildType}-${buildId}-${timestamp}.zip" />
61 </antcall>
62 <antcall target="getAndInstallWTP">
63 <param name="file" value="wtp-wst-Automated-Tests-${buildId}.zip" />
64 </antcall>
65 <antcall target="getAndInstallWTP">
66 <param name="file" value="wtp-wst-Automated-Tests-${buildType}-${buildId}-${timestamp}.zip" />
67 </antcall>
68 <antcall target="getAndInstallWTP">
69 <param name="file" value="wtp-jst-Automated-Tests-${buildId}.zip" />
70 </antcall>
71 <antcall target="getAndInstallWTP">
72 <param name="file" value="wtp-jst-Automated-Tests-${buildType}-${buildId}-${timestamp}.zip" />
73 </antcall>
74 </target>
75
76 <target name="getAndInstallWTP">
77 <available file="${local.cache.dir}/${file}" property="file.exists"/>
78 <antcall target="getWTP"/>
79 <available file="${local.cache.dir}/${file}" property="file.exists"/>
80 <antcall target="installWTP"/>
81 </target>
82
83 <target name="getWTP">
84 <condition property="file.url" value="http://download.eclipse.org/webtools/committers/drops/${buildType}-${buildId}-${timestamp}" else="http://download.eclipse.org/webtools/downloads/drops/${buildType}-${buildId}-${timestamp}">
85 <isset property="build.committers"/>
86 </condition>
87 <antcall target="getWTP2"/>
88 </target>
89
90 <target name="getWTP2" unless="file.exists">
91 <property name="file.url" value="http://download.eclipse.org/webtools/downloads/drops/${buildType}-${buildId}-${timestamp}"/>
92 <get dest="${local.cache.dir}/${file}" src="${file.url}/${file}" ignoreerrors="true"/>
93 </target>
94
95 <target name="installWTP" if="file.exists">
96 <unzip src="${local.cache.dir}/${file}" dest="${testRoot}" overwrite="true"/>
97 </target>
98
99 <target name="run">
100 <mkdir dir="${testRoot}/results/consolelogs"/>
101 <copy todir="${testRoot}" flatten="true" overwrite="true">
102 <fileset dir="${build.home}/releng.wtpbuilder/distribution/wtp.tests/testScripts"/>
103 </copy>
104 <ant antfile="${build.home}/releng.wtpbuilder/distribution/wtp.tests/build.xml" target="runTestEclipse">
105 <property name="testRoot" value="${testRoot}"/>
106 <property name="testTarget" value=""/>
107 </ant>
108 <copy file="${build.home}/releng.wtpbuilder/distribution/wtp.tests/templateFiles/index.php" todir="${testRoot}/results/index.php" overwrite="true"/>
109 </target>
110
111 <target name="upload" if="login">
112 <condition property="upload.path"
113 else="~/downloads/webtools/downloads/drops/${buildType}-${buildId}-${timestamp}/testResults/${config}"
114 value="~/downloads/webtools/committers/drops/${buildType}-${buildId}-${timestamp}/testResults/${config}">
115 <isset property="build.committers"/>
116 </condition>
117 <exec executable="ssh" dir="${build.home}">
118 <arg line="${login}@download1.eclipse.org mkdir ${upload.path}"/>
119 </exec>
120 <exec executable="scp" dir="${build.home}">
121 <arg line="-r ./testRoot/results ${login}@download1.eclipse.org:${upload.path}"/>
122 </exec>
123 </target>
124
125 <target name="clean" if="clean">
126 <delete dir="${testRoot}" failonerror="false"/>
127 <delete file="${local.cache.dir}/${wtp-sdk}" failonerror="false"/>
128 <delete file="${local.cache.dir}/${wtp-wst-tests}" failonerror="false"/>
129 <delete file="${local.cache.dir}/${wtp-jst-tests}" failonerror="false"/>
130 </target>
131
132</project>