Skip to main content
aboutsummaryrefslogblamecommitdiffstats
blob: 48391bc9c5b30118cd63d6a40face7ab6a5d5832 (plain) (tree)
1
2
                                       
    























                                                                                                                          
                                                                                                    













                                                                                                          

                                                         
                                                                                               





                                                                                                   
                                                                                


                                                  
                                                                                

















                                                                                                       
                                                                            

                                                                  
                                                                         











                                                                                                                 

                                       
                                                                                                       
 

                                                                                                        
 
                                          
                                                                                                      
 
                                                                                                                                                                     
 
                                                                                                
 


                                                                                             



                                                                            










                                                               
 








                                                                       
                                                                                                      
































                                                                                                       
                                                          






                                                                      
                                            







                                                                                                   
                                                                             
 










                                                                                                                                     


                                                                                                                                         
                                                                        




                                                                          


















                                                                                                                                            
                                                                                                          
























                                                                                                                                           
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (c) 2010 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 Teneo

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="teneo.update.site.type" value="${env.TENEO_UPDATE_SITE_TYPE}" else="interim">
		<isset property="env.TENEO_UPDATE_SITE_TYPE" />
	</condition>

	<condition property="site.pack200" value="${env.SITE_PACK200}" else="false">
		<isset property="env.SITE_PACK200" />
	</condition>

	<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/teneo/emf-teneo-nightly" />

	<condition property="buckminster.loglevel" value="${env.BUCKMINSTER_LOGLEVEL}" else="info">
		<isset property="env.BUCKMINSTER_LOGLEVEL" />
	</condition>

	<!-- Is used in buck.minster also -->
	<condition property="build.type" value="${env.BUILDTYPE}" else="Indigo">
		<isset property="env.BUILDTYPE" />
	</condition>

	<condition property="teneo.version" value="${env.VERSION}" else="2.1.0">
		<isset property="env.VERSION" />
	</condition>

	<condition property="clean.tools" value="true">
		<equals arg1="${env.CLEAN_TOOLS}" arg2="true" />
	</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="gitPath" location="${hudsonWorkSpacePath}/git" />

	<!--property name="rootPath" location="${buildsPath}/${build.type}${buildTimestamp}"/-->
	<property name="rootPath" location="${buildsPath}" />

	<property name="buildRoot" location="${rootPath}/build" />
	<property name="thirdPartyPath" location="${rootPath}/thirdparty" />
	<property name="testRoot" location="${rootPath}/test" />
	<property name="toolsPath" location="${rootPath}/tools" />
	<property name="mavenPath" location="${rootPath}/result/maven" />
	<property name="buildSitePath" location="${rootPath}/result/p2site" />
	<property name="buildZipsPath" location="${rootPath}/result/zips" />
	<property name="testResultsPath" location="${rootPath}/result/test" />

	<property name="promoteUpdateSite" location="${teneo.download.area}/updates/${teneo.update.site.type}" />
	<property name="promoteDropsLocation" location="${teneo.download.area}/downloads/drops" />

	<property name="buckminster.output.root" location="${rootPath}/output" />
	<property name="buckminster.temp.root" location="${rootPath}/temp" />

	<import file="ant_common.xml" />

	<import file="ant_maven.xml" />

	<target name="build.and.test" depends="get.thirdparty, init, init.checks, install.buckminster">

		<echo message="Building" />
		<ant dir="${basedir}/build" antfile="teneo_build.xml" target="run" inheritRefs="true" />

		<echo message="Testing" />
		<ant dir="${basedir}/test" antfile="teneo_test.xml" target="run" inheritRefs="true" />

		<computeVersionQualifier directory="${rootPath}/output/org.eclipse.emf.teneo_${teneo.version}-osgi.bundle/jar" pattern="org.eclipse.emf.teneo*.jar"/>

		<echo message="Creating maven jars with versionQualifier ${versionQualifier}" />

		<property name="mavenVersion" value="${teneo.version}-${versionQualifier}" />
		<property name="teneoVersion" value="${teneo.version}.${versionQualifier}" />

		<teneo.maven name="org.eclipse.emf.teneo"/>
		<teneo.maven name="org.eclipse.emf.teneo.annotations"/>
		<teneo.maven name="org.eclipse.emf.teneo.hibernate.mapper"/>
		<teneo.maven name="org.eclipse.emf.teneo.hibernate"/>
	</target>

	<target name="promote" depends="init.build.properties">
		<echo message="Promoting ${buildSitePath}" />
		<echo message="From ${buildSitePath}" />
		<echo message="To ${promoteUpdateSite}" />

		<delete dir="${promoteUpdateSite}" />
		<mkdir dir="${promoteUpdateSite}"/>
		<mkdir dir="${promoteUpdateSite}/plugins"/>
		<mkdir dir="${promoteUpdateSite}/features"/>

		<copy todir="${promoteUpdateSite}">
			<fileset dir="${buildSitePath}">
				<include name="**/*" />
				<include name="**" />
			</fileset>
		</copy>

		<mkdir dir="${promoteDropsLocation}"/>
		<mkdir dir="${promoteDropsLocation}/${teneo.version}"/>
		<mkdir dir="${promoteDropsLocation}/${teneo.version}/${build.type}${buildTimestamp}"/>
		<copy todir="${promoteDropsLocation}/${teneo.version}/${build.type}${buildTimestamp}">
			<fileset dir="${buildZipsPath}">
				<include name="*.zip" />
			</fileset>
		</copy>
	</target>

	<target name="clean.all">
		<echo message="Removing previous build" />
		<delete dir="${buildsPath}" quiet="true" />
	</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="init">
		<echo message="Removing old build" />
		<delete dir="${testRoot}" quiet="true" />
		<delete dir="${buildRoot}" quiet="true" />
		<delete dir="${rootPath}/result" 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="buildRoot: ${buildRoot}" />
		<echo message="testRoot: ${testRoot}" />
		<echo message="mavenPath: ${mavenPath}" />
		<echo message="buildSitePath: ${buildSitePath}" />
		<echo message="buildZipsPath: ${buildZipsPath}" />
		<echo message="testResultsPath: ${testResultsPath}" />
		<mkdir dir="${rootPath}" />
		<mkdir dir="${buildRoot}" />
		<mkdir dir="${testRoot}" />
		<mkdir dir="${toolsPath}" />
		<mkdir dir="${mavenPath}" />
		<mkdir dir="${buildSitePath}" />
		<mkdir dir="${buildZipsPath}" />
		<mkdir dir="${testResultsPath}" />
		<mkdir dir="${testResultsPath}/output" />

		<available file="${tools}/director/director" property="director.exists" />
		<available file="${tools}/buckminster/buckminster" property="buckminster.exists" />

		<echo message="Using eclipse download: ${eclipse.download}"/>

	</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>

Back to the top