blob: 91e5ffb1a188b448e061f9512430510663022815 [file] [log] [blame]
<project default="main" basedir=".">
<!--
Required inputs:
build.home
buildType
buildId
timestamp
env.BASEOS
env.BASEWS
env.BASEARCH
build.stream [optional]
build.committers [optional]
wtp.dir [optional]
-->
<!-- Note to be cross-platform, "environment variables" are only appropriate for
some variables, e.g. ones we set, since properties are case sensitive, even if
the environment variables on your operating system are not, e.g. it will
be ${env.Path} not ${env.PATH} on Windows -->
<property environment="env" />
<target name="main">
<property file="${build.home}/releng.wtpbuilder/build.properties"/>
<property name="apiRoot" value="${build.home}/adopterScanRoot"/>
<delete dir="${apiRoot}" failonerror="false"/>
<mkdir dir="${apiRoot}"/>
<antcall target="getReleng"/>
<property file="${apiRoot}/releng/maps/dependencies.properties"/>
<property name="local.cache.dir" value="${env.LOCAL_PREREQS_CACHE}"/>
<property name="wtp.dir" value="${local.cache.dir}"/>
<property name="install.destination" value="${apiRoot}"/>
<antcall target="getDependencies"/>
<condition property="wtp-sdk" value="wtp-sdk-${buildId}.zip" else="wtp-sdk-${buildType}-${buildId}-${timestamp}.zip">
<available file="${wtp.dir}/wtp-sdk-${buildId}.zip"/>
</condition>
<antcall target="run"/>
<antcall target="upload"/>
<antcall target="clean"/>
</target>
<target name="getReleng">
<property name="releng.tag" value="v${buildType}${timestamp}"/>
<cvs
cvsRoot=":pserver:anonymous@dev.eclipse.org:/cvsroot/webtools"
package="releng"
dest="${apiRoot}"
command="export"
tag="${releng.tag}"
/>
</target>
<target name="getDependencies">
<condition property="isLinux">
<equals arg1="${baseos}" arg2="linux"/>
</condition>
<antcall target="getAndInstall">
<param name="groupId" value="eclipse" />
</antcall>
<antcall target="getAndInstall">
<param name="groupId" value="emf" />
</antcall>
<antcall target="getAndInstall">
<param name="groupId" value="gef" />
</antcall>
<antcall target="getAndInstall">
<param name="groupId" value="dtp" />
</antcall>
<!-- this appears to be pretty explict hard coding for windows machines.
I wonder why the usual "get dependencies" methods would not work?
-->
<antcall target="get">
<param name="groupId" value="eclipse" />
<param name="baseos" value="win32" />
<param name="basews" value="win32" />
<param name="basearch" value="x86" />
</antcall>
<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>
<delete file="${local.cache.dir}/wtp-apiscanner.zip"/>
<get src="http://download.eclipse.org/webtools/downloads/wtp-apiscanner.zip" dest="${local.cache.dir}/wtp-apiscanner.zip"/>
<unzip src="${local.cache.dir}/wtp-apiscanner.zip" dest="${apiRoot}"/>
<!-- get path to equinox jar inside ${eclipse.home} folder (copy/rename actual jar) -->
<copy failonerror="false" tofile="${apiRoot}/eclipse/startup.jar">
<fileset dir="${apiRoot}/eclipse/plugins"
includes="**/org.eclipse.equinox.launcher_*.jar" />
</copy>
</target>
<target name="getAndInstall">
<property name="dependencyTargets" value="${build.home}/releng.wtpbuilder/scripts/dependency/build.xml"/>
<ant antfile="${dependencyTargets}" target="checkDependency">
<property name="groupId" value="${groupId}" />
</ant>
<ant antfile="${dependencyTargets}" target="installDependency">
<property name="groupId" value="${groupId}" />
</ant>
</target>
<target name="get">
<property name="dependencyTargets" value="${build.home}/releng.wtpbuilder/scripts/dependency/build.xml"/>
<ant antfile="${dependencyTargets}" target="checkDependency">
<property name="groupId" value="${groupId}" />
</ant>
</target>
<target name="getAndInstallWTP">
<available file="${wtp.dir}/${file}" property="file.exists"/>
<antcall target="getWTP"/>
<available file="${wtp.dir}/${file}" property="file.exists"/>
<antcall target="installWTP"/>
</target>
<target name="getWTP">
<condition property="file.url.1" value="http://download.eclipse.org/webtools/committers" else="http://download.eclipse.org/webtools/downloads">
<isset property="build.committers"/>
</condition>
<condition property="file.url" value="${file.url.1}/drops/${build.stream}/${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}"/>
<mkdir dir="${wtp.dir}"/>
<get dest="${wtp.dir}/${file}" src="${file.url}/${file}" ignoreerrors="true"/>
</target>
<target name="installWTP" if="file.exists">
<unzip src="${wtp.dir}/${file}" dest="${install.destination}" overwrite="true"/>
</target>
<target name="run">
<cvs
cvsRoot=":pserver:anonymous@dev.eclipse.org:/cvsroot/webtools"
package="releng.wtptools/api/adopter_usages"
dest="${apiRoot}"
command="export"
tag="HEAD"
/>
<mkdir dir="${apiRoot}/adopters"/>
<antcall target="runEclipseApp">
<param name="application" value="org.eclipse.wtp.releng.tools.component.core.APIRefCompatibilityScanner"/>
<param name="vmargs" value="-Dsrc=${local.cache.dir}/${wtp-sdk},${local.cache.dir}/${eclipse.file.win32-win32-x86},${local.cache.dir}/${emf.file},${local.cache.dir}/${gef.file},${local.cache.dir}/${dtp.file} -Duse=${apiRoot}/releng.wtptools/api/adopter_usages -DoutputDir=${apiRoot}/adopters -Xmx512M"/>
</antcall>
<copy tofile="${apiRoot}/apiresults/api-ref-compatibility.html" file="${apiRoot}/adopters/api-ref-compatibility.html"/>
<copy tofile="${apiRoot}/apiresults/api-ref-compatibility.xml" file="${apiRoot}/adopters/api-ref-compatibility.xml"/>
</target>
<target name="runEclipseApp">
<property name="vmargs" value=""/>
<java jar="${apiRoot}/eclipse/startup.jar" fork="true" failonerror="true" timeout="3600000" dir="${apiRoot}">
<jvmarg value="-Dosgi.ws=${env.BASEWS}" />
<jvmarg value="-Dosgi.os=${env.BASEOS}" />
<jvmarg value="-Dosgi.arch=${env.BASEARCH}" />
<jvmarg value="-Xmx512M" />
<jvmarg line="${vmargs}" />
<arg value="-application" />
<arg value="${application}" />
</java>
</target>
<target name="upload" if="login">
<mkdir dir="${build.home}/archives"/>
<zip destfile="${build.home}/archives/${buildType}-${buildId}-${timestamp}.zip" basedir="${apiRoot}/apiresults"/>
<condition property="upload.path.1"
else="${login}@build.eclipse.org:~/downloads/webtools/downloads"
value="${login}@build.eclipse.org:~/downloads/webtools/committers">
<isset property="build.committers"/>
</condition>
<condition property="upload.path"
else="${upload.path.1}/drops/${buildType}-${buildId}-${timestamp}"
value="${upload.path.1}/drops/${build.stream}/${buildType}-${buildId}-${timestamp}">
<isset property="build.stream"/>
</condition>
<exec executable="scp" dir="${build.home}">
<arg line="-r ./adopterScanRoot/apiresults ${upload.path}"/>
</exec>
</target>
<target name="clean" if="clean">
<delete failonerror="false">
<fileset dir="${env.LOCAL_PREREQS_CACHE}" includes="wtp-*"/>
</delete>
</target>
</project>