blob: 5a4dfc319bd260ce2901e7c1283738551e393ed1 (
plain) (
tree)
|
|
<?xml version="1.0" encoding="UTF-8"?>
<project name="imported">
<!-- This file is imported by the main Ant script. -->
<!-- Prevents system classpath from being used -->
<property name="build.sysclasspath" value="ignore"/>
<!-- ===========================================================================
PROPERTIES
============================================================================ -->
<property name="source.dir" value="${basedir}"/>
<property file="${basedir}/build.properties"/>
<property name="build.dir" location="${source.dir}/${ant.project.name}-ant.obj"/>
<property name="log.dir" location="${source.dir}"/>
<property name="log.file" value="${log.dir}/${ant.project.name}-build-ant.log"/>
<property name="project.dir" value="../../.."/>
<condition property="quick.binary">
<equals arg1="${binary}" arg2="quick"/>
</condition>
<condition property="pack.binary">
<equals arg1="${binary}" arg2="pack"/>
</condition>
<condition property="latest.binary">
<equals arg1="${binary}" arg2="latest"/>
</condition>
<condition property="installed.binary">
<equals arg1="${binary}" arg2="installed"/>
</condition>
<fail message="Property 'binary' must be set to either 'quick', 'pack', 'latest' or 'installed'.">
<condition><not><or>
<isset property="quick.binary"/>
<isset property="pack.binary"/>
<isset property="latest.binary"/>
<isset property="installed.binary"/>
</or></not></condition>
</fail>
<echo level="verbose" message="binary=${binary}"/>
<echo level="verbose" message="build.dir=${build.dir}"/>
<!-- ===========================================================================
INITIALISATION
============================================================================ -->
<target name="quick.init" if="quick.binary">
<property name="quick.dir" value="${project.dir}/build/quick"/>
<fail message="Quick build could not be found.">
<condition><not><available file="${quick.dir}"/></not></condition>
</fail>
<property name="scala.dir" value="${quick.dir}"/>
<property name="scala-library.lib" value="${scala.dir}/classes/library/"/>
<property name="scala-compiler.lib" value="${scala.dir}/classes/compiler/"/>
<property name="fjbg.lib" value="${project.dir}/lib/fjbg.jar"/>
</target>
<target name="pack.init" if="pack.binary">
<property name="pack.dir" value="${project.dir}/build/pack"/>
<fail message="Pack build could not be found.">
<condition><not><available file="${pack.dir}"/></not></condition>
</fail>
<property name="scala.dir" value="${pack.dir}"/>
<property name="scala-library.lib" value="${scala.dir}/lib/scala-library.jar"/>
<property name="scala-compiler.lib" value="${scala.dir}/lib/scala-compiler.jar"/>
<property name="fjbg.lib" value=""/>
</target>
<target name="latest.init" if="latest.binary">
<property name="latest.dir" value="${project.dir}/dists/latest"/>
<fail message="Latest build could not be found.">
<condition><not><available file="${latest.dir}"/></not></condition>
</fail>
<property name="scala.dir" value="${latest.dir}"/>
<property name="scala-library.lib" value="${scala.dir}/lib/scala-library.jar"/>
<property name="scala-compiler.lib" value="${scala.dir}/lib/scala-compiler.jar"/>
<property name="fjbg.lib" value=""/>
</target>
<target name="installed.init" if="installed.binary">
<property name="installed.dir" value="/opt/scala"/>
<fail message="Installed distribution could not be found.">
<condition><not><available file="${installed.dir}"/></not></condition>
</fail>
<property name="scala.dir" value="${installed.dir}"/>
<property name="scala-library.lib" value="${scala.dir}/lib/scala-library.jar"/>
<property name="scala-compiler.lib" value="${scala.dir}/lib/scala-compiler.jar"/>
<property name="fjbg.lib" value=""/>
</target>
<target name="init" depends="quick.init, pack.init, latest.init, installed.init">
<echo level="verbose" message="scala.dir=${scala.dir}"/>
<path id="scala.classpath">
<pathelement location="${scala-library.lib}"/>
<pathelement location="${scala-compiler.lib}"/>
<pathelement location="${fjbg.lib}"/> <!-- only present for 'quick' -->
</path>
<fail message="Scala library '${scala-library.lib}' or '${scala-compiler.lib}' is missing/broken">
<condition><not><and>
<available classname="scala.Predef"
classpathref="scala.classpath"/>
<available classname="scala.Option"
classpathref="scala.classpath"/>
<available classname="scala.runtime.ObjectRef"
classpathref="scala.classpath"/>
<available classname="scala.tools.ant.Scalac"
classpathref="scala.classpath"/>
<available classname="scala.tools.nsc.Main"
classpathref="scala.classpath"/>
<available classname="scala.tools.util.StringOps"
classpathref="scala.classpath"/>
</and></not></condition>
</fail>
<taskdef resource="scala/tools/ant/antlib.xml" classpathref="scala.classpath"/>
<path id="build.classpath">
<!--<pathelement location="${scala-actors.lib}"/>-->
<pathelement location="${scala-library.lib}"/>
<pathelement location="${build.dir}"/>
</path>
<!-- make sure the log file exists when the Ant build scripts -->
<!-- are run manually from the command prompt -->
<touch file="${log.file}"/>
</target>
<!-- ===========================================================================
RUN
============================================================================ -->
<target name="run" depends="build, clean"/>
<!-- ===========================================================================
CLEAN
============================================================================ -->
<macrodef name="remove">
<attribute name="dir"/>
<sequential>
<delete dir="@{dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/>
</sequential>
</macrodef>
<target name="clean">
<remove dir="${build.dir}"/>
</target>
</project>
|