blob: 8180753d2c2839e92691a0e79090cadd289e8ee6 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2009 Tasktop Technologies and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
Contributors:
Tasktop Technologies - initial API and implementation
-->
<project name="build" default="all" basedir=".">
<property file="${build.config}" />
<property file="local.properties" />
<import file="scripts/os.xml" />
<property file="defaults.properties" />
<property file="scripts/defaults-all.properties" />
<import file="scripts/functions.xml" />
<target name="all" depends="clean,build,standalone-tests,tests">
</target>
<target name="pack-all" depends="init">
<antcall target="for-each-target">
<param name="call" value="pack-sites"/>
</antcall>
</target>
<target name="pack-sites" depends="init">
<antcall target="pack">
<param name="dir" value="${build.home}/${base.target}/standardUpdateSite"/>
</antcall>
<antcall target="pack">
<param name="dir" value="${build.home}/${base.target}/extrasUpdateSite"/>
</antcall>
<antcall target="pack">
<param name="dir" value="${build.home}/${base.target}/incubatorUpdateSite"/>
</antcall>
</target>
<target name="pack-dist-sites" depends="init">
<antcall target="pack">
<param name="dir" value="${build.home}/3.6/standardUpdateSite"/>
</antcall>
<antcall target="pack">
<param name="dir" value="${build.home}/3.4/extrasUpdateSite"/>
</antcall>
<antcall target="pack">
<param name="dir" value="${build.home}/3.4/incubatorUpdateSite"/>
</antcall>
</target>
<target name="generate-metadata-all" depends="init">
<antcall target="for-each-target">
<param name="call" value="generate-metadata-sites"/>
</antcall>
</target>
<target name="generate-metadata-sites" depends="init">
<condition property="label" value="3.3" else="3.4, 3.5 and 3.6"><equals arg1="${base.target}" arg2="3.3"/></condition>
<antcall target="generate-metadata">
<param name="dir" value="${build.home}/${base.target}/standardUpdateSite"/>
<param name="name" value="Mylyn Weekly for Eclipse ${label}"/>
</antcall>
<antcall target="generate-metadata">
<param name="dir" value="${build.home}/${base.target}/extrasUpdateSite"/>
<param name="name" value="Mylyn Weekly Extras"/>
</antcall>
<antcall target="generate-metadata">
<param name="dir" value="${build.home}/${base.target}/incubatorUpdateSite"/>
<param name="name" value="Mylyn Weekly Incubator"/>
</antcall>
</target>
<target name="generate-metadata-dist-sites" depends="init">
<antcall target="generate-metadata">
<param name="dir" value="${build.home}/3.6/standardUpdateSite"/>
<param name="name" value="Mylyn Weekly for Eclipse 3.4, 3.5 and 3.6"/>
</antcall>
<antcall target="generate-metadata">
<param name="dir" value="${build.home}/3.4/extrasUpdateSite"/>
<param name="name" value="Mylyn Weekly Extras"/>
</antcall>
<antcall target="generate-metadata">
<param name="dir" value="${build.home}/3.4/incubatorUpdateSite"/>
<param name="name" value="Mylyn Weekly Incubator"/>
</antcall>
</target>
<target name="publish" depends="init">
<antcall target="for-each-target">
<param name="call" value="publish-helper"/>
<param name="skip3.3" value="true"/>
<param name="skip3.4" value="true"/>
<param name="skip3.6" value="true"/>
</antcall>
<antcall target="for-each-target">
<param name="call" value="publish-helper-standalone"/>
</antcall>
</target>
<target name="publish-helper">
<antcall target="publish-helper-run">
<param name="file" value="org.eclipse.mylyn.tests.AllTests-${base.target}.xml"/>
<param name="tag" value="[e${base.target}]"/>
</antcall>
<antcall target="publish-helper-run">
<param name="file" value="org.eclipse.mylyn.tests.AllUiTests-${base.target}.xml"/>
<param name="tag" value="[e${base.target}-ui]"/>
</antcall>
<antcall target="publish-helper-run">
<param name="file" value="org.eclipse.mylyn.tests.AllPerformanceTests-${base.target}.xml"/>
<param name="tag" value="[e${base.target}-perf]"/>
</antcall>
</target>
<target name="publish-helper-standalone">
<antcall target="publish-helper-run">
<param name="file" value="TEST-*-${base.target}.xml"/>
<param name="tag" value="[stdl]"/>
</antcall>
</target>
<target name="publish-helper-run">
<path id="file.id">
<fileset dir="${build.results}">
<include name="test-results/${file}"/>
</fileset>
</path>
<property name="file.path" refid="file.id"/>
<condition property="file.available"><not><equals arg1="${file.path}" arg2="" trim="true"/></not></condition>
<antcall target="publish-helper-report"/>
</target>
<target name="publish-helper-report" if="file.available">
<java jar="${build.reporter.jar}" failonerror="false" fork="true" jvm="${build.reporter.jvm}">
<arg value="-config" />
<arg value="${build.reporter.config}" />
<arg value="-build" />
<arg value="${qualifier}"/>
<arg value="-tag"/>
<arg value="${tag}"/>
<arg value="${file.path}" />
</java>
</target>
<target name="dist" depends="init,pack-all,generate-metadata-all,copy-to-archive">
</target>
<target name="dist-sites" depends="init,pack-dist-sites,generate-metadata-dist-sites,copy-to-archive">
</target>
<target name="copy-to-archive">
<property name="dist.dir" value="${dist.home}/update-archive/${version}/${qualifier}" />
<copy todir="${dist.dir}/e3.4">
<!-- need to use discovery plug-ins from the 3.6 site -->
<fileset dir="${build.home}/3.6/standardUpdateSite"/>
</copy>
<copy todir="${dist.dir}/extras">
<fileset dir="${build.home}/3.4/extrasUpdateSite"/>
</copy>
<copy todir="${dist.dir}/incubator">
<fileset dir="${build.home}/3.4/incubatorUpdateSite"/>
</copy>
<!-- need to use discovery plug-ins from the 3.5 site -->
<copy tofile="${dist.dir}/mylyn-${version}.${qualifier}-e3.4.zip" file="${build.home}/3.6/mylyn-${version}.${qualifier}-e3x-standard.zip" />
<copy tofile="${dist.dir}/mylyn-${version}.${qualifier}-extras.zip" file="${build.home}/3.4/mylyn-${version}.${qualifier}-e3x-extras.zip" />
<copy tofile="${dist.dir}/mylyn-${version}.${qualifier}-incubator.zip" file="${build.home}/3.4/mylyn-${version}.${qualifier}-e3x-incubator.zip" />
<copy tofile="${dist.dir}/mylyn-wikitext-standalone-${version}.${qualifier}.zip" file="${build.home}/3.4/mylyn-wikitext-standalone-${version}.${qualifier}.zip" />
<antcall target="fix-permissions">
<param name="dir" value="${dist.dir}"/>
</antcall>
</target>
<target name="weekly" depends="clean,build,dist">
<antcall target="promote">
<param name="todir" value="weekly"/>
</antcall>
</target>
<target name="dev" depends="clean,build,dist">
<antcall target="promote">
<param name="todir" value="dev"/>
</antcall>
</target>
<target name="sign" depends="init,init-scripts">
<exec executable="bin/sign-update-site.sh" failonerror="true">
<arg value="${version}"/>
<arg value="${qualifier}"/>
</exec>
</target>
<target name="helios" depends="clean,build,generate-metadata-all,copy-to-archive">
<!-- promote unpacked version early for testing -->
<antcall target="promote">
<param name="todir" value="weekly"/>
</antcall>
<antcall target="sign"/>
<!-- re-promote signed and packed version -->
<antcall target="promote">
<param name="todir" value="weekly"/>
</antcall>
<echo>Run 'ant promote-helios' to update the helios site.</echo>
<echo>Ensure that the mylyn.build file is updated at the same time.</echo>
<!--
<antcall target="promote-main">
<param name="todir" value="helios"/>
</antcall>
-->
</target>
<target name="promote-helios">
<antcall target="promote-main">
<param name="todir" value="helios"/>
</antcall>
</target>
<target name="promote" depends="init">
<fail message="Required property 'todir' not set" unless="todir"/>
<property name="dist.dir" value="${dist.home}/update-archive/${version}/${qualifier}" />
<property name="target.dir" value="${dist.home}/update/${todir}" />
<delete dir="${target.dir}.old" />
<move file="${target.dir}" todir="${target.dir}.old" failonerror="false"/>
<copy todir="${target.dir}">
<fileset dir="${dist.dir}"/>
</copy>
<!-- not supported on build.eclipse.org
<move todir="${target.dir}">
<fileset dir="${target.dir}">
<include name="*.zip"/>
</fileset>
<mapper type="regexp" from="(.*)${version}.${qualifier}(.*)" to="\1latest\2"/>
</move>
-->
<move tofile="${target.dir}/mylyn-latest-e3.4.zip" file="${target.dir}/mylyn-${version}.${qualifier}-e3.4.zip" />
<move tofile="${target.dir}/mylyn-latest-extras.zip" file="${target.dir}/mylyn-${version}.${qualifier}-extras.zip" />
<move tofile="${target.dir}/mylyn-latest-incubator.zip" file="${target.dir}/mylyn-${version}.${qualifier}-incubator.zip" />
<move tofile="${target.dir}/mylyn-wikitext-standalone-latest.zip" file="${target.dir}/mylyn-wikitext-standalone-${version}.${qualifier}.zip" />
<antcall target="fix-permissions">
<param name="dir" value="${target.dir}"/>
</antcall>
</target>
<target name="promote-main" depends="init">
<fail message="Required property 'todir' not set" unless="todir"/>
<property name="dist.dir" value="${dist.home}/update-archive/${version}/${qualifier}" />
<property name="target.dir" value="${dist.home}/update/${todir}" />
<copy todir="${target.dir}">
<fileset dir="${dist.dir}">
<include name="mylyn-${version}.${qualifier}-e3.4.zip"/>
</fileset>
<fileset dir="${dist.dir}/e3.4"/>
</copy>
<antcall target="fix-permissions">
<param name="dir" value="${target.dir}"/>
</antcall>
</target>
<target name="update-wikitext-versions">
<loadfile property="version.wikitext" srcFile="../org.eclipse.mylyn.wikitext.core/META-INF/MANIFEST.MF">
<filterchain>
<linecontains>
<contains value="Bundle-Version: "/>
</linecontains>
<striplinebreaks/>
<tokenfilter>
<filetokenizer/>
<replaceregex pattern="Bundle-Version: ([0-9.]*).qualifier"
flags="s"
replace="\1"/>
</tokenfilter>
</filterchain>
</loadfile>
<echo message="Current WikiText version: ${version.wikitext}"></echo>
<fail message="Use -DnewWikiTextVersion=x.y.z to set new WikiText version." unless="newWikiTextVersion"/>
<echo message="New WikiText version: ${newWikiTextVersion}"></echo>
<replace dir="..">
<replacefilter
token="${version.wikitext}.qualifier"
value="${newWikiTextVersion}.qualifier"/>
<include name="org.eclipse.mylyn.wikitext*/**/MANIFEST.MF"/>
<include name="org.eclipse.mylyn.wikitext*/**/feature.xml"/>
</replace>
</target>
<target name="update-versions">
<loadfile property="version.mylyn" srcFile="../org.eclipse.mylyn/META-INF/MANIFEST.MF">
<filterchain>
<linecontains>
<contains value="Bundle-Version: "/>
</linecontains>
<striplinebreaks/>
<tokenfilter>
<filetokenizer/>
<replaceregex pattern="Bundle-Version: ([0-9.]*).qualifier"
flags="s"
replace="\1"/>
</tokenfilter>
</filterchain>
</loadfile>
<echo message="Current Mylyn version: ${version.mylyn}"></echo>
<fail message="Use -DnewVersion=x.y.z to set new version." unless="newVersion"/>
<echo message="New Mylyn version: ${newVersion}"></echo>
<replace dir="..">
<replacefilter
token="${version.mylyn}.qualifier"
value="${newVersion}.qualifier"/>
<replacefilter
token="${version.mylyn}.mylynQualifier"
value="${newVersion}.mylynQualifier"/>
<include name="org.eclipse.mylyn*/**/MANIFEST.MF"/>
<include name="org.eclipse.mylyn*/**/feature.xml"/>
</replace>
</target>
<target name="pre-build">
<delete failonerror="false">
<fileset dir="${build.home}/${base.target}/maps" includes="mylyn*.map">
<exclude name="*${base.target}.map"/>
<exclude name="*all.map"/>
</fileset>
</delete>
<property name="build.extraBuildArgs" value="-DmylynQualifier=${qualifier}"/>
<condition property="versionPostfix" value="e33" else="e3x"><equals arg1="${base.target}" arg2="3.3"/></condition>
<property name="build.forceContextQualifier" value="${qualifier}-${versionPostfix}" />
</target>
<target name="pre-tests">
<delete failonerror="false" includeemptydirs="true">
<fileset dir="${eclipse.home}">
<include name="features/org.eclipse.mylyn*/**"/>
<include name="plugins/org.eclipse.mylyn*/**"/>
</fileset>
</delete>
<!--
<exec executable="${build.test.x.command}" spawn="true" failifexecutionfails="false" failonerror="false">
<arg value="${build.test.x.display}"/>
</exec>
-->
</target>
<target name="post-report">
<available property="standalone.exists" file="${results.home}/TEST-org.eclipse.mylyn.tests.AllHeadlessStandaloneTests.xml"/>
<antcall target="post-report-standalone-tests"/>
</target>
<target name="post-report-standalone-tests" if="standalone.exists">
<junitreport todir="${results.home}" >
<fileset dir="${results.home}">
<include name="TEST-*.xml" />
</fileset>
<report format="noframes" todir="${results.home}"/>
</junitreport>
<delete file="${results.home}/TESTS-TestSuites.xml"/>
<move file="${results.home}/junit-noframes.html" tofile="${results.home}/standalone-tests.html"/>
</target>
<target name="discovery">
<cvs cvsRoot=":pserver:anonymous@dev.eclipse.org:/cvsroot/tools"
package="org.eclipse.mylyn/org.eclipse.mylyn.discovery-directory"
dest="${build.home}" />
<property name="discovery.dir" value="${build.home}/org.eclipse.mylyn/org.eclipse.mylyn.discovery-directory"/>
<extract-version property="discovery.version" file="${discovery.dir}/META-INF/MANIFEST.MF"/>
<echo>Detected discovery directory ${discovery.version}</echo>
<property name="discovery.jar" value="${dist.home}/discovery/org.eclipse.mylyn.discovery_${discovery.version}.jar"/>
<available property="discovery.exists" file="${discovery.jar}"/>
<antcall target="discovery-update"/>
<copy file="${discovery.jar}" tofile="${dist.home}/discovery/org.eclipse.mylyn.discovery-3.3.jar"/>
</target>
<target name="discovery-update" unless="discovery.exists">
<jar destfile="${discovery.jar}">
<fileset dir="${discovery.dir}"/>
</jar>
</target>
<target name="mirror" unless="mirror.exists">
<antcall target="ant-helper">
<param name="buildfile" value="${basedir}/build.xml"/>
<param name="targets" value="mirror-p2"/>
<param name="extraArgs" value="-Dlocation=file://${build.home}/mirror-p2"/>
</antcall>
</target>
<target name="mirror-p2">
<!-- P2 fails with OOM if directory already exists: bug 280147 -->
<!--<delete dir="${location}" failonerror="false"/>-->
<p2.mirror verbose="true">
<repository location="${location}" name="Mirror" />
<source>
<repository location="http://download.eclipse.org/tools/mylyn/update/e3.4" />
<repository location="http://download.eclipse.org/releases/ganymede" />
</source>
<iu id="org.eclipse.mylyn_feature.feature.group"/>
<iu id="org.eclipse.mylyn.context_feature.feature.group"/>
<slicingoptions includeFeatures="false" followStrict="true"/>
</p2.mirror>
</target>
</project>