Permalink
Fetching contributors…
Cannot retrieve contributors at this time
151 lines (136 sloc) 6.55 KB
<?xml version="1.0" encoding="UTF-8"?>
<!--
Buckminster Headless - build
Properties:
WORKSPACE Eclipse workspace location, or hudson job workspace
build.root Where to build? WARNING: This folder will be cleaned up, so do not point to user.home or something important
Default: ${WORKSPACE}/buildroot
buckminster.home Buckminster headless to use. See http://www.eclipse.org/buckminster/downloads.html
projects.location Where to find projects to build?
Default: ${WORKSPACE}
commands.file What to do?
Default: ${projects.location}/org.xtext.example.hellobuck.buckminster/commands.txt
-->
<project name="Buckminster Headless" default="build">
<property name="WORKSPACE" location="${ant.file}/../../" />
<property name="build.root" location="${WORKSPACE}/buildroot" />
<property name="buckminster.home" location="${user.home}/buckminster" />
<property name="projects.location" location="${WORKSPACE}" />
<property name="commands.file" location="${projects.location}/org.xtext.example.hellobuck.buckminster/commands.txt" />
<property name="target.platform" value="target.platform" />
<property name="buckminster.loglevel" value="INFO" />
<property name="director.install.dest" location="${user.home}" />
<property name="director.dir" location="${director.install.dest}/director" />
<property name="director.url" value="http://download.eclipse.org/tools/buckminster/products/director_latest.zip" />
<property name="eclipse.p2.mirrors" value="true" />
<property name="java.net.preferIPv4Stack" value="true" />
<property name="build.properties" location="${projects.location}/org.xtext.example.hellobuck.buckminster/buckminster.properties" />
<target name="build" depends="cleanup,clean-xtend-gen,install.buckminster.headless" description="description">
<run_buckminster command="--script" propertiesfile="${build.properties}" >
<args>
<arg value="${projects.location}/org.xtext.example.hellobuck.buckminster/commands.txt" />
</args>
</run_buckminster>
<echo message=" " />
<echo message="Updatesite output in: ${build.root}/buckminster.output/org.xtext.example.hellobuck.site_*-eclipse.feature/site.p2/" />
</target>
<macrodef name="run_buckminster">
<attribute name="command" />
<attribute name="propertiesfile" default="${build.properties}" />
<attribute name="failonerror" default="true" />
<element name="args" optional="true" />
<sequential>
<java fork="true" dir="${buckminster.home}" logError="true" classname="org.eclipse.core.launcher.Main" failonerror="@{failonerror}">
<classpath>
<fileset dir="${buckminster.home}/plugins">
<include name="org.eclipse.equinox.launcher_*.jar" />
</fileset>
</classpath>
<arg line='-update' />
<arg line='-data "${build.root}/buckminster.workspace"' />
<arg line='-configuration "${build.root}/configuration"' />
<arg line='--properties "@{propertiesfile}"' />
<arg line='-L ${buckminster.loglevel}' />
<arg value="@{command}" />
<args />
<!-- <arg line='-L ant=INFO' /> -->
<!-- <arg line='-L DEBUG' /> -->
<sysproperty key="projects.location" value="${projects.location}" />
<sysproperty key="buckminster.output.root" value="${build.root}/buckminster.output" />
<sysproperty key="buckminster.temp.root" value="${build.root}/buckminster.temp" />
<sysproperty key="target.platform" value="${build.root}/${target.platform}" />
<jvmarg line=" -Xms256m -Xmx512m" />
</java>
</sequential>
</macrodef>
<target name="cleanup">
<delete failonerror="false" includeemptydirs="true">
<fileset dir="${build.root}" defaultexcludes="false">
<exclude name="**/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/" />
<exclude name="**/${target.platform}/" />
</fileset>
</delete>
</target>
<target name="clean-xtend-gen">
<delete failonerror="false" includeemptydirs="true">
<fileset dir="${projects.location}" defaultexcludes="false">
<include name="**/xtend-gen/**/*.java*" />
</fileset>
</delete>
</target>
<target name="reset.target-platform">
<delete includeemptydirs="true">
<fileset dir="${build.root}" defaultexcludes="false">
<include name="**/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/" />
<include name="**/${target.platform}/" />
</fileset>
</delete>
</target>
<target name="install.buckminster.headless">
<condition property="buckminster.headless.installed">
<available file="${buckminster.home}/buckminster" />
</condition>
<antcall target="install.buckminster.headless.internal" />
</target>
<target name="install.buckminster.headless.internal" unless="buckminster.headless.installed" >
<antcall target="install.p2.director" />
<echo message="" />
<echo message="Installing Buckminster Headless into ${buckminster.home}..." />
<java fork="true" dir="${director.dir}" logError="true" classname="org.eclipse.core.launcher.Main" failonerror="true">
<sysproperty key="eclipse.p2.mirrors" value="false" />
<classpath>
<fileset dir="${director.dir}/plugins">
<include name="org.eclipse.equinox.launcher_*.jar" />
</fileset>
</classpath>
<arg line='-data "${director.dir}/workspace"' />
<arg line="-r http://download.eclipse.org/tools/buckminster/headless-4.4,http://download.cloudsmith.com/buckminster/external-4.4,http://download.eclipse.org/releases/luna" />
<arg line='-d "${buckminster.home}"' />
<arg line="-p Buckminster" />
<arg line="-i org.eclipse.buckminster.cmdline.product" />
<arg line="-i org.eclipse.buckminster.core.headless.feature.feature.group" />
<arg line="-i org.eclipse.buckminster.pde.headless.feature.feature.group" />
<arg line="-i org.eclipse.buckminster.git.headless.feature.feature.group" />
<arg line="-i org.eclipse.buckminster.maven.headless.feature.feature.group" />
<arg line="-i org.eclipse.buckminster.emma.headless.feature.feature.group" />
</java>
</target>
<target name="install.p2.director">
<condition property="p2.director.installed">
<available file="${director.dir}" />
</condition>
<antcall target="install.p2.director.internal" />
</target>
<target name="install.p2.director.internal" unless="p2.director.installed">
<echo message="" />
<echo message="Installing director from ${director.url}..." />
<tempfile destdir="${java.io.tmpdir}"
prefix="director-"
suffix=".zip"
property="director.zip"
deleteonexit="true" />
<get src="${director.url}" dest="${director.zip}" />
<unzip src="${director.zip}" dest="${director.install.dest}" />
<delete file="${director.zip}" />
</target>
</project>