| <?xml version="1.0" encoding="UTF-8" ?> |
| <!-- |
| Copyright (c) 2010-2012 Cloudsmith Inc, Martin Taal (Doorn, The Netherlands) 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: |
| Cloudsmith Inc - build.xml for Buckminster project |
| Martin Taal - changes for Texo |
| |
| Some important parts have been copied from Buckminster's own |
| build setup: |
| http://dev.eclipse.org/viewsvn/index.cgi/trunk/org.eclipse.buckminster.releng/build.xml?root=Tools_BUCKMINSTER&view=markup |
| --> |
| <project default="build.and.test" name="Texo Builds"> |
| <!-- load properties and set timestamp for the build --> |
| <property environment="env" /> |
| |
| <tstamp> |
| <format property="buildTimestamp" pattern="yyyyMMddHHmm" /> |
| </tstamp> |
| |
| <property file="buckminster.properties" /> |
| |
| <condition property="hudsonWorkSpacePath" value="${env.WORKSPACE}" else="${basedir}/../../"> |
| <isset property="env.WORKSPACE" /> |
| </condition> |
| |
| <condition property="texo.update.site.type" value="${env.TEXO_UPDATE_SITE_TYPE}" else="interim"> |
| <isset property="env.TEXO_UPDATE_SITE_TYPE" /> |
| </condition> |
| |
| <condition property="site.pack200" value="${env.SITE_PACK200}" else="false"> |
| <isset property="env.SITE_PACK200" /> |
| </condition> |
| |
| <condition property="buckminster.loglevel" value="${env.BUCKMINSTER_LOGLEVEL}" else="info"> |
| <isset property="env.BUCKMINSTER_LOGLEVEL" /> |
| </condition> |
| |
| <condition property="texo.version" value="${env.VERSION}" else="0.9.0"> |
| <isset property="env.VERSION" /> |
| </condition> |
| |
| <condition property="clean.tools" value="true"> |
| <equals arg1="${env.CLEAN_TOOLS}" arg2="true" /> |
| </condition> |
| |
| <!-- Is used in buck.minster also --> |
| <condition property="build.type" value="${env.BUILDTYPE}" else="N"> |
| <isset property="env.BUILDTYPE" /> |
| </condition> |
| |
| <condition property="no.proxy" value="${env.no_proxy}, dev.eclipse.org" else="dev.eclipse.org"> |
| <isset property="env.no_proxy" /> |
| </condition> |
| |
| <property name="buildsPath" location="${hudsonWorkSpacePath}/build" /> |
| <property name="tempPath" location="${buildsPath}/temp-files" /> |
| <property name="resultP2Site" location="/jobs/genie.texo/emft-texo-nightly/lastSuccessful/archive/build/result/p2site" /> |
| <property name="gitPath" location="${hudsonWorkSpacePath}/git" /> |
| |
| <!--property name="rootPath" location="${buildsPath}/${build.type}${buildTimestamp}"/--> |
| <property name="rootPath" location="${buildsPath}" /> |
| |
| <property name="buildPath" location="${rootPath}/build" /> |
| <property name="thirdPartyPath" location="${rootPath}/thirdparty" /> |
| <property name="generatePath" location="${rootPath}/generate" /> |
| <property name="testPath" location="${rootPath}/test" /> |
| <property name="toolsPath" location="${rootPath}/tools" /> |
| <property name="promotePath" location="${rootPath}/promote/${build.type}${buildTimestamp}" /> |
| <property name="resultPath" location="${rootPath}/result" /> |
| <property name="mavenPath" location="${rootPath}/result/maven" /> |
| <property name="buildSitePath" location="${resultPath}/p2site" /> |
| <property name="buildZipsPath" location="${resultPath}/zips" /> |
| <property name="testResultsPath" location="${resultPath}/test" /> |
| |
| <property name="promoteUpdateSite" location="${texo.download.area}/updates/${texo.update.site.type}" /> |
| <property name="promoteDropsLocation" location="${texo.download.area}/downloads/drops" /> |
| |
| <property name="buckminster.output.root" location="${rootPath}/output" /> |
| <property name="buckminster.temp.root" location="${rootPath}/temp" /> |
| |
| <condition property="site.signing" value="${env.SITE_SIGNING}" else="false"> |
| <isset property="env.SITE_SIGNING" /> |
| </condition> |
| <echo message="site.signing = ${site.signing}" /> |
| <property name="eclipse.staging.area" |
| value="/shared/download-staging.priv/modeling/emf/texo/emft-texo-nightly" /> |
| |
| <import file="ant_common.xml" /> |
| |
| <import file="maven/ant_maven.xml" /> |
| |
| <target name="publish"> |
| <mkdir dir="/home/data/httpd/archive.eclipse.org/modeling/emft/texo/updates/interim/${buildTimestamp}"/> |
| <!-- if previous copy failed it is possible that interim build has been removed --> |
| <mkdir dir="/home/data/httpd/download.eclipse.org/modeling/emft/texo/updates/interim"/> |
| <move todir="/home/data/httpd/archive.eclipse.org/modeling/emft/texo/updates/interim/${buildTimestamp}"> |
| <fileset dir="/home/data/httpd/download.eclipse.org/modeling/emft/texo/updates/interim"/> |
| </move> |
| <mkdir dir="/home/data/httpd/download.eclipse.org/modeling/emft/texo/updates/interim"/> |
| <copy todir="/home/data/httpd/download.eclipse.org/modeling/emft/texo/updates/interim"> |
| <fileset dir="${resultP2Site}/"/> |
| </copy> |
| </target> |
| |
| <target name="build.and.test" depends="init, get.thirdparty, init.checks, install.buckminster"> |
| <ant dir="${basedir}/build" antfile="texo_build.xml" target="run" inheritRefs="true" /> |
| |
| <ant dir="${basedir}/test" antfile="texo_test.xml" target="run" inheritRefs="true" /> |
| |
| <computeVersionQualifier directory="${rootPath}/output/org.eclipse.emf.texo_${texo.version}-osgi.bundle/jar" pattern="org.eclipse.emf.texo*.jar"/> |
| |
| <echo message="Creating maven jars with versionQualifier ${versionQualifier}" /> |
| |
| <property name="mavenVersion" value="${texo.version}-${versionQualifier}" /> |
| <property name="texoVersion" value="${texo.version}.${versionQualifier}" /> |
| |
| <texo.maven name="org.eclipse.emf.texo"/> |
| <texo.maven name="org.eclipse.emf.texo.datagenerator"/> |
| <texo.maven name="org.eclipse.emf.texo.json"/> |
| <texo.maven name="org.eclipse.emf.texo.xml"/> |
| <texo.maven name="org.eclipse.emf.texo.server"/> |
| |
| <copy todir="${promotePath}" flatten="true"> |
| <fileset dir="${buckminster.output.root}"> |
| <include name="org.eclipse.emf.texo*/site.p2.zip/org.eclipse.emf.texo_*.zip" /> |
| </fileset> |
| <chainedmapper> |
| <flattenmapper /> |
| <globmapper from="org.eclipse.emf.texo_${texo.version}.v*.zip" to="emf-texo-Update-incubation-${texo.version}-${build.type}*.zip" /> |
| </chainedmapper> |
| </copy> |
| |
| </target> |
| |
| <target name="clean.all"> |
| <echo message="Removing previous build" /> |
| <delete dir="${buildsPath}" quiet="true" /> |
| </target> |
| |
| <target name="init"> |
| <echo message="Removing old build" /> |
| <delete dir="${testPath}" quiet="true" /> |
| <delete dir="${tempPath}" quiet="true" /> |
| <delete dir="${buildPath}" quiet="true" /> |
| <delete dir="${generatePath}" quiet="true" /> |
| <delete dir="${promotePath}" quiet="true" /> |
| <delete dir="${resultPath}" quiet="true" /> |
| <delete dir="${buckminster.output.root}" quiet="true" /> |
| <delete dir="${buckminster.temp.root}" quiet="true" /> |
| |
| <echo message="Creating main directories" /> |
| <echo message="rootPath: ${rootPath}" /> |
| <echo message="buildPath: ${buildPath}" /> |
| <echo message="tempPath: ${tempPath}" /> |
| <echo message="testPath: ${testPath}" /> |
| <echo message="buildSitePath: ${buildSitePath}" /> |
| <echo message="buildZipsPath: ${buildZipsPath}" /> |
| <echo message="testResultsPath: ${testResultsPath}" /> |
| <echo message="mavenPath: ${mavenPath}" /> |
| <mkdir dir="${rootPath}" /> |
| <mkdir dir="${buildPath}" /> |
| <mkdir dir="${tempPath}" /> |
| <mkdir dir="${promotePath}" /> |
| <mkdir dir="${mavenPath}" /> |
| <mkdir dir="${testPath}" /> |
| <mkdir dir="${toolsPath}" /> |
| <mkdir dir="${toolsPath}/lib" /> |
| <mkdir dir="${buildSitePath}" /> |
| <mkdir dir="${buildZipsPath}" /> |
| <mkdir dir="${testResultsPath}" /> |
| |
| </target> |
| |
| <target name="init.clean.tools" if="clean.tools"> |
| <delete dir="${toolsPath}" failonerror="true" quiet="true" /> |
| </target> |
| |
| <target name="init.checks" depends="init.clean.tools"> |
| <available file="${toolsPath}/director/director" property="director.exists" /> |
| <available file="${toolsPath}/buckminster/buckminster" property="buckminster.exists" /> |
| </target> |
| |
| <target name="get.director" unless="director.exists"> |
| <echo message="Fetching headless director application" /> |
| <tempfile destdir="${java.io.tmpdir}" prefix="director-" suffix=".zip" property="director.zip" deleteonexit="true" /> |
| <get src="${director.url}" dest="${director.zip}" /> |
| <mkdir dir="${tools}" /> |
| <unzip src="${director.zip}" dest="${toolsPath}" /> |
| <delete file="${director.zip}" /> |
| </target> |
| |
| <target name="get.thirdparty"> |
| <echo message="Fetching thirdparty files" /> |
| <tempfile destdir="${java.io.tmpdir}" prefix="thirdparty-" suffix=".zip" property="thirdparty.zip" deleteonexit="true" /> |
| <get src="${thirdparty.url}" dest="${thirdparty.zip}" /> |
| <mkdir dir="${thirdPartyPath}" /> |
| <unzip src="${thirdparty.zip}" dest="${thirdPartyPath}" /> |
| <delete file="${thirdparty.zip}" /> |
| </target> |
| |
| <target name="install.buckminster" unless="buckminster.exists" depends="get.director"> |
| <echo message="Configuring headless buckminster with needed features" /> |
| <eclipse.launch app="director"> |
| <args> |
| <jvmarg value="-Declipse.p2.mirrors=false" /> |
| <!--jvmarg value="-Dorg.eclipse.update.jarprocessor.pack200=${org.eclipse.update.jarprocessor.pack200}" /--> |
| <arg value="-r" /> |
| <arg value="${buckminster.p2.site}" /> |
| <arg value="-d" /> |
| <arg value="${toolsPath}/buckminster" /> |
| <arg value="-p" /> |
| <arg value="Buckminster" /> |
| <arg value="-i" /> |
| <arg value="org.eclipse.buckminster.cmdline.product" /> |
| <arg value="-i" /> |
| <arg value="org.eclipse.buckminster.core.headless.feature.feature.group" /> |
| <arg value="-i" /> |
| <arg value="org.eclipse.buckminster.pde.headless.feature.feature.group" /> |
| <arg value="-i" /> |
| <arg value="org.eclipse.buckminster.git.headless.feature.feature.group" /> |
| </args> |
| </eclipse.launch> |
| </target> |
| |
| <target name="init.build.properties"> |
| <!-- Echo relevant properties to a temporary file so that Buckminster can read them |
| --> |
| <tempfile destdir="${java.io.tmpdir}" prefix="build-" suffix=".properties" deleteonexit="true" property="properties.tmp" /> |
| <echoproperties destfile="${properties.tmp}"> |
| <!-- We don't want these. basedir in particular will cause problems if passed explicitly --> |
| <propertyset negate="true"> |
| <propertyref name="basedir" /> |
| <propertyref name="eclipse.home" /> |
| <propertyref name="properties.tmp" /> |
| <propertyref name="line.separator" /> |
| <propertyref name="path.separator" /> |
| <propertyref prefix="ant." /> |
| <propertyref prefix="file." /> |
| <propertyref prefix="java." /> |
| <propertyref prefix="sun." /> |
| <propertyref prefix="user." /> |
| </propertyset> |
| </echoproperties> |
| </target> |
| </project> |