blob: 4432eda9d3241c687152774981b0df974707ff75 [file] [log] [blame]
<project default="main" basedir=".">
<!--
Required inputs:
build.home
buildType
buildId
timestamp
baseos
basews
basearch
build.committers [optional]
testTarget [optional]
-->
<target name="main">
<property file="${build.home}/releng.wtpbuilder/build.properties"/>
<property name="local.cache.dir" value="${build.home}/${build.local.repository}"/>
<property name="testRoot" value="${build.home}/testRoot"/>
<delete dir="${testRoot}" failonerror="false"/>
<mkdir dir="${testRoot}"/>
<antcall target="getReleng"/>
<property file="${testRoot}/releng/maps/dependencies.properties"/>
<antcall target="getDependencies"/>
<condition property="wtp-sdk" value="wtp-sdk-${buildId}.zip" else="wtp-sdk-${buildType}-${buildId}-${timestamp}.zip">
<available file="${local.cache.dir}/wtp-sdk-${buildId}.zip"/>
</condition>
<condition property="wtp-wst-tests" value="wtp-wst-Automated-Tests-${buildId}.zip" else="wtp-wst-Automated-Tests-${buildType}-${buildId}-${timestamp}.zip">
<available file="${local.cache.dir}/wtp-wst-Automated-Tests-${buildId}.zip"/>
</condition>
<condition property="wtp-jst-tests" value="wtp-jst-Automated-Tests-${buildId}.zip" else="wtp-jst-Automated-Tests-${buildType}-${buildId}-${timestamp}.zip">
<available file="${local.cache.dir}/wtp-jst-Automated-Tests-${buildId}.zip"/>
</condition>
<antcall target="run"/>
</target>
<target name="getReleng">
<property name="releng.tag" value="v${buildType}${timestamp}"/>
<cvs
cvsRoot=":pserver:anonymous@dev.eclipse.org:/cvsroot/webtools"
package="releng"
dest="${testRoot}"
command="export"
tag="${releng.tag}"
/>
</target>
<target name="getDependencies">
<ant antfile="${build.home}/releng.wtpbuilder/distribution/wtp.tests/testdependency.xml">
<property name="base.install.dir" value="${testRoot}"/>
<property name="dependencyTargets" value="${build.home}/releng.wtpbuilder/scripts/dependency/build.xml"/>
</ant>
<antcall target="getAndInstallWTP">
<param name="file" value="wtp-sdk-${buildId}.zip" />
</antcall>
<antcall target="getAndInstallWTP">
<param name="file" value="wtp-sdk-${buildType}-${buildId}-${timestamp}.zip" />
</antcall>
<antcall target="getAndInstallWTP">
<param name="file" value="wtp-wst-Automated-Tests-${buildId}.zip" />
</antcall>
<antcall target="getAndInstallWTP">
<param name="file" value="wtp-wst-Automated-Tests-${buildType}-${buildId}-${timestamp}.zip" />
</antcall>
<antcall target="getAndInstallWTP">
<param name="file" value="wtp-jst-Automated-Tests-${buildId}.zip" />
</antcall>
<antcall target="getAndInstallWTP">
<param name="file" value="wtp-jst-Automated-Tests-${buildType}-${buildId}-${timestamp}.zip" />
</antcall>
</target>
<target name="getAndInstallWTP">
<available file="${local.cache.dir}/${file}" property="file.exists"/>
<antcall target="getWTP"/>
<available file="${local.cache.dir}/${file}" property="file.exists"/>
<antcall target="installWTP"/>
</target>
<target name="getWTP">
<condition property="file.url" value="http://download.eclipse.org/webtools/patches/drops/${buildType}-${buildId}-${timestamp}" else="http://download.eclipse.org/webtools/downloads/drops/${buildType}-${buildId}-${timestamp}">
<isset property="build.committers"/>
</condition>
<antcall target="getWTP2"/>
</target>
<target name="getWTP2" unless="file.exists">
<property name="file.url" value="http://download.eclipse.org/webtools/downloads/drops/${buildType}-${buildId}-${timestamp}"/>
<get dest="${local.cache.dir}/${file}" src="${file.url}/${file}" ignoreerrors="true"/>
</target>
<target name="installWTP" if="file.exists">
<unzip src="${local.cache.dir}/${file}" dest="${testRoot}" overwrite="true"/>
</target>
<target name="run">
<mkdir dir="${testRoot}/results/consolelogs"/>
<copy todir="${testRoot}" flatten="true" overwrite="true">
<fileset dir="${build.home}/releng.wtpbuilder/distribution/wtp.tests/testScripts"/>
</copy>
<ant antfile="${build.home}/releng.wtpbuilder/distribution/wtp.tests/build.xml" target="runTestEclipse">
<property name="testRoot" value="${testRoot}"/>
<property name="testTarget" value="all"/>
</ant>
<copy file="${build.home}/releng.wtpbuilder/distribution/wtp.tests/templateFiles/index.php" todir="${testRoot}/results" overwrite="true"/>
</target>
<target name="upload" if="login">
<mkdir dir="${build.home}/archives"/>
<zip destfile="${build.home}/archives/${buildType}-${buildId}-${timestamp}.zip" basedir="${build.home}/testRoot/results"/>
<condition property="upload.path"
else="~/downloads/webtools/downloads/drops/${buildType}-${buildId}-${timestamp}/testResults/${config}"
value="~/downloads/webtools/patches/drops/${buildType}-${buildId}-${timestamp}/testResults/${config}">
<isset property="build.committers"/>
</condition>
<exec executable="ssh" dir="${build.home}">
<arg line="${login}@download.eclipse.org rm -rf ${upload.path}"/>
</exec>
<exec executable="ssh" dir="${build.home}">
<arg line="${login}@download.eclipse.org mkdir ${upload.path}"/>
</exec>
<exec executable="scp" dir="${build.home}">
<arg line="-r ./testRoot/results ${login}@download.eclipse.org:${upload.path}"/>
</exec>
</target>
<target name="clean" if="clean">
<property file="${build.home}/releng.wtpbuilder/build.properties"/>
<property name="local.cache.dir" value="${build.home}/${build.local.repository}"/>
<property name="testRoot" value="${build.home}/testRoot"/>
<delete dir="${testRoot}" failonerror="false"/>
<delete failonerror="false">
<fileset dir="${local.cache.dir}" includes="wtp-*"/>
</delete>
</target>
</project>