blob: c089f961d2a957866dcc059afcf4ee9f86e5463d (
plain) (
tree)
|
|
<?xml version="1.0" encoding="UTF-8"?>
<project name="sabbus" default="build">
<description>
SuperSabbus for Scala core, builds the scala library and compiler. It can also package it as a simple distribution, tests it for stable bootstrapping and against the Scala test suite. Use PackSabbus to package it for different install management tools such as Sbaz.
</description>
<!-- ===========================================================================
END-USER TARGETS
============================================================================ -->
<target name="build" depends="pack.done"
description="Builds the Scala compiler and library. Executables are in 'build/pack/bin'."/>
<target name="clean" depends="quick.clean"
description="Removes binaries of compiler and library. Distributions are untouched."/>
<target name="test" depends="test.done"
description="Runs test suite and bootstrapping test on Scala compiler and library."/>
<target name="docs" depends="docs.done"
description="Builds documentation for the Scala library. Scaladoc is in 'build/scaladoc/library'."/>
<target name="docscomp" depends="docs.comp"
description="Builds documentation for the Scala compiler and library. Scaladoc is in 'build/scaladoc'."/>
<target name="docsclean" depends="docs.clean"
description="Removes generated documentation. Distributions are untouched."/>
<target name="dist"
description="Makes a new distribution and tests it. Will remove existing binaries and documentation.">
<antcall target="locker.clean"/>
<antcall target="docs.clean"/>
<antcall target="all.done"/>
</target>
<target name="fastdist" depends="dist.done"
description="Makes a new distribution without testing it or removing partially build elements"/>
<target name="distclean" depends="dist.clean"
description="Removes all distributions. Binaries and documentation are untouched."/>
<target name="newstarr"
description="Replaces the Starr compiler and library by one built from current sources and tests it.">
<antcall target="locker.clean"/>
<antcall target="starr.done"/>
<antcall target="locker.clean"/>
<antcall target="test.done"/>
</target>
<target name="freshlocker"
description="Replaces the Locker compiler and library by one built from current sources.">
<antcall target="locker.clean"/>
<antcall target="locker.done"/>
</target>
<target name="newlocker"
description="Unlocks the Locker compiler and library and lets them be updated by Scalac.">
<antcall target="locker.unlock"/>
<antcall target="locker.done"/>
</target>
<!-- ===========================================================================
PROPERTIES
============================================================================ -->
<property environment="env"/>
<!-- Prevents system classpath from being used -->
<property name="build.sysclasspath" value="ignore"/>
<!-- Defines the repository layout -->
<property name="docs.dir" value="${basedir}/docs"/>
<property name="lib.dir" value="${basedir}/lib"/>
<property name="lib-ant.dir" value="${lib.dir}/ant"/>
<property name="src.dir" value="${basedir}/src"/>
<property name="test.dir" value="${basedir}/test"/>
<!-- Loads custom properties definitions -->
<property file="${basedir}/build.properties"/>
<!-- Sets location of pre-compiled libraries -->
<property name="lib.starr.jar" value="${lib.dir}/scala-library.jar"/>
<property name="comp.starr.jar" value="${lib.dir}/scala-compiler.jar"/>
<property name="fjbg.jar" value="${lib.dir}/fjbg.jar"/>
<property name="msil.jar" value="${lib.dir}/msil.jar"/>
<property name="jline.jar" value="${lib.dir}/jline.jar"/>
<property name="ant.jar" value="${ant.home}/lib/ant.jar"/>
<!-- Sets location of build folders -->
<property name="build.dir" value="${basedir}/build"/>
<property name="build-locker.dir" value="${build.dir}/locker"/>
<property name="build-quick.dir" value="${build.dir}/quick"/>
<property name="build-pack.dir" value="${build.dir}/pack"/>
<property name="build-strap.dir" value="${build.dir}/strap"/>
<property name="build-docs.dir" value="${build.dir}/scaladoc"/>
<property name="dists.dir" value="${basedir}/dists"/>
<property name="copyright.string" value="Copyright 2002-2008, LAMP/EPFL"/>
<!-- These are NOT the flags used to run SuperSabbus -->
<property name="java.flags" value="-Xmx256M -Xms32M"/>
<!-- ===========================================================================
INITIALISATION
============================================================================ -->
<target name="init">
<!-- Setting-up Ant contrib tasks -->
<taskdef resource="net/sf/antcontrib/antlib.xml" classpath="${lib.dir}/ant/ant-contrib.jar"/>
<!-- This is the start time for the distribution -->
<tstamp prefix="time">
<format property="human" pattern="d MMMM yyyy, HH:mm:ss"/>
<format property="short" pattern="yyyyMMddHHmmss"/>
</tstamp>
<!-- Find out whether we are running on Windows -->
<condition property="os.win">
<os family="windows"/>
</condition>
<!-- Finding out SVN revision -->
<exec executable="svn" outputproperty="svn.out">
<arg line=" info ${basedir}"/>
</exec>
<propertyregex
property="svn.number" input="${svn.out}" select="\1"
regexp="Revision: ([0-9]+)"
defaultValue="0"/>
<property name="init.avail" value="yes"/>
<!-- Generating version number -->
<property file="${basedir}/build.number"/>
<property
name="version.number"
value="${version.major}.${version.minor}.${version.patch}.r${svn.number}-b${time.short}"/>
<!-- And print-out what we are building -->
<echo level="info" message="Build number is '${version.number}'"/>
<echo level="info" message="Built ${time.human} from revision ${svn.number} with Java ${java.vm.version}"/>
<!-- Define tasks that can be run with Starr -->
<path id="starr.classpath">
<pathelement location="${lib.starr.jar}"/>
<pathelement location="${comp.starr.jar}"/>
<pathelement location="${lib.dir}/sabbus.jar"/>
<pathelement location="${fjbg.jar}"/>
<pathelement location="${ant.jar}"/>
</path>
<taskdef resource="scala/tools/ant/sabbus/antlib.xml" classpathref="starr.classpath"/>
</target>
<!-- ===========================================================================
LOCAL REFERENCE BUILD (LOCKER)
============================================================================ -->
<target name="locker.start" depends="init">
<condition property="locker.available">
<available file="${build-locker.dir}/all.complete"/>
</condition>
</target>
<target name="locker.pre-lib" depends="locker.start" unless="locker.available">
<condition property="locker.lib.needed">
<not><available file="${build-locker.dir}/library.complete"/></not>
</condition>
</target>
<target name="locker.lib" depends="locker.pre-lib" if="locker.lib.needed">
<stopwatch name="locker.lib.timer"/>
<mkdir dir="${build-locker.dir}/classes/library"/>
<javac
srcdir="${src.dir}/library"
destdir="${build-locker.dir}/classes/library"
classpath="${build-locker.dir}/classes/library"
includes="**/*.java"
target="1.5" source="1.5"/>
<sabmake id="starr.lib.scalac"
destdir="${build-locker.dir}/classes/library"
compilerpathref="starr.classpath"
srcpath="${src.dir}/library"
target="jvm-1.5">
<compilationpath>
<pathelement location="${build-locker.dir}/classes/library"/>
</compilationpath>
</sabmake>
<sabuse id="starr.lib.scalac" srcdir="${src.dir}/library">
<include name="scala/Predef.scala"/>
</sabuse>
<sabuse id="starr.lib.scalac" srcdir="${src.dir}/library">
<include name="**/*.scala"/>
<exclude name="scala/Predef.scala"/>
<exclude name="scala/dbc/**"/>
<exclude name="scala/actors/**"/>
</sabuse>
<propertyfile file="${build-locker.dir}/classes/library/library.properties">
<entry key="version.number" value="${version.number}"/>
<entry key="copyright.string" value="${copyright.string}"/>
</propertyfile>
<copy todir="${build-locker.dir}/classes/library">
<fileset dir="${src.dir}/library">
<include name="**/*.tmpl"/>
<include name="**/*.xml"/>
<include name="**/*.js"/>
<include name="**/*.css"/>
</fileset>
</copy>
<sabbreak id="starr.lib.scalac"/>
<touch file="${build-locker.dir}/library.complete" verbose="no"/>
<stopwatch name="locker.lib.timer" action="total"/>
</target>
<target name="locker.pre-comp" depends="locker.lib" unless="locker.available">
<condition property="locker.comp.needed">
<not><available file="${build-locker.dir}/compiler.complete"/></not>
</condition>
</target>
<target name="locker.comp" depends="locker.pre-comp" if="locker.comp.needed">
<stopwatch name="locker.comp.timer"/>
<mkdir dir="${build-locker.dir}/classes/compiler"/>
<sabmake id="starr.comp.scalac"
destdir="${build-locker.dir}/classes/compiler"
compilerpathref="starr.classpath"
srcpath="${src.dir}/compiler"
target="jvm-1.5">
<compilationpath>
<pathelement location="${build-locker.dir}/classes/library"/>
<pathelement location="${build-locker.dir}/classes/compiler"/>
<pathelement location="${fjbg.jar}"/>
<pathelement location="${msil.jar}"/>
<pathelement location="${jline.jar}"/>
<pathelement location="${ant.jar}"/>
</compilationpath>
</sabmake>
<sabuse id="starr.comp.scalac" srcdir="${src.dir}/compiler">
<include name="**/*.scala"/>
</sabuse>
<propertyfile file="${build-locker.dir}/classes/compiler/compiler.properties">
<entry key="version.number" value="${version.number}"/>
<entry key="copyright.string" value="${copyright.string}"/>
</propertyfile>
<copy todir="${build-locker.dir}/classes/compiler">
<fileset dir="${src.dir}/compiler">
<include name="**/*.tmpl"/>
<include name="**/*.xml"/>
<include name="**/*.js"/>
<include name="**/*.css"/>
</fileset>
</copy>
<sabbreak id="starr.comp.scalac"/>
<touch file="${build-locker.dir}/compiler.complete" verbose="no"/>
<stopwatch name="locker.comp.timer" action="total"/>
</target>
<target name="locker.done" depends="locker.comp">
<touch file="${build-locker.dir}/all.complete" verbose="no"/>
<path id="locker.classpath">
<pathelement location="${build-locker.dir}/classes/library"/>
<pathelement location="${build-locker.dir}/classes/compiler"/>
<pathelement location="${fjbg.jar}"/>
<pathelement location="${ant.jar}"/>
</path>
</target>
<target name="locker.clean" depends="quick.clean">
<delete dir="${build-locker.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/>
</target>
<target name="locker.unlock" depends="quick.clean">
<delete file="${build-locker.dir}/library.complete"/>
<delete file="${build-locker.dir}/compiler.complete"/>
</target>
<!-- ===========================================================================
QUICK BUILD (QUICK)
============================================================================ -->
<target name="quick.start" depends="locker.done"/>
<target name="quick.pre-lib" depends="quick.start">
<uptodate property="quick.lib.available" targetfile="${build-quick.dir}/library.complete">
<srcfiles dir="${src.dir}">
<include name="library/**"/>
<include name="dbc/**"/>
<include name="actors/**"/>
</srcfiles>
</uptodate>
</target>
<target name="quick.lib" depends="quick.pre-lib" unless="quick.lib.available">
<stopwatch name="quick.lib.timer"/>
<mkdir dir="${build-quick.dir}/classes/library"/>
<javac
srcdir="${src.dir}/library"
destdir="${build-quick.dir}/classes/library"
classpath="${build-quick.dir}/classes/library"
includes="**/*.java"
target="1.5" source="1.5"/>
<javac
srcdir="${src.dir}/actors"
destdir="${build-quick.dir}/classes/library"
classpath="${build-quick.dir}/classes/library"
includes="**/*.java"
target="1.5" source="1.5"/>
<sabmake id="locker.lib.scalac"
destdir="${build-quick.dir}/classes/library"
compilerpathref="locker.classpath"
srcpath="${src.dir}/library"
target="jvm-1.5">
<compilationpath>
<pathelement location="${build-quick.dir}/classes/library"/>
</compilationpath>
</sabmake>
<sabuse id="locker.lib.scalac" srcdir="${src.dir}/library">
<include name="scala/Predef.scala"/>
</sabuse>
<!-- re-instantiate locker.lib.scalac because keeping the same instance will lead to some attributes missing -->
<sabbreak id="locker.lib.scalac"/>
<sabmake id="locker.lib.scalac"
destdir="${build-quick.dir}/classes/library"
compilerpathref="locker.classpath"
srcpath="${src.dir}/library"
target="jvm-1.5">
<compilationpath>
<pathelement location="${build-quick.dir}/classes/library"/>
</compilationpath>
</sabmake>
<sabuse id="locker.lib.scalac" srcdir="${src.dir}/library">
<include name="**/*.scala"/>
<exclude name="scala/Predef.scala"/>
</sabuse>
<sabuse id="locker.lib.scalac" srcdir="${src.dir}/actors">
<include name="**/*.scala"/>
</sabuse>
<sabuse id="locker.lib.scalac" srcdir="${src.dir}/dbc">
<include name="**/*.scala"/>
</sabuse>
<propertyfile file="${build-quick.dir}/classes/library/library.properties">
<entry key="version.number" value="${version.number}"/>
<entry key="copyright.string" value="${copyright.string}"/>
</propertyfile>
<copy todir="${build-quick.dir}/classes/library">
<fileset dir="${src.dir}/library">
<include name="**/*.tmpl"/>
<include name="**/*.xml"/>
<include name="**/*.js"/>
<include name="**/*.css"/>
</fileset>
</copy>
<sabbreak id="locker.lib.scalac"/>
<touch file="${build-quick.dir}/library.complete" verbose="no"/>
<stopwatch name="quick.lib.timer" action="total"/>
</target>
<target name="quick.pre-comp" depends="quick.lib">
<uptodate property="quick.comp.available" targetfile="${build-quick.dir}/compiler.complete">
<srcfiles dir="${src.dir}/compiler"/>
</uptodate>
</target>
<target name="quick.comp" depends="quick.pre-comp" unless="quick.comp.available">
<stopwatch name="quick.comp.timer"/>
<mkdir dir="${build-quick.dir}/classes/compiler"/>
<sabmake id="locker.comp.scalac"
destdir="${build-quick.dir}/classes/compiler"
compilerpathref="locker.classpath"
srcpath="${src.dir}/compiler"
target="jvm-1.5">
<compilationpath>
<pathelement location="${build-quick.dir}/classes/library"/>
<pathelement location="${build-quick.dir}/classes/compiler"/>
<pathelement location="${fjbg.jar}"/>
<pathelement location="${msil.jar}"/>
<pathelement location="${jline.jar}"/>
<pathelement location="${ant.jar}"/>
</compilationpath>
</sabmake>
<sabuse id="locker.comp.scalac" srcdir="${src.dir}/compiler">
<include name="**/*.scala"/>
</sabuse>
<propertyfile file="${build-quick.dir}/classes/compiler/compiler.properties">
<entry key="version.number" value="${version.number}"/>
<entry key="copyright.string" value="${copyright.string}"/>
</propertyfile>
<copy todir="${build-quick.dir}/classes/compiler">
<fileset dir="${src.dir}/compiler">
<include name="**/*.tmpl"/>
<include name="**/*.xml"/>
<include name="**/*.js"/>
<include name="**/*.css"/>
</fileset>
</copy>
<sabbreak id="locker.comp.scalac"/>
<touch file="${build-quick.dir}/compiler.complete" verbose="no"/>
<stopwatch name="quick.comp.timer" action="total"/>
</target>
<target name="quick.pre-partest" depends="quick.comp">
<uptodate property="quick.partest.available" targetfile="${build-quick.dir}/partest.complete">
<srcfiles dir="${src.dir}/partest"/>
</uptodate>
</target>
<target name="quick.partest" depends="quick.pre-partest" unless="quick.partest.available">
<stopwatch name="quick.partest.timer"/>
<mkdir dir="${build-quick.dir}/classes/partest"/>
<javac
srcdir="${src.dir}/partest"
destdir="${build-quick.dir}/classes/partest"
target="1.5" source="1.5">
<classpath>
<pathelement location="${build-quick.dir}/classes/library"/>
<pathelement location="${build-quick.dir}/classes/compiler"/>
<pathelement location="${build-quick.dir}/classes/partest"/>
</classpath>
<include name="**/*.java"/>
</javac>
<sabmake id="locker.partest.scalac"
destdir="${build-quick.dir}/classes/partest"
compilerpathref="locker.classpath"
srcpath="${src.dir}/partest"
target="jvm-1.5">
<compilationpath>
<pathelement location="${build-quick.dir}/classes/library"/>
<pathelement location="${build-quick.dir}/classes/compiler"/>
<pathelement location="${build-quick.dir}/classes/partest"/>
<pathelement location="${ant.jar}"/>
</compilationpath>
</sabmake>
<sabuse id="locker.partest.scalac" srcdir="${src.dir}/partest">
<include name="**/*.scala"/>
</sabuse>
<copy todir="${build-quick.dir}/classes/partest">
<fileset dir="${src.dir}/partest">
<include name="**/*.xml"/>
</fileset>
</copy>
<sabbreak id="locker.partest.scalac"/>
<touch file="${build-quick.dir}/partest.complete" verbose="no"/>
<stopwatch name="quick.partest.timer" action="total"/>
</target>
<target name="quick.pre-bin" depends="quick.partest">
<condition property="quick.bin.available">
<isset property="quick.comp.available"/>
</condition>
</target>
<target name="quick.bin" depends="quick.pre-bin" unless="quick.bin.available">
<path id="quick.bin.classpath">
<pathelement location="${build-quick.dir}/classes/library"/>
<pathelement location="${build-quick.dir}/classes/compiler"/>
<pathelement location="${fjbg.jar}"/>
<pathelement location="${jline.jar}"/>
</path>
<taskdef name="quick-bin" classname="scala.tools.ant.ScalaTool" classpathref="quick.bin.classpath"/>
<mkdir dir="${build-quick.dir}/bin"/>
<quick-bin
file="${build-quick.dir}/bin/scala"
class="scala.tools.nsc.MainGenericRunner"
javaFlags="${java.flags}"
classpathref="quick.bin.classpath"/>
<quick-bin
file="${build-quick.dir}/bin/scalac"
class="scala.tools.nsc.Main"
javaFlags="${java.flags}"
classpathref="quick.bin.classpath"/>
<quick-bin
file="${build-quick.dir}/bin/scaladoc"
class="scala.tools.nsc.ScalaDoc"
javaFlags="${java.flags}"
classpathref="quick.bin.classpath"/>
<quick-bin
file="${build-quick.dir}/bin/fsc"
class="scala.tools.nsc.CompileClient"
javaFlags="${java.flags}"
classpathref="quick.bin.classpath"/>
<chmod perm="ugo+rx" file="${build-quick.dir}/bin/scala"/>
<chmod perm="ugo+rx" file="${build-quick.dir}/bin/scalac"/>
<chmod perm="ugo+rx" file="${build-quick.dir}/bin/scaladoc"/>
<chmod perm="ugo+rx" file="${build-quick.dir}/bin/fsc"/>
<touch file="${build-quick.dir}/bin.complete" verbose="no"/>
</target>
<target name="quick.done" depends="quick.bin"/>
<target name="quick.clean" depends="pack.clean">
<delete dir="${build-quick.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/>
</target>
<!-- ===========================================================================
PACKED QUICK BUILD (PACK)
============================================================================ -->
<target name="pack.start" depends="quick.done"/>
<target name="pack.pre-lib" depends="pack.start">
<uptodate
property="pack.lib.available"
targetfile="${build-pack.dir}/lib/scala-library.jar"
srcfile="${build-quick.dir}/library.complete"/>
</target>
<target name="pack.lib" depends="pack.pre-lib" unless="pack.lib.available">
<mkdir dir="${build-pack.dir}/lib"/>
<jar destfile="${build-pack.dir}/lib/scala-library.jar">
<fileset dir="${build-quick.dir}/classes/library">
<exclude name="scala/dbc/**"/>
</fileset>
</jar>
<jar destfile="${build-pack.dir}/lib/scala-dbc.jar">
<fileset dir="${build-quick.dir}/classes/library">
<include name="scala/dbc/**"/>
</fileset>
</jar>
</target>
<target name="pack.pre-comp" depends="pack.lib">
<uptodate
property="pack.comp.available"
targetfile="${build-pack.dir}/lib/scala-compiler.jar"
srcfile="${build-quick.dir}/compiler.complete"/>
</target>
<target name="pack.comp" depends="pack.pre-comp" unless="pack.comp.available">
<mkdir dir="${build-pack.dir}/META-INF"/>
<copy file="META-INF/MANIFEST.MF" toDir="${build-pack.dir}/META-INF"/>
<manifest file="${build-pack.dir}/META-INF/MANIFEST.MF" mode="update">
<attribute name="Bundle-Version" value="${version.number}"/>
</manifest>
<mkdir dir="${build-pack.dir}/lib"/>
<jar destfile="${build-pack.dir}/lib/scala-compiler.jar" manifest="${build-pack.dir}/META-INF/MANIFEST.MF">
<fileset dir="${build-quick.dir}/classes/compiler"/>
<zipfileset src="${fjbg.jar}"/>
<zipfileset src="${msil.jar}"/>
<zipfileset src="${jline.jar}"/>
</jar>
</target>
<target name="pack.pre-partest" depends="pack.comp">
<uptodate
property="pack.partest.available"
targetfile="${build-pack.dir}/lib/scala-partest.jar"
srcfile="${build-quick.dir}/partest.complete"/>
</target>
<target name="pack.partest" depends="pack.pre-partest" unless="pack.partest.available">
<mkdir dir="${build-pack.dir}/lib"/>
<jar destfile="${build-pack.dir}/lib/scala-partest.jar">
<fileset dir="${build-quick.dir}/classes/partest"/>
</jar>
</target>
<target name="pack.pre-bin" depends="pack.partest">
<uptodate
property="pack.bin.available"
srcfile="${build-pack.dir}/lib/scala-compiler.jar"
targetfile="${build-pack.dir}/bin.complete"/>
</target>
<target name="pack.bin" depends="pack.pre-bin" unless="pack.bin.available">
<taskdef name="pack-bin" classname="scala.tools.ant.ScalaTool">
<classpath>
<pathelement location="${build-pack.dir}/lib/scala-library.jar"/>
<pathelement location="${build-pack.dir}/lib/scala-compiler.jar"/>
</classpath>
</taskdef>
<mkdir dir="${build-pack.dir}/bin"/>
<pack-bin
file="${build-pack.dir}/bin/scala"
class="scala.tools.nsc.MainGenericRunner"
javaFlags="${java.flags}"/>
<pack-bin
file="${build-pack.dir}/bin/scalac"
class="scala.tools.nsc.Main"
javaFlags="${java.flags}"/>
<pack-bin
file="${build-pack.dir}/bin/scaladoc"
class="scala.tools.nsc.ScalaDoc"
javaFlags="${java.flags}"/>
<pack-bin
file="${build-pack.dir}/bin/fsc"
class="scala.tools.nsc.CompileClient"
javaFlags="${java.flags}"/>
<chmod perm="ugo+rx" file="${build-pack.dir}/bin/scala"/>
<chmod perm="ugo+rx" file="${build-pack.dir}/bin/scalac"/>
<chmod perm="ugo+rx" file="${build-pack.dir}/bin/scaladoc"/>
<chmod perm="ugo+rx" file="${build-pack.dir}/bin/fsc"/>
<touch file="${build-pack.dir}/bin.complete" verbose="no"/>
</target>
<target name="pack.done" depends="pack.bin">
<path id="pack.classpath">
<pathelement location="${build-pack.dir}/lib/scala-library.jar"/>
<pathelement location="${build-pack.dir}/lib/scala-compiler.jar"/>
<pathelement location="${build-pack.dir}/lib/scala-partest.jar"/>
<pathelement location="${ant.jar}"/>
</path>
<taskdef resource="scala/tools/ant/antlib.xml" classpathref="pack.classpath"/>
<taskdef resource="scala/tools/partest/antlib.xml" classpathref="pack.classpath"/>
</target>
<target name="pack.clean" depends="strap.clean">
<delete dir="${build-pack.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/>
</target>
<!-- ===========================================================================
PACKED QUICK BUILD FOR ECLIPSE PLUGINDEVELOPMENT (PLUGIN)
============================================================================ -->
<target name="pack.pre-libsrc" depends="pack.start">
<uptodate
property="pack.libsrc.available"
targetfile="${build-pack.dir}/lib/scala-library-src.jar"
srcfile="${build-quick.dir}/librarysrc.complete"/>
</target>
<target name="pack.libsrc" depends="pack.pre-libsrc">
<mkdir dir="${build-pack.dir}/src"/>
<jar destfile="${build-pack.dir}/src/scala-library-src.jar">
<fileset dir="${src.dir}/library"/>
<fileset dir="${src.dir}/actors"/>
</jar>
<jar destfile="${build-pack.dir}/src/scala-dbc-src.jar">
<fileset dir="${src.dir}/dbc"/>
</jar>
</target>
<target name="plugin.quick" depends="pack.lib, pack.libsrc"/>
<!-- ===========================================================================
BOOTSTRAPPING BUILD (STRAP)
============================================================================ -->
<target name="strap.start" depends="pack.done"/>
<target name="strap.pre-lib" depends="strap.start">
<uptodate property="strap.lib.available" targetfile="${build-strap.dir}/library.complete">
<srcfiles dir="${src.dir}">
<include name="library/**"/>
<include name="dbc/**"/>
<include name="actors/**"/>
</srcfiles>
</uptodate>
</target>
<target name="strap.lib" depends="strap.pre-lib" unless="strap.lib.available">
<stopwatch name="strap.lib.timer"/>
<mkdir dir="${build-strap.dir}/classes/library"/>
<javac
srcdir="${src.dir}/library"
destdir="${build-strap.dir}/classes/library"
classpath="${build-strap.dir}/classes/library"
includes="**/*.java"
target="1.5" source="1.5"/>
<javac
srcdir="${src.dir}/actors"
destdir="${build-strap.dir}/classes/library"
classpath="${build-strap.dir}/classes/library"
includes="**/*.java"
target="1.5" source="1.5"/>
<scalac
srcdir="${src.dir}/library"
destdir="${build-strap.dir}/classes/library"
classpath="${build-strap.dir}/classes/library"
sourcepath="${src.dir}/library"
target="jvm-1.5">
<include name="scala/Predef.scala"/>
</scalac>
<scalac
srcdir="${src.dir}/library"
destdir="${build-strap.dir}/classes/library"
classpath="${build-strap.dir}/classes/library"
target="jvm-1.5">
<include name="**/*.scala"/>
<exclude name="scala/Predef.scala"/>
</scalac>
<scalac
srcdir="${src.dir}/actors"
destdir="${build-strap.dir}/classes/library"
classpath="${build-strap.dir}/classes/library"
target="jvm-1.5">
<include name="**/*.scala"/>
</scalac>
<scalac
srcdir="${src.dir}/dbc"
destdir="${build-strap.dir}/classes/library"
classpath="${build-strap.dir}/classes/library"
target="jvm-1.5">
<include name="**/*.scala"/>
</scalac>
<propertyfile file="${build-strap.dir}/classes/library/library.properties">
<entry key="version.number" value="${version.number}"/>
<entry key="copyright.string" value="${copyright.string}"/>
</propertyfile>
<copy todir="${build-strap.dir}/classes/library">
<fileset dir="${src.dir}/library">
<include name="**/*.tmpl"/>
<include name="**/*.xml"/>
<include name="**/*.js"/>
<include name="**/*.css"/>
</fileset>
</copy>
<touch file="${build-strap.dir}/library.complete" verbose="no"/>
<stopwatch name="strap.lib.timer" action="total"/>
</target>
<target name="strap.pre-comp" depends="strap.lib">
<uptodate property="strap.comp.available" targetfile="${build-strap.dir}/compiler.complete">
<srcfiles dir="${src.dir}/compiler"/>
</uptodate>
</target>
<target name="strap.comp" depends="strap.pre-comp" unless="strap.comp.available">
<stopwatch name="strap.comp.timer"/>
<mkdir dir="${build-strap.dir}/classes/compiler"/>
<scalac
srcdir="${src.dir}/compiler"
destdir="${build-strap.dir}/classes/compiler"
target="jvm-1.5">
<include name="**/*.scala"/>
<classpath>
<pathelement location="${build-strap.dir}/classes/library"/>
<pathelement location="${build-strap.dir}/classes/compiler"/>
<pathelement location="${fjbg.jar}"/>
<pathelement location="${msil.jar}"/>
<pathelement location="${jline.jar}"/>
<pathelement location="${ant.jar}"/>
</classpath>
</scalac>
<propertyfile file="${build-strap.dir}/classes/compiler/compiler.properties">
<entry key="version.number" value="${version.number}"/>
<entry key="copyright.string" value="${copyright.string}"/>
</propertyfile>
<copy todir="${build-strap.dir}/classes/compiler">
<fileset dir="${src.dir}/compiler">
<include name="**/*.tmpl"/>
<include name="**/*.xml"/>
<include name="**/*.js"/>
<include name="**/*.css"/>
</fileset>
</copy>
<touch file="${build-strap.dir}/compiler.complete" verbose="no"/>
<stopwatch name="strap.comp.timer" action="total"/>
</target>
<target name="strap.pre-partest" depends="strap.comp">
<uptodate property="strap.partest.available" targetfile="${build-strap.dir}/partest.complete">
<srcfiles dir="${src.dir}/partest"/>
</uptodate>
</target>
<target name="strap.partest" depends="strap.pre-partest" unless="strap.partest.available">
<stopwatch name="strap.partest.timer"/>
<mkdir dir="${build-strap.dir}/classes/partest"/>
<javac
srcdir="${src.dir}/partest"
destdir="${build-strap.dir}/classes/partest"
target="1.5" source="1.5">
<classpath>
<pathelement location="${build-strap.dir}/classes/library"/>
<pathelement location="${build-strap.dir}/classes/compiler"/>
<pathelement location="${build-strap.dir}/classes/partest"/>
</classpath>
<include name="**/*.java"/>
</javac>
<scalac
srcdir="${src.dir}/partest"
destdir="${build-strap.dir}/classes/partest"
target="jvm-1.5">
<include name="**/*.scala"/>
<classpath>
<pathelement location="${build-strap.dir}/classes/library"/>
<pathelement location="${build-strap.dir}/classes/compiler"/>
<pathelement location="${build-strap.dir}/classes/partest"/>
<pathelement location="${ant.jar}"/>
</classpath>
</scalac>
<copy todir="${build-strap.dir}/classes/partest">
<fileset dir="${src.dir}/partest">
<include name="**/*.xml"/>
</fileset>
</copy>
<touch file="${build-strap.dir}/partest.complete" verbose="no"/>
<stopwatch name="strap.partest.timer" action="total"/>
</target>
<target name="strap.done" depends="strap.partest"/>
<target name="strap.clean">
<delete dir="${build-strap.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/>
</target>
<!-- ===========================================================================
DOCUMENTATION
============================================================================ -->
<target name="docs.start" depends="pack.done"/>
<target name="docs.pre-lib" depends="docs.start">
<uptodate property="docs.lib.available" targetfile="${build-docs.dir}/library.complete">
<srcfiles dir="${src.dir}">
<include name="library/**"/>
<include name="dbc/**"/>
<include name="actors/**"/>
</srcfiles>
</uptodate>
</target>
<target name="docs.lib" depends="docs.pre-lib" unless="docs.lib.available">
<stopwatch name="docs.lib.timer"/>
<mkdir dir="${build-docs.dir}/library"/>
<scaladoc
destdir="${build-docs.dir}/library"
windowtitle="Scala Library"
doctitle="Scala ${version.number} API"
classpathref="pack.classpath">
<src>
<files includes="${src.dir}/actors"/>
<files includes="${src.dir}/library/scala"/>
</src>
<include name="**/*.scala"/>
<exclude name="reflect/Code.scala"/>
<exclude name="reflect/Manifest.scala"/>
<exclude name="reflect/Print.scala"/>
<exclude name="reflect/Symbol.scala"/>
<exclude name="reflect/Tree.scala"/>
<exclude name="reflect/Type.scala"/>
<exclude name="reflect/TypedCode.scala"/>
<exclude name="runtime/*Array.scala"/>
<exclude name="runtime/*$.scala"/>
<exclude name="runtime/ScalaRunTime.scala"/>
<exclude name="runtime/StreamCons.scala"/>
<exclude name="runtime/StringAdd.scala"/>
</scaladoc>
<touch file="${build-docs.dir}/library.complete" verbose="no"/>
<stopwatch name="docs.lib.timer" action="total"/>
</target>
<target name="docs.pre-man" depends="docs.lib">
<uptodate property="docs.man.available" targetfile="${build-docs.dir}/manual.complete">
<srcfiles dir="${src.dir}/manual"/>
</uptodate>
</target>
<target name="docs.manmaker" depends="docs.pre-man" unless="docs.man.available">
<mkdir dir="${build.dir}/manmaker/classes"/>
<scalac
destdir="${build.dir}/manmaker/classes"
classpathref="pack.classpath"
srcdir="${src.dir}/manual"
includes="**/*.scala"/>
<path id="manual.classpath">
<pathelement location="${build-pack.dir}/lib/scala-library.jar"/>
<pathelement location="${build.dir}/manmaker/classes"/>
</path>
</target>
<target name="docs.man" depends="docs.manmaker" unless="docs.man.available">
<mkdir dir="${build-docs.dir}/manual/man/man1"/>
<mkdir dir="${build-docs.dir}/manual/html"/>
<taskdef name="genman"
classname="scala.tools.docutil.ManMaker"
classpathref="manual.classpath"/>
<genman command="fsc, sbaz, scala, scalac, scaladoc, scalap"
htmlout="${build-docs.dir}/manual/html"
manout="${build-docs.dir}/manual/man"/>
<fixcrlf srcdir="${build-docs.dir}/manual" eol="unix" includes="**/*.1"/>
<copy todir="${build-docs.dir}/manual/html">
<fileset dir="${src.dir}/manual/scala/tools/docutil/resources">
<include name="**/*.html"/>
<include name="**/*.css"/>
<include name="**/*.gif"/>
<include name="**/*.png"/>
</fileset>
</copy>
<touch file="${build-docs.dir}/manual.complete" verbose="no"/>
</target>
<target name="docs.pre-comp" depends="docs.man">
<uptodate property="docs.comp.available" targetfile="${build-docs.dir}/compiler.complete">
<srcfiles dir="${src.dir}/compiler"/>
</uptodate>
</target>
<target name="docs.comp" depends="docs.pre-comp" unless="docs.comp.available">
<stopwatch name="docs.comp.timer"/>
<mkdir dir="${build-docs.dir}/compiler"/>
<scaladoc
destdir="${build-docs.dir}/compiler"
windowtitle="Scala Compiler"
doctitle="Scala Compiler ${version.number} API"
classpathref="pack.classpath"
srcdir="${src.dir}/compiler">
<include name="**/*.scala"/>
</scaladoc>
<touch file="${build-docs.dir}/compiler.complete" verbose="no"/>
<stopwatch name="docs.comp.timer" action="total"/>
</target>
<target name="docs.done" depends="docs.man"/>
<target name="docs.clean">
<delete dir="${build-docs.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/>
<delete dir="${build.dir}/manmaker" includeemptydirs="yes" quiet="yes" failonerror="no"/>
</target>
<!-- ===========================================================================
BOOTRAPING TEST AND TEST SUITE
============================================================================ -->
<target name="test.stability" depends="strap.done">
<same dir="${build-quick.dir}" todir="${build-strap.dir}" failondifferent="no">
<exclude name="**/*.properties"/>
<exclude name="bin/**"/>
<exclude name="*.complete"/>
</same>
</target>
<target name="test.suite" depends="pack.done">
<partest showlog="yes" erroronfailed="yes" javacmd="${java.home}/bin/java">
<classpath>
<path refid="pack.classpath"/>
<fileset dir="${test.dir}/files/lib" includes="*.jar"/>
</classpath>
<postests dir="${test.dir}/files/pos" includes="*.scala"/>
<negtests dir="${test.dir}/files/neg" includes="*.scala"/>
<runtests dir="${test.dir}/files">
<include name="run/**/*.scala"/>
<include name="jvm/**/*.scala"/>
<include name="jvm5/**/*.scala"/>
</runtests>
<residenttests dir="${test.dir}/files/res" includes="*.res"/>
</partest>
</target>
<target name="test.done" depends="test.suite, test.stability"/>
<!-- ===========================================================================
DISTRIBUTION
============================================================================ -->
<target name="dist.start" depends="docs.done, pack.done">
<property name="dist.dir" value="${dists.dir}/scala-${version.number}"/>
</target>
<target name="dist.base" depends="dist.start">
<mkdir dir="${dist.dir}/lib"/>
<copy toDir="${dist.dir}/lib">
<fileset dir="${build-pack.dir}/lib"/>
</copy>
<mkdir dir="${dist.dir}/bin"/>
<copy toDir="${dist.dir}/bin">
<fileset dir="${build-pack.dir}/bin"/>
</copy>
<chmod perm="ugo+rx" file="${dist.dir}/bin/scala"/>
<chmod perm="ugo+rx" file="${dist.dir}/bin/scalac"/>
<chmod perm="ugo+rx" file="${dist.dir}/bin/scaladoc"/>
<chmod perm="ugo+rx" file="${dist.dir}/bin/fsc"/>
</target>
<target name="dist.latest" depends="dist.base" unless="os.win">
<symlink link="${dists.dir}/latest" resource="${dist.dir}" overwrite="yes"/>
</target>
<target name="dist.doc" depends="dist.latest">
<mkdir dir="${dist.dir}/doc/scala"/>
<copy file="${docs.dir}/LICENSE" toDir="${dist.dir}/doc/scala"/>
<copy file="${docs.dir}/README" toDir="${dist.dir}/doc/scala"/>
<mkdir dir="${dist.dir}/doc/scala/api"/>
<copy toDir="${dist.dir}/doc/scala/api">
<fileset dir="${build-docs.dir}/library"/>
</copy>
<mkdir dir="${dist.dir}/doc/scala/examples"/>
<copy toDir="${dist.dir}/doc/scala/examples">
<fileset dir="${docs.dir}/examples"/>
</copy>
<mkdir dir="${dist.dir}/doc/scala/tools"/>
<copy toDir="${dist.dir}/doc/scala/tools">
<fileset dir="${build-docs.dir}/manual/html"/>
</copy>
</target>
<target name="dist.man" depends="dist.doc">
<mkdir dir="${dist.dir}/man"/>
<copy toDir="${dist.dir}/man">
<fileset dir="${build-docs.dir}/manual/man"/>
</copy>
</target>
<target name="dist.src" depends="dist.man">
<mkdir dir="${dist.dir}/src"/>
<jar destfile="${dist.dir}/src/scala-library-src.jar">
<fileset dir="${src.dir}/library"/>
<fileset dir="${src.dir}/actors"/>
</jar>
<jar destfile="${dist.dir}/src/scala-dbc-src.jar">
<fileset dir="${src.dir}/dbc"/>
</jar>
<jar destfile="${dist.dir}/src/scala-compiler-src.jar">
<fileset dir="${src.dir}/compiler"/>
</jar>
</target>
<target name="dist.done" depends="dist.src"/>
<target name="dist.clean">
<delete dir="${dists.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/>
</target>
<!-- ===========================================================================
TEST AND DISTRIBUTION BUNDLE (ALL)
============================================================================ -->
<target name="all.done" depends="dist.done, test.done"/>
<target name="all.clean" depends="locker.clean, docs.clean, dist.clean"/>
<!-- ===========================================================================
STABLE REFERENCE (STARR)
============================================================================ -->
<target name="starr.start" depends="pack.done"/>
<target name="starr.clean" depends="locker.clean, starr.start">
<delete file="${lib.starr.jar}"/>
<delete file="${comp.starr.jar}"/>
<delete file="${lib.dir}/scala-library-src.jar"/>
</target>
<target name="starr.lib" depends="starr.clean">
<copy file="${build-pack.dir}/lib/scala-library.jar" toFile="${lib.starr.jar}"/>
</target>
<target name="starr.comp" depends="starr.lib">
<jar destfile="${comp.starr.jar}">
<fileset dir="${build-quick.dir}/classes/compiler"/>
</jar>
</target>
<target name="starr.src" depends="starr.comp">
<jar destfile="${lib.dir}/scala-library-src.jar">
<fileset dir="${src.dir}/library"/>
<fileset dir="${src.dir}/actors"/>
</jar>
</target>
<target name="starr.done" depends="starr.src"/>
<!-- ===========================================================================
FORWARDED TARGETS FOR JVM 1.4 BUILD
============================================================================ -->
<target name="four" depends="pack.done">
<ant antfile="${src.dir}/build/four.xml" target="four-pack.done" inheritall="yes" inheritrefs="yes"/>
</target>
<target name="fourtest" depends="pack.done">
<ant antfile="${src.dir}/build/four.xml" target="four-test.done" inheritall="yes" inheritrefs="yes"/>
</target>
<target name="fourdist" depends="pack.done">
<ant antfile="${src.dir}/build/four.xml" target="four-all.done" inheritall="yes" inheritrefs="yes"/>
</target>
<target name="fourclean">
<ant antfile="${src.dir}/build/four.xml" target="four-all.clean" inheritall="yes" inheritrefs="yes"/>
</target>
<!-- ===========================================================================
FORWARDED TARGETS FOR MSIL BUILD
============================================================================ -->
<target name="msil" depends="pack.done">
<ant antfile="${src.dir}/build/msil.xml" target="msil-pack.done" inheritall="yes" inheritrefs="yes"/>
</target>
<target name="msiltest"/>
<target name="msildist" depends="pack.done">
<ant antfile="${src.dir}/build/msil.xml" target="msil-all.done" inheritall="yes" inheritrefs="yes"/>
</target>
<target name="msilclean">
<ant antfile="${src.dir}/build/msil.xml" target="msil-all.clean" inheritall="yes" inheritrefs="yes"/>
</target>
<!-- ===========================================================================
FORWARDED TARGETS FOR PACKAGING
============================================================================ -->
<target name="distpack" depends="dist.done">
<ant antfile="${src.dir}/build/pack.xml" target="pack-all.done" inheritall="yes" inheritrefs="yes"/>
</target>
<target name="fourdistpack" depends="pack.done">
<ant antfile="${src.dir}/build/four.xml" target="four-dist.done" inheritall="yes" inheritrefs="yes"/>
<ant antfile="${src.dir}/build/pack.xml" target="fourpack-all.done" inheritall="yes" inheritrefs="yes"/>
</target>
<target name="msildistpack" depends="pack.done">
<ant antfile="${src.dir}/build/msil.xml" target="msil-dist.done" inheritall="yes" inheritrefs="yes"/>
<ant antfile="${src.dir}/build/pack.xml" target="msilpack-all.done" inheritall="yes" inheritrefs="yes"/>
</target>
<!-- ===========================================================================
FORWARDED TARGETS FOR NIGHTLY BUILDS
============================================================================ -->
<target name="nightly" depends="all.done">
<ant antfile="${src.dir}/build/pack.xml" target="pack-all.done" inheritall="yes" inheritrefs="yes"/>
</target>
<target name="fournightly" depends="pack.done">
<ant antfile="${src.dir}/build/four.xml" target="four-all.done" inheritall="yes" inheritrefs="yes"/>
<ant antfile="${src.dir}/build/pack.xml" target="fourpack-all.done" inheritall="yes" inheritrefs="yes"/>
</target>
<target name="fourfournightly">
<ant antfile="${src.dir}/build/four.xml" target="fourfour-test.done"/>
</target>
<target name="msilnightly" depends="pack.done">
<ant antfile="${src.dir}/build/msil.xml" target="msil-all.done" inheritall="yes" inheritrefs="yes"/>
<ant antfile="${src.dir}/build/pack.xml" target="msilpack-all.done" inheritall="yes" inheritrefs="yes"/>
</target>
<!-- ===========================================================================
MISCELLANEOUS
============================================================================ -->
<target name="graph.init">
<taskdef name="vizant" classname="vizant.Vizant" classpath="${lib-ant.dir}/vizant.jar"/>
</target>
<target name="graph.clean" depends="graph.init">
<vizant antfile="${ant.file}" outfile="${ant.project.name}.dot" from="starr.clean"/>
</target>
<target name="graph.all" depends="graph.init">
<vizant antfile="${ant.file}" outfile="${ant.project.name}.dot" from="all.done"/>
</target>
<target name="graph.sabbus" depends="graph.init">
<vizant antfile="${ant.file}" outfile="${ant.project.name}.dot"/>
</target>
<!-- ===========================================================================
MAKE SABBUS JAR (to remove once sabbus is part of starr library)
============================================================================ -->
<target name="sabbus.start" depends="init"/>
<target name="sabbus.build" depends="sabbus.start">
<taskdef resource="scala/tools/ant/antlib.xml" classpathref="starr.classpath"/>
<mkdir dir="${build.dir}/sabbus"/>
<scalac
srcdir="${src.dir}/compiler/scala/tools/ant/sabbus/"
destdir="${build.dir}/sabbus"
target="jvm-1.5">
<include name="*.scala"/>
<classpath>
<pathelement location="${lib.starr.jar}"/>
<pathelement location="${comp.starr.jar}"/>
<pathelement location="${ant.jar}"/>
</classpath>
</scalac>
<copy
file="${src.dir}/compiler/scala/tools/ant/sabbus/antlib.xml"
todir="${build.dir}/sabbus/scala/tools/ant/sabbus"/>
<jar
destfile="${lib.dir}/sabbus.jar"
basedir="${build.dir}/sabbus"/>
</target>
<target name="sabbus.done" depends="sabbus.build"/>
</project>
|