blob: d45f84bfa0cc661fd10892f1173b92ff773f8ce7 [file] [log] [blame]
<project default="main" basedir=".">
<!--
Required inputs:
build.home
buildType
buildId
timestamp
baseos
basews
basearch
build.committers [optional]
releng.tag [optional]
wtp.dir [optional]
clean [optional]
-->
<target name="main">
<property file="${build.home}/releng.wtpbuilder/build.properties"/>
<property name="wtp.api" value="${build.home}/releng.wtpbuilder/distribution/wtp.api"/>
<property name="apiRoot" value="${build.home}/apiRoot"/>
<delete dir="${apiRoot}" failonerror="false"/>
<mkdir dir="${apiRoot}"/>
<antcall target="getReleng"/>
<property file="${apiRoot}/releng/maps/dependencies.properties"/>
<property name="local.cache.dir" value="${build.home}/${build.local.repository}"/>
<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>
<condition property="wtp-wst-tests" value="wtp-wst-Automated-Tests-${buildId}.zip" else="wtp-wst-Automated-Tests-${buildType}-${buildId}-${timestamp}.zip">
<available file="${wtp.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="${wtp.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="${apiRoot}"
command="export"
tag="${releng.tag}"
/>
</target>
<target name="getDependencies">
<antcall target="getAndInstall">
<param name="groupId" value="eclipse" />
</antcall>
<antcall target="getAndInstall">
<param name="groupId" value="eclipseTestFramework" />
<param name="clean" value="true" />
</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="jem" />
</antcall>
<antcall target="getAndInstall">
<param name="groupId" value="tomcat.5" />
</antcall>
<antcall target="getAndInstall">
<param name="groupId" value="jonas.4" />
</antcall>
<antcall target="getAndInstall">
<param name="groupId" value="oagis.release" />
</antcall>
<antcall target="getAndInstall">
<param name="groupId" value="oagis.wsdl" />
</antcall>
<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="get">
<param name="groupId" value="tptp" />
</antcall>
<mkdir dir="${apiRoot}/piagent"/>
<condition property="isLinux">
<equals arg1="${baseos}" arg2="linux"/>
</condition>
<antcall target="setupPIAgent.linux"/>
<antcall target="setupPIAgent.win32"/>
<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>
<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}"/>
</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="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="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" value="http://download.eclipse.org/webtools/committers/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}"/>
<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="setupPIAgent.linux" if="isLinux">
<unzip src="${local.cache.dir}/${tptp.file.linux-gtk-x86}" dest="${apiRoot}/piagent">
<patternset>
<include name="lib/*"/>
</patternset>
</unzip>
<move todir="${apiRoot}/piagent" flatten="true">
<fileset dir="${apiRoot}/piagent/lib"/>
</move>
</target>
<target name="setupPIAgent.win32" unless="isLinux">
<unzip src="${local.cache.dir}/${tptp.file.win32-win32-x86}" dest="${apiRoot}/piagent">
<patternset>
<include name="bin/*"/>
</patternset>
</unzip>
<move todir="${apiRoot}/piagent" flatten="true">
<fileset dir="${apiRoot}/piagent/bin"/>
</move>
</target>
<target name="run">
<cvs
cvsRoot=":pserver:anonymous@dev.eclipse.org:/cvsroot/webtools"
package="releng.builder/tools/apitools/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}/${jem.file} -Duse=${apiRoot}/releng.builder/tools/apitools/adopter_usages -DoutputDir=${apiRoot}/adopters -Xmx256M"/>
</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"/>
<antcall target="runEclipseApp">
<param name="application" value="org.eclipse.wtp.releng.tools.component.core.Java2API"/>
<param name="vmargs" value="-Dsrc=${local.cache.dir}/${eclipse.file.win32-win32-x86} -DoutputDir=${apiRoot}/api-eclipse -Dexcludes=.*internal.*"/>
</antcall>
<antcall target="runEclipseApp">
<param name="application" value="org.eclipse.wtp.releng.tools.component.core.Java2API"/>
<param name="vmargs" value="-Dsrc=${local.cache.dir}/${emf.file} -DoutputDir=${apiRoot}/api-emf -Dexcludes=.*internal.*"/>
</antcall>
<antcall target="runEclipseApp">
<param name="application" value="org.eclipse.wtp.releng.tools.component.core.Java2API"/>
<param name="vmargs" value="-Dsrc=${local.cache.dir}/${gef.file} -DoutputDir=${apiRoot}/api-gef -Dexcludes=.*internal.*"/>
</antcall>
<antcall target="runEclipseApp">
<param name="application" value="org.eclipse.wtp.releng.tools.component.core.Java2API"/>
<param name="vmargs" value="-Dsrc=${local.cache.dir}/${jem.file} -DoutputDir=${apiRoot}/api-jem -Dexcludes=.*internal.*"/>
</antcall>
<antcall target="runEclipseApp">
<param name="application" value="org.eclipse.wtp.releng.tools.component.core.Java2API"/>
<param name="vmargs" value="-Dsrc=${local.cache.dir}/${wtp-sdk} -DoutputDir=${apiRoot}/api-wtp"/>
</antcall>
<antcall target="runJavaMain">
<param name="classname" value="org.eclipse.wtp.releng.tools.component.violation.APIViolationScanner"/>
<param name="args" value="-src ${local.cache.dir}/${wtp-sdk} -api ${apiRoot}/api-eclipse ${apiRoot}/api-emf ${apiRoot}/api-gef ${apiRoot}/api-jem -outputDir ${apiRoot}/apiresults -html -includes org.eclipse.* -excludes org.eclipse.wst.* org.eclipse.jst.* -debug"/>
</antcall>
<antcall target="runJavaMain">
<param name="classname" value="org.eclipse.wtp.releng.tools.component.api.API2ComponentAPI"/>
<param name="args" value="-src ${local.cache.dir}/${wtp-sdk} -api ${local.cache.dir}/${wtp-sdk} -outputDir ${apiRoot}/apiresults -html"/>
</antcall>
<antcall target="runEclipseApp">
<param name="application" value="org.eclipse.wtp.releng.tools.component.core.JavadocScanner"/>
<param name="vmargs" value="-Dsrc=${local.cache.dir}/${wtp-sdk} -DoutputDir=${apiRoot}/apiresults -Dapi=${local.cache.dir}/${wtp-sdk} -Dexcludes=.*internal.* -DskipAPIGen=true -Dhtml=true"/>
</antcall>
<antcall target="runJavaMain">
<param name="classname" value="org.eclipse.wtp.releng.tools.component.api.violation.NonAPIDependencyScanner"/>
<param name="args" value="-src ${local.cache.dir}/${wtp-sdk} -api ${local.cache.dir}/${wtp-sdk} -outputDir ${apiRoot}/apiresults -refapi ${apiRoot}/api-eclipse ${apiRoot}/api-emf ${apiRoot}/api-gef ${apiRoot}/api-jem -includes org.eclipse.* -skipAPIGen"/>
</antcall>
<mkdir dir="${apiRoot}/results/consolelogs"/>
<copy todir="${apiRoot}" overwrite="true">
<fileset dir="${build.home}/releng.wtpbuilder/distribution/wtp.tests/testScripts"/>
</copy>
<copy file="${build.home}/releng.wtpbuilder/distribution/wtp.api/testScripts/test.xml" tofile="${apiRoot}/test.xml" overwrite="true"/>
<ant antfile="${build.home}/releng.wtpbuilder/distribution/wtp.tests/build.xml" target="runTestEclipse">
<property name="testRoot" value="${apiRoot}"/>
<property name="testTarget" value="all"/>
</ant>
<antcall target="runJavaMain">
<param name="classname" value="org.eclipse.wtp.releng.tools.component.tptp.CodeCoverageScanner"/>
<param name="args" value="-api ${local.cache.dir}/${wtp-sdk} -src ${local.cache.dir}/${wtp-sdk} ${local.cache.dir}/${wtp-wst-tests} ${local.cache.dir}/${wtp-jst-tests} -trcxml ${apiRoot}/apiresults/trcxml -outputDir ${apiRoot}/apiresults -skipAPIGen -html"/>
</antcall>
<cvs
cvsRoot=":pserver:anonymous@dev.eclipse.org:/cvsroot/webtools"
package="releng.builder/tools/apitools/api_progress"
dest="${apiRoot}"
command="export"
tag="HEAD"
/>
<antcall target="runJavaMain">
<param name="classname" value="org.eclipse.wtp.releng.tools.component.api.progress.APIProgressScanner"/>
<param name="args" value="-api ${local.cache.dir}/${wtp-sdk} -src ${local.cache.dir}/${wtp-sdk} -outputDir ${apiRoot}/apiresults -progressDir ${apiRoot}/releng.builder/tools/apitools/api_progress/1.0 -timestamp ${timestamp} -excludes .*infopop .*doc.isv .*doc.user .*source org.eclipse.wst org.eclipse.jst"/>
</antcall>
<antcall target="runJavaMain">
<param name="classname" value="org.eclipse.wtp.releng.tools.component.tptp.CodeCoverageScanner"/>
<param name="args" value="-api ${apiRoot}/api-wtp -src ${local.cache.dir}/${wtp-sdk} ${local.cache.dir}/${wtp-wst-tests} ${local.cache.dir}/${wtp-jst-tests} -trcxml ${apiRoot}/apiresults/trcxml -outputDir ${apiRoot}/apiresults/full_test_coverage -html"/>
</antcall>
</target>
<target name="runEclipseApp">
<property name="vmargs" value=""/>
<java classpath="${apiRoot}/eclipse/startup.jar" fork="true" classname="org.eclipse.core.launcher.Main" failonerror="true" timeout="3600000" dir="${apiRoot}">
<jvmarg value="-Dosgi.ws=${basews}" />
<jvmarg value="-Dosgi.os=${baseos}" />
<jvmarg value="-Dosgi.arch=${basearch}" />
<jvmarg value="-Dws=${basews}" />
<jvmarg value="-Dos=${baseos}" />
<jvmarg value="-Darch=${basearch}" />
<jvmarg value="-Xmx256M" />
<jvmarg line="${vmargs}" />
<arg value="-application" />
<arg value="${application}" />
</java>
</target>
<target name="runJavaMain">
<java fork="true" classname="${classname}" failonerror="false" timeout="3600000" dir="${apiRoot}">
<classpath>
<fileset dir="${apiRoot}/eclipse/plugins">
<include name="**/org.eclipse.wtp.releng.tools.component.core*.jar"/>
</fileset>
<fileset dir="${apiRoot}/lib">
<include name="**/org.eclipse.jdt.core*.jar"/>
<include name="**/org.eclipse.core.runtime*.jar"/>
<include name="**/org.eclipse.core.resources*.jar"/>
<include name="**/org.eclipse.text*.jar"/>
</fileset>
</classpath>
<jvmarg value="-Xmx256M"/>
<arg line="${args}"/>
</java>
</target>
<target name="upload" if="login">
<mkdir dir="${build.home}/archives"/>
<zip destfile="${build.home}/archives/${buildType}-${buildId}-${timestamp}.zip" basedir="${build.home}/apiRoot/apiresults"/>
<condition property="upload.path"
else="${login}@download1.eclipse.org:~/downloads/webtools/downloads/drops/${buildType}-${buildId}-${timestamp}"
value="${login}@download1.eclipse.org:~/downloads/webtools/committers/drops/${buildType}-${buildId}-${timestamp}">
<isset property="build.committers"/>
</condition>
<exec executable="scp" dir="${build.home}">
<arg line="-r ./apiRoot/apiresults ${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="apiRoot" value="${build.home}/apiRoot"/>
<property name="wtp.dir" value="${local.cache.dir}"/>
<delete dir="${apiRoot}" failonerror="false"/>
<delete failonerror="false">
<fileset dir="${wtp.dir}" includes="wtp-*"/>
</delete>
</target>
</project>