| <?xml version="1.0"?> |
| <!--************************************************************************ |
| * Copyright (c) 2006-2007, Cloudsmith Inc. |
| * The code, documentation and other materials contained herein have been |
| * licensed under the Eclipse Public License - v 1.0 by the copyright holder |
| * listed above, as the Initial Contributor under such license. The text of |
| * such license is available at www.eclipse.org. |
| ************************************************************************--> |
| |
| <project name="project" default="materialize"> |
| <target name="get.properties"> |
| <!-- Note: the "highest level of override is for someone to specify their |
| own location and name for the ganymatic properties. But, if not specified |
| already, we'll try ${user.home}/ganymedeConfig/ganymatic.properties. |
| After that, we will still use our production machine defaults since it |
| won't hurt if users override all the values (and is the only values used on |
| production build machine). |
| --> |
| <property environment="env" /> |
| <property name="ganymatic.properties.file" location="${user.home}/ganymedeConfig/ganymatic.properties"/> |
| |
| <!-- <echo message=" Properties being read from ${ganymatic.properties.file}" /> --> |
| |
| <property file="${ganymatic.properties.file}"/> |
| |
| <!-- <echo message=" Properties being read from ganymatic.properties" /> --> |
| <property file="ganymatic.properties" /> |
| |
| <property name="buckminster.home.loc" location="${buckminster.home}"/> |
| <property name="generated.dir.loc" location="${generated.dir}"/> |
| <property name="headless.home.loc" location="${buckminster.home.loc}/bin/buckminster" /> |
| <property name="contribs.dir.loc" location="${contribs.dir}" /> |
| <property name="site.contrib.dir.loc" location="${contribs.dir}" /> |
| <property name="site.dir.loc" location="${site.dir}" /> |
| <property name="site.template.loc" location="${contribs.dir.loc}/site.xml" /> |
| <property name="mirror.site.loc" location="${mirror.site.location}" /> |
| <antcall target="verify.properties.buckminster.home" /> |
| <antcall target="verify.properties.contribs.dir" /> |
| <antcall target="verify.properties.site.dir" /> |
| <antcall target="verify.properties.downloads" /> |
| <antcall target="verify.properties.generated.dir" /> |
| <antcall target="verify.properties.top.project" /> |
| <antcall target="verify.properties.mirror.site.location" /> |
| <antcall target="verify.properties.mirror.site.url" /> |
| |
| <mkdir dir="${headless.home.loc}/bin" /> |
| <mkdir dir="${headless.home.loc}/bin/org.eclipse.ganymede" /> |
| <mkdir dir="${headless.home.loc}/bin/buckminster" /> |
| |
| </target> |
| |
| <macrodef name="buckminster"> |
| <attribute name="command" default="--scriptfile" /> |
| <element name="globargs" optional="true" /> |
| <element name="args" optional="true" /> |
| <sequential> |
| <java fork="true" |
| jar="${headless.home.loc}/startup.jar" |
| dir="${headless.home.loc}" |
| failonerror="true"> |
| <!-- <jvmarg value="-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=y"/> --> |
| |
| <arg value="--displaystacktrace" /> |
| <arg value="--loglevel" /> |
| <arg value="info" /> |
| <globargs /> |
| <arg value="@{command}" /> |
| <args /> |
| </java> |
| </sequential> |
| </macrodef> |
| |
| <target name="generate.bm.artifacts" description="Generate the Buckminster artifacts from Site contributions"> |
| <path id="site.contrib.files.path"> |
| <fileset dir="${site.contrib.dir.loc}" includes="*.sc"> |
| <!-- <exclude name="birt.sc"/> --> |
| <!-- <exclude name="buckminster.sc"/> --> |
| <!-- <exclude name="cdt.sc"/> --> |
| <!-- <exclude name="dltk.sc"/> --> |
| <!-- <exclude name="dsdp-dd.sc"/> --> |
| <!-- <exclude name="dsdp-tm.sc"/> --> |
| <!-- <exclude name="dtp.sc"/> --> |
| <!-- <exclude name="ecf.sc"/> --> |
| <!-- <exclude name="emf-emf.sc"/> --> |
| <!-- <exclude name="emf-query.sc"/> --> |
| <!-- <exclude name="emft-cdo.sc"/> --> |
| <!-- <exclude name="emft-compare.sc"/> --> |
| <!-- <exclude name="emft-ecoretools.sc"/> --> |
| <!-- <exclude name="emft-mint.sc"/> --> |
| <!-- <exclude name="emft-net4j.sc"/> --> |
| <!-- <exclude name="emf-transaction.sc"/> --> |
| <!-- <exclude name="emft-search.sc"/> --> |
| <!-- <exclude name="emft-teneo.sc"/> --> |
| <!-- <exclude name="emf-validation.sc"/> --> |
| <!-- <exclude name="ep.sc"/> --> |
| <!-- <exclude name="epp-udc.sc"/> --> |
| <!-- <exclude name="gef.sc"/> --> |
| <!-- <exclude name="gmf.sc"/> --> |
| <!-- <exclude name="m2m-atl.sc"/> --> |
| <!-- <exclude name="m2m-qvto.sc"/> --> |
| <!-- <exclude name="m2t-jet.sc"/> --> |
| <!-- <exclude name="mdt-ocl.sc"/> --> |
| <!-- <exclude name="mdt-uml2.sc"/> --> |
| <!-- <exclude name="mdt-uml2tools.sc"/> --> |
| <!-- <exclude name="mylyn.sc"/> --> |
| <!-- <exclude name="rap.sc" /> --> |
| <!-- <exclude name="stp.sc"/> --> |
| <exclude name="subversive.sc"/> |
| <!-- <exclude name="tptp.sc"/> --> |
| <!-- <exclude name="wtp.sc"/> --> |
| </fileset> |
| </path> |
| <pathconvert property="site.contrib.files" pathsep="" "" refid="site.contrib.files.path" /> |
| <mkdir dir="${generated.dir.loc}" /> |
| <delete> |
| <fileset dir="${generated.dir.loc}" includes="site.xml" /> |
| <fileset dir="${generated.dir.loc}" includes="*.cspec" /> |
| <fileset dir="${generated.dir.loc}" includes="${top.project}.*" /> |
| <fileset dir="${generated.dir.loc}" includes="features/*" /> |
| <fileset dir="${generated.dir.loc}" includes="plugins/*" /> |
| </delete> |
| <echo message=""${site.contrib.files}"" /> |
| <buckminster command="generate"> |
| <globargs> |
| <arg value="-clean" /> |
| </globargs> |
| <args> |
| <arg value="--outputdir" /> |
| <arg value="${generated.dir.loc}" /> |
| <arg value="--sitedir" /> |
| <arg value="${site.dir.loc}" /> |
| <arg value="--templatesite" /> |
| <arg value="${site.template.loc}" /> |
| <arg value="--project" /> |
| <arg value="${top.project}" /> |
| <arg line=""${site.contrib.files}"" /> |
| </args> |
| </buckminster> |
| </target> |
| |
| <target name="resolve.cquery" description="Run the component query" depends="generate.bm.artifacts"> |
| <buckminster command="resolve"> |
| <globargs> |
| <jvmarg value="-Ddownloads=${downloads}" /> |
| </globargs> |
| <args> |
| <arg value="--continueonerror" /> |
| <arg value="--noimport" /> |
| <arg value="--bomfile" /> |
| <arg value="${generated.dir.loc}/${top.project}.bom" /> |
| <arg value="${generated.dir.loc}/${top.project}.cquery" /> |
| </args> |
| </buckminster> |
| </target> |
| |
| <target name="materialize" description="Materialize the site" depends="get.properties,resolve.cquery"> |
| <buckminster command="import"> |
| <globargs> |
| <jvmarg value="-Dmirror.site.location=${mirror.site.loc}" /> |
| <jvmarg value="-Dmirror.site.url=${mirror.site.url}" /> |
| </globargs> |
| <args> |
| <arg value="--continueonerror"/> |
| <arg value="${generated.dir.loc}/${top.project}.mspec" /> |
| </args> |
| </buckminster> |
| <copy file="${generated.dir.loc}/${top.project}.site" tofile="${site.dir.loc}/site.xml" overwrite="true"/> |
| </target> |
| |
| <target name="clean" description="Clean the generated artifacts and site"> |
| <delete dir="${generated.dir.loc}" /> |
| </target> |
| |
| <target name="really.clean" depends="clean" description="Clean out the barebone installation"> |
| <delete dir="${buckminster.home.loc}/bin/headless.zip" /> |
| <delete dir="${buckminster.home.loc}/bin/buckminster" /> |
| </target> |
| |
| <target name="verify.properties.buckminster.home" unless="buckminster.home"> |
| <echo message="Missing: buckminster.home"/> |
| <antcall target="verify.properties.error" /> |
| </target> |
| <target name="verify.properties.contribs.dir" unless="contribs.dir"> |
| <echo message="Missing: contribs.dir"/> |
| <antcall target="verify.properties.error" /> |
| </target> |
| <target name="verify.properties.site.dir" unless="site.dir"> |
| <echo message="Missing: site.dir"/> |
| <antcall target="verify.properties.error" /> |
| </target> |
| <target name="verify.properties.downloads" unless="downloads"> |
| <echo message="Missing: downloads"/> |
| <antcall target="verify.properties.error" /> |
| </target> |
| <target name="verify.properties.generated.dir" unless="generated.dir"> |
| <echo message="Missing: generated.dir"/> |
| <antcall target="verify.properties.error" /> |
| </target> |
| <target name="verify.properties.top.project" unless="top.project"> |
| <echo message="Missing: top.project"/> |
| <antcall target="verify.properties.error" /> |
| </target> |
| <target name="verify.properties.mirror.site.location" unless="mirror.site.location"> |
| <echo message="Missing: mirror.site.location"/> |
| <antcall target="verify.properties.error" /> |
| </target> |
| <target name="verify.properties.mirror.site.url" unless="mirror.site.url"> |
| <echo message="Missing: mirror.site.url"/> |
| <antcall target="verify.properties.error" /> |
| </target> |
| <target name="verify.properties.error"> |
| <echo message="Required properties were not defined in a ganymatic.properties, for example '${user.home}/ganymedeConfig/ganymatic.properties' file."/> |
| <echo message="Please create a ganymatic.properties file in your home directory, in a directory named ganymedeConfig."/> |
| <echo message="Use the examples/ganymatic.properties* files as templates for your file."/> |
| <echo message="The ganymatic.properties file defines the directories, etc for the builds on your machine."/> |
| <fail message="No properties defined; failed to build"/> |
| </target> |
| |
| </project> |