blob: 7a487eb62c3bc7c3ad345f06b3fa83c5951e5600 [file] [log] [blame]
<project
default="main"
basedir=".">
<!--
Required inputs: build.home buildType buildId timestamp
build.stream [optional] build.committers [optional] testTarget
[optional]
-->
<property
environment="env"/>
<property
name="keyCfgFile"
value="${env.PROJECT_BUILDERS}/${projectname}/${env.RELENG}/maps/build.cfg"/>
<property
name="build.home"
value="${env.BUILD_HOME}"/>
<echo
level="info"
message="keyCfgFile: ${keyCfgFile}"/>
<!-- required to get proper value of dropinsFolder -->
<property
file="${keyCfgFile}"/>
<fail
message="testRoot must be set for this task"
unless="env.PROJECT_TESTS"/>
<property
name="testRoot"
value="${env.PROJECT_TESTS}"/>
<target
name="main">
<property
file="${build.home}/${env.RELENG_BUILDER}/build.properties"/>
<property
name="local.cache.dir"
value="${env.LOCAL_PREREQS_CACHE}"/>
<property
name="testRoot"
value="${build.home}/testRoot"/>
<delete
dir="${testRoot}"
failonerror="false"/>
<mkdir
dir="${testRoot}"/>
<antcall
target="getReleng"/>
<fail
message="Required file does not exist: ${env.PROJECT_BUILDERS}/${projectname}/${env.RELENG}/maps/dependencies.properties">
<condition>
<not>
<available
file="${env.PROJECT_BUILDERS}/${projectname}/${env.RELENG}/maps/dependencies.properties"/>
</not>
</condition>
</fail>
<property
file="${env.PROJECT_BUILDERS}/${projectname}/${env.RELENG}/maps/dependencies.properties"/>
<antcall
target="getDependencies"/>
<antcall
target="run"/>
</target>
<target
name="getReleng">
<property
name="releng.tag"
value="v${buildType}${timestamp}"/>
<mkdir
dir="${env.PROJECT_BUILDERS}/${projectname}"/>
<cvs
cvsRoot=":pserver:anonymous@dev.eclipse.org:/cvsroot/webtools"
package="${env.RELENG}"
dest="${env.PROJECT_BUILDERS}/${projectname}"
command="export"
tag="${releng.tag}"
quiet="${env.CVS_QUIET}"
reallyquiet="${env.CVS_REALLY_QUIET}"/>
</target>
<target
name="getDependencies">
<ant
antfile="${build.home}/${env.RELENG_BUILDER}/distribution/wtp.tests/testdependency.xml">
<property
name="base.install.dir"
value="${testRoot}"/>
<property
name="dependencyTargets"
value="${build.home}/${env.RELENG_BUILDER}/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-Automated-Tests-${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.1"
value="http://build.eclipse.org/webtools/committers/${projectname}/${timestamp}"
else="http://download.eclipse.org/webtools/downloads">
<isset
property="build.committers"/>
</condition>
<condition
property="file.url"
value="${file.url.1}/${buildType}-${buildId}-${timestamp}"
else="${file.url.1}/drops/${buildType}-${buildId}-${timestamp}">
<isset
property="build.stream"/>
</condition>
<antcall
target="getWTP2"/>
</target>
<target
name="getWTP2"
unless="file.exists">
<property
name="file.url"
value="http://download.eclipse.org/webtools/downloads/drops/${build.stream}/${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}${dropinsFolder}"
overwrite="true"/>
</target>
<target
name="run">
<mkdir
dir="${testRoot}/results/consolelogs"/>
<copy
todir="${testRoot}"
flatten="true"
overwrite="true">
<fileset
dir="${build.home}/${env.RELENG_BUILDER}/distribution/wtp.tests/testScripts"/>
</copy>
<ant
antfile="${build.home}/${env.RELENG_BUILDER}/distribution/wtp.tests/build.xml"
target="runTestEclipse">
<property
name="testRoot"
value="${testRoot}"/>
<!-- if not otherwise set, assume all tests -->
<property
name="testTarget"
value="all"/>
</ant>
<copy
file="${build.home}/${env.RELENG_BUILDER}/distribution/wtp.tests/templateFiles/index.php"
todir="${testRoot}/results"
overwrite="true"/>
</target>
<target
name="clean"
if="clean">
<property
file="${build.home}/${env.RELENG_BUILDER}/build.properties"/>
<property
name="testRoot"
value="${build.home}/testRoot"/>
<delete
dir="${testRoot}"
failonerror="false"/>
</target>
</project>