2005-10-11 17:39:32 +08:00
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id$ -->
2005-10-13 21:57:02 +08:00
2005-12-19 21:49:03 +08:00
<project name= "scala-core" default= "build" >
<description >
2006-01-21 00:15:13 +08:00
I am SABBUS for Scala-core, the build system for the Scala compiler and core
2005-12-19 21:49:03 +08:00
library. Please check the 'docs/README' file for more information about me.
</description>
2006-03-02 22:01:45 +08:00
2006-03-06 22:12:09 +08:00
<echo level= "info" message= "Running SABBUS for Scala-core..." />
2005-12-19 21:49:03 +08:00
2005-12-24 02:17:24 +08:00
<!-- ===========================================================================
PROPERTIES
============================================================================ -->
2006-03-02 22:01:45 +08:00
2005-12-19 21:49:03 +08:00
<property environment= "env" />
<condition property= "memory.set" >
2005-12-22 09:50:44 +08:00
<contains string= "${env.ANT_OPTS}" substring= "-Xmx" />
2005-12-19 21:49:03 +08:00
</condition>
<fail unless= "memory.set" >
2006-01-21 00:15:13 +08:00
SABBUS requires additional memory. Please set the 'ANT_OPTS' environment
2006-03-06 22:12:09 +08:00
property to '-Xmx512M' or more.
2005-12-19 21:49:03 +08:00
</fail>
<!-- Prevents system classpath from being used -->
<property name= "build.sysclasspath" value= "ignore" />
<!-- Base properties -->
<property name= "docs.dir" value= "${basedir}/docs" />
2006-03-08 00:42:36 +08:00
<property name= "examples.dir" value= "${docs.dir}/examples" />
2005-12-19 21:49:03 +08:00
<property name= "lib.dir" value= "${basedir}/lib" />
<property name= "src.dir" value= "${basedir}/src" />
<property name= "test.dir" value= "${basedir}/test" />
<!-- User properties -->
<property file= "${basedir}/build.properties" />
<!-- General properties -->
2006-03-08 00:42:36 +08:00
<property file= "${basedir}/build.product.properties" />
2006-01-26 20:39:54 +08:00
<property name= "copyright" value= "(c) 2002-2006 LAMP/EPFL" />
2005-12-19 21:49:03 +08:00
<!-- NSC configuration properties -->
<property name= "nsc.logging" value= "none" />
2006-02-27 22:03:57 +08:00
<property name= "nsc.log-files" value= "no" />
2006-01-26 20:39:54 +08:00
<property name= "nsc.excludes" value= "${basedir}/build.excludes" />
2006-01-10 02:28:11 +08:00
<property name= "nsc.params" value= "" />
2006-03-02 22:01:45 +08:00
<property name= "nsc.timers" value= "${basedir}/build.timers" />
<!-- SVN configuration properties -->
<property name= "svn.entries" value= "${basedir}/.svn/entries" />
2005-12-19 21:49:03 +08:00
<!-- Location of pre - compiled libraries properties -->
<property name= "starr.lib.jar" value= "${lib.dir}/scala-library.jar" />
<property name= "starr.comp.jar" value= "${lib.dir}/scala-compiler.jar" />
<property name= "jaco.jar" value= "${lib.dir}/jaco.jar" />
2005-12-22 04:31:59 +08:00
<property name= "fjbg.name" value= "fjbg.jar" />
<property name= "fjbg.jar" value= "${lib.dir}/${fjbg.name}" />
2005-12-19 21:49:03 +08:00
<property name= "ant.jar" value= "${ant.home}/lib/ant.jar" />
2005-12-24 02:17:24 +08:00
<property name= "ant-contrib.jar" value= "${lib.dir}/ant-contrib.jar" />
2005-12-19 21:49:03 +08:00
<!-- Location of build products properties -->
2005-12-20 01:17:19 +08:00
<property name= "build.dir" value= "${basedir}/build" />
<property name= "locker.dir" value= "${build.dir}/locker" />
<property name= "quick.dir" value= "${build.dir}/quick" />
<property name= "strap.dir" value= "${build.dir}/strap" />
2005-12-19 21:49:03 +08:00
<!-- Location of source and build elements names properties -->
<property name= "lib.dir.name" value= "library" />
<property name= "comp.dir.name" value= "compiler" />
<property name= "exec.dir.name" value= "exec" />
<!-- Location of structure of the distribution properties -->
2005-12-20 01:17:19 +08:00
<property name= "dist.dir" value= "${basedir}/dists" />
<property name= "dist.latest.dir" value= "${dist.dir}/latest" />
2006-02-16 17:43:31 +08:00
<property name= "dist.name" value= "scala" />
2005-12-20 01:17:19 +08:00
<property name= "lib.jar.name" value= "${dist.name}-${lib.dir.name}.jar" />
<property name= "comp.jar.name" value= "${dist.name}-${comp.dir.name}.jar" />
2006-01-19 23:22:54 +08:00
<property name= "scala.exec.name" value= "${dist.name}" />
2006-02-16 17:43:31 +08:00
<property name= "scalai.exec.name" value= "scalai" />
<property name= "scalac.exec.name" value= "scalac" />
2006-03-08 18:08:40 +08:00
<property name= "scaladoc.exec.name" value= "scaladoc" />
2006-02-20 11:03:23 +08:00
<property name= "scalaint.exec.name" value= "scalaint" />
2006-02-16 17:43:31 +08:00
<property name= "scalatok.exec.name" value= "scalatok" />
2005-12-19 21:49:03 +08:00
<!-- Shorcut names -->
<property name= "locker.lib.dir" value= "${locker.dir}/${lib.dir.name}" />
<property name= "locker.comp.dir" value= "${locker.dir}/${comp.dir.name}" />
<property name= "quick.lib.dir" value= "${quick.dir}/${lib.dir.name}" />
<property name= "quick.comp.dir" value= "${quick.dir}/${comp.dir.name}" />
<property name= "strap.lib.dir" value= "${strap.dir}/${lib.dir.name}" />
<property name= "strap.comp.dir" value= "${strap.dir}/${comp.dir.name}" />
2006-02-16 17:43:31 +08:00
<!-- sbaz properties -->
2006-02-20 11:03:23 +08:00
<property name= "scala.sbaz.name" value= "scala" />
<property name= "scalac.sbaz.name" value= "scalac" />
<property name= "scalaint.sbaz.name" value= "scalaint" />
2005-12-19 21:49:03 +08:00
2005-12-24 02:17:24 +08:00
<!-- ===========================================================================
INITIALISATION
============================================================================ -->
2005-12-23 02:21:56 +08:00
2006-01-21 00:15:13 +08:00
<target name= "init" unless= "init.avail" >
2006-03-06 22:12:09 +08:00
<tstamp prefix= "start" >
<format
property="human-time"
pattern="EEEE, d MMMM yyyy, HH:mm:ss (zz)"
/>
</tstamp>
2005-12-19 21:49:03 +08:00
<!-- Testing if everything is in place -->
2006-03-06 22:12:09 +08:00
<echo level= "verbose" message= "starr.lib.jar=${starr.lib.jar}" />
2005-12-19 21:49:03 +08:00
<fail message= "STARR library in 'lib/' is not available" >
<condition > <not > <and >
2006-03-06 22:12:09 +08:00
<available
classname="scala.Predef"
classpath="${starr.lib.jar}"
/>
<available
classname="scala.List"
classpath="${starr.lib.jar}"
/>
<available
classname="scala.runtime.ObjectRef"
classpath="${starr.lib.jar}"
/>
2005-12-19 21:49:03 +08:00
</and> </not> </condition>
</fail>
2006-03-06 22:12:09 +08:00
<echo level= "verbose" message= "starr.comp.jar=${starr.comp.jar}" />
2005-12-19 21:49:03 +08:00
<fail message= "STARR compiler in 'lib/' is not available" >
<condition > <not >
2006-03-06 22:12:09 +08:00
<available
classname="scala.tools.ant.Scalac"
classpath="${starr.comp.jar}:${starr.lib.jar}"
/>
2005-12-19 21:49:03 +08:00
</not> </condition>
</fail>
2006-03-06 22:12:09 +08:00
<echo level= "verbose" message= "fjbg.jar=${fjbg.jar}" />
2005-12-19 21:49:03 +08:00
<fail message= "FJBG library in 'lib/' is not available" >
<condition > <not >
2006-03-06 22:12:09 +08:00
<available
classname="ch.epfl.lamp.fjbg.JCode"
classpath="${fjbg.jar}"
/>
2005-12-19 21:49:03 +08:00
</not> </condition>
</fail>
2006-03-06 22:12:09 +08:00
<echo level= "verbose" message= "jaco.jar=${jaco.jar}" />
2005-12-19 21:49:03 +08:00
<fail message= "JaCo compiler in 'lib/' is not available" >
<condition > <not >
<available classname= "jaco.pizza.Main" classpath= "${jaco.jar}" />
</not> </condition>
</fail>
2006-03-06 22:12:09 +08:00
<echo level= "verbose" message= "ant.jar=${ant.jar}" />
<echo level= "verbose" message= "ant-contrib.jar=${ant-contrib.jar}" />
2005-12-24 02:17:24 +08:00
<fail message= "Additional Ant tasks in 'lib/' is not available" >
<condition > <not >
2006-03-06 22:12:09 +08:00
<available
classname="net.sf.antcontrib.AntContribVersion"
classpath="${ant-contrib.jar}"
/>
2005-12-24 02:17:24 +08:00
</not> </condition>
</fail>
<!-- Creating class - pathes -->
<path id= "common.classpath" >
<pathelement location= "${fjbg.jar}" />
</path>
<path id= "starr.classpath" >
<pathelement location= "${starr.lib.jar}" />
<pathelement location= "${starr.comp.jar}" />
<path refid= "common.classpath" />
</path>
<!-- Creating boot - level tasks -->
<taskdef resource= "net/sf/antcontrib/antlib.xml" >
<classpath >
2006-01-05 00:57:36 +08:00
<pathelement location= "${ant-contrib.jar}" />
2005-12-24 02:17:24 +08:00
</classpath>
</taskdef>
<!-- Finding out what system architecture is being used -->
<condition property= "os.win" >
<os family= "windows" />
</condition>
<if > <isset property= "os.win" />
<then >
2006-03-06 22:12:09 +08:00
<exec
executable="cygpath"
vmlauncher="no"
errorproperty="cygpath.err"
outputproperty="cygpath.out"
>
2005-12-24 02:17:24 +08:00
<arg value= "--windir" />
</exec>
<condition property= "os.cygwin" >
<equals arg1= "${cygpath.err}" arg2= "" />
</condition>
</then>
</if>
<condition property= "os.unix" >
<or >
<os family= "unix" />
<os family= "mac" />
<isset property= "os.cygwin" />
</or>
</condition>
<if > <isset property= "os.cygwin" />
2006-03-06 22:12:09 +08:00
<then > <property name= "os.type" value= "Cygwin" /> </then>
2005-12-24 02:17:24 +08:00
<elseif > <isset property= "os.win" />
2006-03-06 22:12:09 +08:00
<then > <property name= "os.type" value= "Windows" /> </then>
2005-12-24 02:17:24 +08:00
</elseif>
<elseif > <isset property= "os.unix" />
2006-03-06 22:12:09 +08:00
<then > <property name= "os.type" value= "UNIX" /> </then>
2005-12-24 02:17:24 +08:00
</elseif>
<else >
<fail > System environment could not be determined</fail>
</else>
</if>
2006-03-06 22:12:09 +08:00
<echo
level="info"
message="OS: ${os.type} (${os.name} ${os.arch} ${os.version});"
/>
<echo
level="info"
message="Java: ${java.version} ('${java.home}');"
/>
<echo
level="info"
message="JVM: ${java.vm.name} ${java.vm.version};"
/>
<echo
level="info"
message="Ant: ${ant.version}."
/>
2006-01-21 00:38:11 +08:00
</target>
2006-03-02 22:01:45 +08:00
2006-01-21 00:38:11 +08:00
<target name= "setup" depends= "init" >
<!-- Creating boot - level tasks -->
2006-03-06 22:12:09 +08:00
<taskdef
name="starr"
classname="scala.tools.ant.Scalac"
classpathref="starr.classpath"
/>
<taskdef
name="starrtool"
classname="scala.tools.ant.ScalaTool"
classpathref="starr.classpath"
/>
<taskdef
name="pico"
classname="jaco.pizza.ant.Pico"
classpath="${jaco.jar}"
/>
2006-01-21 00:15:13 +08:00
<!-- Removing any outdated stuff -->
<if >
<and >
<available file= "${locker.dir}/complete" />
<not > <uptodate targetfile= "${locker.dir}/complete" >
<srcfiles dir= "${lib.dir}" includes= "scala-*.jar" />
</uptodate> </not>
</and>
<then >
2006-03-06 22:12:09 +08:00
<echo
level="warning"
message="STARR updated: LOCKER is obsolete and will be rebuilt."
/>
<runtarget target= "clean.build" />
2006-01-21 00:15:13 +08:00
</then>
</if>
<!-- Finding out what is available -->
<available property= "excludes.avail" file= "${nsc.excludes}" />
2006-03-06 22:12:09 +08:00
<echo level= "verbose" message= "excludes.avail=${excludes.avail}" />
2006-01-21 00:15:13 +08:00
<condition property= "locker.avail" >
<available file= "${locker.dir}/complete" />
</condition>
2005-12-19 21:49:03 +08:00
<!-- Defining version number -->
2006-03-06 22:12:09 +08:00
<loadfile
property="entries"
srcFile="${svn.entries}"
failonerror="false"
/>
<propertyregex
2006-03-08 00:42:36 +08:00
property="svn.revision"
2006-03-06 22:12:09 +08:00
input="${entries}"
regexp="revision=\042([0-9]*)\042\.*"
select="\1"
defaultValue="x"
/>
2006-03-08 00:42:36 +08:00
<!-- see http://www.xfree86.org/4.1.0/Versions2.html -->
<!-- or http://mail - index.netbsd.org/tech - kern/2004/09/30/0020.html -->
<property name= "version.number"
value="${version.major}.${version.minor}.${version.patch}.${svn.revision}"/>
2006-03-06 22:12:09 +08:00
<echo level= "verbose" message= "version.number=${version.number}" />
2006-03-08 00:42:36 +08:00
<condition property= "version.number.valid" >
<length string= "${version.number}" when= "greater" length= "6" />
</condition>
<fail unless= "version.number.valid" >
Version number is invalid. Please check the 'version.*' properties
in file ${basedir}/build.product.properties.
</fail>
2006-03-06 22:12:09 +08:00
<property
name="dist.current.dir"
value="${dist.dir}/${dist.name}-${version.number}"
/>
<echo
file="${nsc.timers}"
append="true"
2006-03-08 18:08:40 +08:00
message="${line.separator}Revision ${svn.revision};${line.separator} built ${start.human-time};${line.separator} by ${java.vm.name} ${java.vm.version};${line.separator} on ${os.name} ${os.arch} ${os.version}:${line.separator}"
2006-03-06 22:12:09 +08:00
/>
2006-01-21 00:15:13 +08:00
<property name= "init.avail" value= "yes" />
2005-12-19 21:49:03 +08:00
</target>
2006-03-02 22:01:45 +08:00
2006-01-21 00:38:11 +08:00
<target name= "setup.locker" depends= "setup, build.locker" >
2005-12-19 21:49:03 +08:00
<path id= "locker.classpath" >
<pathelement location= "${locker.dir}/${lib.dir.name}" />
<pathelement location= "${locker.dir}/${comp.dir.name}" />
<path refid= "common.classpath" />
2005-10-12 19:56:30 +08:00
</path>
2006-03-06 22:12:09 +08:00
<taskdef
name="locker"
classname="scala.tools.ant.Scalac"
classpathref="locker.classpath"
/>
<taskdef
name="lockertool"
classname="scala.tools.ant.ScalaTool"
classpathref="locker.classpath"
/>
2005-12-19 21:49:03 +08:00
</target>
2006-03-02 22:01:45 +08:00
2006-01-21 00:38:11 +08:00
<target name= "setup.quick" depends= "setup, build" >
2005-12-19 21:49:03 +08:00
<path id= "quick.classpath" >
<pathelement location= "${quick.dir}/${lib.dir.name}" />
<pathelement location= "${quick.dir}/${comp.dir.name}" />
<path refid= "common.classpath" />
2005-11-03 01:16:53 +08:00
</path>
2006-03-06 22:12:09 +08:00
<taskdef
name="quick"
classname="scala.tools.ant.Scalac"
classpathref="quick.classpath"
/>
<taskdef
name="quicktool"
classname="scala.tools.ant.ScalaTool"
classpathref="quick.classpath"
/>
<taskdef
name="quicksbaz"
classname="scala.tools.ant.ScalaBazaar"
classpathref="quick.classpath"
/>
2005-12-19 21:49:03 +08:00
</target>
2005-12-24 02:17:24 +08:00
<!-- ===========================================================================
BUILD SUPPORT MACROS
============================================================================ -->
2006-03-02 22:01:45 +08:00
2006-01-09 21:07:02 +08:00
<macrodef name= "build.support" >
<attribute name= "build.dir" />
<sequential >
<copy todir= "@{build.dir}/${lib.dir.name}" >
<fileset dir= "${src.dir}/${lib.dir.name}" >
<include name= "**/*.tmpl" />
<include name= "**/*.xml" />
</fileset>
</copy>
<copy todir= "@{build.dir}/${comp.dir.name}" >
<fileset dir= "${src.dir}/${comp.dir.name}" >
<include name= "**/*.tmpl" />
<include name= "**/*.xml" />
</fileset>
</copy>
</sequential>
</macrodef>
2006-03-02 22:01:45 +08:00
2006-01-21 00:15:13 +08:00
<macrodef name= "build.links" >
<attribute name= "build.dir" />
<sequential >
<if >
<not > <and >
<available file= "@{build.dir}/${fjbg.name}" />
</and> </not>
<then >
<if > <isset property= "os.unix" />
<then >
2006-03-06 22:12:09 +08:00
<symlink
link="@{build.dir}/${fjbg.name}"
resource="${fjbg.jar}"
overwrite="yes"
failonerror="no"
/>
2006-01-21 00:15:13 +08:00
</then>
<else >
<copy file= "${fjbg.jar}" tofile= "@{build.dir}/${fjbg.name}" />
</else>
</if>
</then>
</if>
</sequential>
</macrodef>
2005-12-22 09:50:44 +08:00
2005-12-24 02:17:24 +08:00
<!-- ===========================================================================
BUILD LOCAL REFERENCE (LOCKER) LAYER
============================================================================ -->
2006-01-21 00:15:13 +08:00
2006-03-06 22:12:09 +08:00
<target
name="newlocker"
depends="clean.unfreeze, build.locker"
description="Rebuilds LOCKER from the current sources"
/>
2006-03-02 22:01:45 +08:00
2006-01-21 00:38:11 +08:00
<target name= "build.locker" depends= "setup" unless= "locker.avail" >
2005-12-24 02:17:24 +08:00
<property name= "built.locker" value= "yes" />
2006-03-02 22:01:45 +08:00
<stopwatch name= "timer.locker" />
2005-12-19 21:49:03 +08:00
<!-- Build library -->
<mkdir dir= "${locker.lib.dir}" />
2006-03-06 22:12:09 +08:00
<pico
srcdir="${src.dir}/${lib.dir.name}"
destdir="${locker.lib.dir}"
scalahack="yes"
>
2005-12-19 21:49:03 +08:00
<classpath >
<pathelement location= "${locker.lib.dir}" />
</classpath>
<include name= "**/*.java" />
</pico>
2006-03-06 22:12:09 +08:00
<starr
srcdir="${src.dir}/${lib.dir.name}"
destdir="${locker.lib.dir}"
usepredefs="no"
>
2005-12-19 21:49:03 +08:00
<classpath >
<pathelement location= "${locker.lib.dir}" />
</classpath>
<include name= "scala/Predef.scala" />
<include name= "scala/runtime/ScalaRunTime.scala" />
</starr>
2006-03-06 22:12:09 +08:00
<starr
srcdir="${src.dir}/${lib.dir.name}"
destdir="${locker.lib.dir}"
>
2005-12-19 21:49:03 +08:00
<classpath >
<pathelement location= "${locker.lib.dir}" />
</classpath>
<include name= "**/*.scala" />
<exclude name= "scala/Predef.scala" />
<exclude name= "scala/runtime/ScalaRunTime.scala" />
<excludesfile name= "${nsc.excludes}" if= "excludes.avail" />
</starr>
<!-- Build compiler -->
<mkdir dir= "${locker.comp.dir}" />
2006-03-06 22:12:09 +08:00
<pico
srcdir="${src.dir}/${comp.dir.name}"
destdir="${locker.comp.dir}"
scalahack="yes"
>
2005-12-19 21:49:03 +08:00
<classpath >
<pathelement location= "${locker.lib.dir}" />
<pathelement location= "${locker.comp.dir}" />
</classpath>
<include name= "**/*.java" />
</pico>
2006-03-06 22:12:09 +08:00
<starr
srcdir="${src.dir}/${comp.dir.name}"
destdir="${locker.comp.dir}"
>
2005-12-19 21:49:03 +08:00
<classpath >
<pathelement location= "${locker.lib.dir}" />
<pathelement location= "${locker.comp.dir}" />
<path refid= "starr.classpath" />
<pathelement location= "${ant.jar}" />
</classpath>
<include name= "**/*.scala" />
<excludesfile name= "${nsc.excludes}" if= "excludes.avail" />
</starr>
2006-03-02 22:01:45 +08:00
<stopwatch name= "timer.locker" action= "total" />
2006-03-06 22:12:09 +08:00
<echo
file="${nsc.timers}"
append="true"
message=" building LOCKER: ${timer.locker};${line.separator}"
/>
2006-01-21 00:15:13 +08:00
<!-- Copy support files to build folder and links external libraries -->
2006-01-09 21:07:02 +08:00
<build.support build.dir= "${locker.dir}" />
2006-01-21 00:15:13 +08:00
<build.links build.dir= "${locker.dir}" />
2005-12-19 21:49:03 +08:00
<!-- Build executable files -->
2006-01-10 02:28:11 +08:00
<mkdir dir= "${locker.dir}/${exec.dir.name}" />
2006-03-06 22:12:09 +08:00
<starrtool
file="${locker.dir}/${exec.dir.name}/${scalac.exec.name}"
genericFile="${locker.dir}/${exec.dir.name}/${scala.exec.name}"
name="Scala compiler"
class="scala.tools.nsc.Main"
version="${version.number}"
copyright="${copyright}"
classpath="#SCALA_HOME#/${lib.dir.name}:#SCALA_HOME#/${comp.dir.name}:#SCALA_HOME#/${fjbg.name}"
properties="scala.boot.class.path=#CLASSPATH#"
javaFlags="-Xmx256M -Xms16M"
/>
2006-01-10 02:28:11 +08:00
<chmod file= "${locker.dir}/${exec.dir.name}/${scalac.exec.name}"
perm="ugo+rx"/>
<chmod file= "${locker.dir}/${exec.dir.name}/${scala.exec.name}"
perm="ugo+rx"/>
2006-01-21 00:15:13 +08:00
<touch file= "${locker.dir}/complete" verbose= "no" />
2005-12-19 21:49:03 +08:00
</target>
2005-12-24 02:17:24 +08:00
<!-- ===========================================================================
BUILD QUICK-TEST LAYER
============================================================================ -->
2006-03-02 22:01:45 +08:00
2006-03-06 22:12:09 +08:00
<target
name="build"
depends="setup.locker"
description="Builds a quick-test (QUICK) version of the compiler"
>
2006-03-02 22:01:45 +08:00
<stopwatch name= "timer.quick" />
2005-12-19 21:49:03 +08:00
<!-- Build library -->
<mkdir dir= "${quick.lib.dir}" />
2006-03-06 22:12:09 +08:00
<pico
srcdir="${src.dir}/${lib.dir.name}"
destdir="${quick.lib.dir}"
scalahack="yes"
>
2005-12-19 21:49:03 +08:00
<classpath >
<pathelement location= "${quick.lib.dir}" />
</classpath>
<include name= "**/*.java" />
</pico>
2006-03-06 22:12:09 +08:00
<locker
srcdir="${src.dir}/${lib.dir.name}"
destdir="${quick.lib.dir}"
usepredefs="no"
addparams="${nsc.params}"
scalacdebugging="${nsc.log-files}"
>
2005-12-19 21:49:03 +08:00
<classpath >
<pathelement location= "${quick.lib.dir}" />
</classpath>
<include name= "scala/Predef.scala" />
<include name= "scala/runtime/ScalaRunTime.scala" />
</locker>
2006-03-06 22:12:09 +08:00
<locker
srcdir="${src.dir}/${lib.dir.name}"
destdir="${quick.lib.dir}"
addparams="${nsc.params}"
scalacdebugging="${nsc.log-files}"
>
2005-12-19 21:49:03 +08:00
<classpath >
<pathelement location= "${quick.lib.dir}" />
</classpath>
<include name= "**/*.scala" />
<exclude name= "scala/Predef.scala" />
<exclude name= "scala/runtime/ScalaRunTime.scala" />
<excludesfile name= "${nsc.excludes}" if= "excludes.avail" />
</locker>
<!-- Build compiler -->
<mkdir dir= "${quick.comp.dir}" />
2006-03-06 22:12:09 +08:00
<pico
srcdir="${src.dir}/${comp.dir.name}"
destdir="${quick.comp.dir}"
scalahack="yes"
>
2005-12-19 21:49:03 +08:00
<classpath >
<pathelement location= "${quick.lib.dir}" />
<pathelement location= "${quick.comp.dir}" />
</classpath>
<include name= "**/*.java" />
</pico>
2006-03-06 22:12:09 +08:00
<locker
srcdir="${src.dir}/${comp.dir.name}"
destdir="${quick.comp.dir}"
addparams="${nsc.params}"
scalacdebugging="${nsc.log-files}"
>
2005-12-19 21:49:03 +08:00
<classpath >
<pathelement location= "${quick.lib.dir}" />
<pathelement location= "${quick.comp.dir}" />
<path refid= "locker.classpath" />
<pathelement location= "${ant.jar}" />
</classpath>
<include name= "**/*.scala" />
<excludesfile name= "${nsc.excludes}" if= "excludes.avail" />
</locker>
2006-03-02 22:01:45 +08:00
<stopwatch name= "timer.quick" action= "total" />
2006-03-06 22:12:09 +08:00
<echo
file="${nsc.timers}"
append="true"
message=" building QUICK: ${timer.quick};${line.separator}"
/>
2006-01-21 00:15:13 +08:00
<!-- Copy support files to build folder and links external libraries -->
2006-01-09 21:07:02 +08:00
<build.support build.dir= "${quick.dir}" />
2006-01-21 00:15:13 +08:00
<build.links build.dir= "${quick.dir}" />
2005-12-19 21:49:03 +08:00
<!-- Build executable files -->
2006-01-09 21:07:02 +08:00
<mkdir dir= "${quick.dir}/${exec.dir.name}" />
2006-03-06 22:12:09 +08:00
<lockertool
file="${quick.dir}/${exec.dir.name}/${scalac.exec.name}"
genericFile="${quick.dir}/${exec.dir.name}/${scala.exec.name}"
name="Scala compiler"
class="scala.tools.nsc.Main"
version="${version.number}"
copyright="${copyright}"
classpath="#SCALA_HOME#/${lib.dir.name}:#SCALA_HOME#/${comp.dir.name}:#SCALA_HOME#/${fjbg.name}"
properties="scala.boot.class.path=#CLASSPATH#"
javaFlags="-Xmx256M -Xms16M"
/>
<chmod
file="${quick.dir}/${exec.dir.name}/${scalac.exec.name}"
perm="ugo+rx"
/>
<chmod
file="${quick.dir}/${exec.dir.name}/${scala.exec.name}"
perm="ugo+rx"
/>
2006-03-08 18:08:40 +08:00
<lockertool
file="${quick.dir}/${exec.dir.name}/${scaladoc.exec.name}"
name="Scala doc generator"
class="scala.tools.nsc.Main"
toolflags="-doc"
version="${version.number}"
copyright="${copyright}"
classpath="#SCALA_HOME#/${lib.dir.name}:#SCALA_HOME#/${comp.dir.name}:#SCALA_HOME#/${fjbg.name}"
properties="scala.boot.class.path=#CLASSPATH#"
javaFlags="-Xmx256M -Xms16M"
/>
<chmod
file="${quick.dir}/${exec.dir.name}/${scaladoc.exec.name}"
perm="ugo+rx"
/>
2006-03-06 22:12:09 +08:00
<lockertool
file="${quick.dir}/${exec.dir.name}/${scalaint.exec.name}"
name="Scala interpreter"
class="scala.tools.nsc.MainInterpreter"
version="${version.number}"
copyright="${copyright}"
classpath=""
javaFlags="-Xmx256M -Xms16M"
/>
<chmod
file="${quick.dir}/${exec.dir.name}/${scalaint.exec.name}"
perm="ugo+rx"
/>
2005-12-19 21:49:03 +08:00
</target>
2006-03-02 22:01:45 +08:00
2006-01-21 00:18:24 +08:00
<target name= "test.quick" depends= "build" >
2006-03-06 22:12:09 +08:00
<echo
level="error"
message="Ant test bench is not available yet."
/>
2006-01-21 00:15:13 +08:00
</target>
2005-12-19 21:49:03 +08:00
2005-12-24 02:17:24 +08:00
<!-- ===========================================================================
TEST
============================================================================ -->
2006-03-02 22:01:45 +08:00
2006-03-06 22:12:09 +08:00
<target
name="test"
depends="clean.build, test.stability, test.strap"
description="Tests the build for stability (rebuilds everything)"
/>
2006-03-02 22:01:45 +08:00
2006-01-21 00:38:11 +08:00
<target name= "build.strap" depends= "setup.quick" >
2005-12-19 21:49:03 +08:00
<!-- Build the bootstrap layer -->
2006-03-02 22:01:45 +08:00
<stopwatch name= "timer.strap" />
2005-12-19 21:49:03 +08:00
<!-- Build library -->
<mkdir dir= "${strap.lib.dir}" />
2006-03-06 22:12:09 +08:00
<pico
srcdir="${src.dir}/${lib.dir.name}"
destdir="${strap.lib.dir}"
scalahack="yes"
>
2005-12-19 21:49:03 +08:00
<classpath >
<pathelement location= "${strap.lib.dir}" />
</classpath>
<include name= "**/*.java" />
</pico>
2006-03-06 22:12:09 +08:00
<quick
srcdir="${src.dir}/${lib.dir.name}"
destdir="${strap.lib.dir}"
usepredefs="no"
addparams="${nsc.params}"
>
2005-12-19 21:49:03 +08:00
<classpath >
<pathelement location= "${strap.lib.dir}" />
</classpath>
<include name= "scala/Predef.scala" />
<include name= "scala/runtime/ScalaRunTime.scala" />
</quick>
2006-03-06 22:12:09 +08:00
<quick
srcdir="${src.dir}/${lib.dir.name}"
destdir="${strap.lib.dir}"
addparams="${nsc.params}"
>
2005-12-19 21:49:03 +08:00
<classpath >
<pathelement location= "${strap.lib.dir}" />
</classpath>
<include name= "**/*.scala" />
<exclude name= "scala/Predef.scala" />
<exclude name= "scala/runtime/ScalaRunTime.scala" />
<excludesfile name= "${nsc.excludes}" if= "excludes.avail" />
</quick>
<!-- Build compiler -->
<mkdir dir= "${strap.comp.dir}" />
2006-03-06 22:12:09 +08:00
<pico
srcdir="${src.dir}/${comp.dir.name}"
destdir="${strap.comp.dir}"
scalahack="yes"
>
2005-12-19 21:49:03 +08:00
<classpath >
<pathelement location= "${strap.lib.dir}" />
<pathelement location= "${strap.comp.dir}" />
</classpath>
<include name= "**/*.java" />
</pico>
2006-03-06 22:12:09 +08:00
<quick
srcdir="${src.dir}/${comp.dir.name}"
destdir="${strap.comp.dir}"
addparams="${nsc.params}"
>
2005-12-19 21:49:03 +08:00
<classpath >
<pathelement location= "${strap.lib.dir}" />
<pathelement location= "${strap.comp.dir}" />
<path refid= "quick.classpath" />
<pathelement location= "${ant.jar}" />
</classpath>
<include name= "**/*.scala" />
<excludesfile name= "${nsc.excludes}" if= "excludes.avail" />
</quick>
2006-03-02 22:01:45 +08:00
<stopwatch name= "timer.strap" action= "total" />
2006-03-06 22:12:09 +08:00
<echo
file="${nsc.timers}"
append="true"
message=" building STRAP: ${timer.strap}.${line.separator}"
/>
2006-01-21 00:15:13 +08:00
<!-- Copy support files to build folder and links external libraries -->
2006-01-09 21:07:02 +08:00
<build.support build.dir= "${strap.dir}" />
2006-01-21 00:15:13 +08:00
<build.links build.dir= "${strap.dir}" />
2005-12-19 21:49:03 +08:00
<!-- Build executable files -->
2006-01-09 21:07:02 +08:00
<mkdir dir= "${strap.dir}/${exec.dir.name}" />
2006-03-06 22:12:09 +08:00
<quicktool
file="${strap.dir}/${exec.dir.name}/${scalac.exec.name}"
genericFile="${strap.dir}/${exec.dir.name}/${scala.exec.name}"
name="Scala compiler"
class="scala.tools.nsc.Main"
version="${version.number}"
copyright="${copyright}"
classpath="#SCALA_HOME#/${lib.dir.name}:#SCALA_HOME#/${comp.dir.name}:#SCALA_HOME#/${fjbg.name}"
properties="scala.boot.class.path=#CLASSPATH#"
javaFlags="-Xmx256M -Xms16M"
/>
<chmod
file="${strap.dir}/${exec.dir.name}/${scalac.exec.name}"
perm="ugo+rx"
/>
<chmod
file="${strap.dir}/${exec.dir.name}/${scala.exec.name}"
perm="ugo+rx"
/>
2006-03-08 18:08:40 +08:00
<quicktool
file="${strap.dir}/${exec.dir.name}/${scaladoc.exec.name}"
genericFile="${strap.dir}/${exec.dir.name}/${scala.exec.name}"
name="Scala doc generator"
class="scala.tools.nsc.Main"
toolflags="-doc"
version="${version.number}"
copyright="${copyright}"
classpath="#SCALA_HOME#/${lib.dir.name}:#SCALA_HOME#/${comp.dir.name}:#SCALA_HOME#/${fjbg.name}"
properties="scala.boot.class.path=#CLASSPATH#"
javaFlags="-Xmx256M -Xms16M"
/>
<chmod
file="${strap.dir}/${exec.dir.name}/${scaladoc.exec.name}"
perm="ugo+rx"
/>
2006-03-06 22:12:09 +08:00
<quicktool
file="${strap.dir}/${exec.dir.name}/${scalaint.exec.name}"
name="Scala interpreter"
class="scala.tools.nsc.MainInterpreter"
version="${version.number}"
copyright="${copyright}"
classpath=""
javaFlags="-Xmx256M -Xms16M"
/>
<chmod
file="${strap.dir}/${exec.dir.name}/${scalaint.exec.name}"
perm="ugo+rx"
/>
2006-01-21 00:15:13 +08:00
</target>
2006-03-02 22:01:45 +08:00
2006-01-21 00:15:13 +08:00
<target name= "test.stability" depends= "build.strap" >
2005-12-19 21:49:03 +08:00
<!-- Compares quick and test level -->
<checksum totalproperty= "quick.md5" >
2005-12-20 01:17:19 +08:00
<fileset dir= "${quick.dir}" >
<include name= "${lib.dir.name}/**" />
<include name= "${comp.dir.name}/**" />
</fileset>
2005-12-19 21:49:03 +08:00
</checksum>
2005-12-24 02:17:24 +08:00
<delete quiet= "yes" failonerror= "no" >
2006-03-06 22:12:09 +08:00
<fileset dir= "${quick.dir}" includes= "**/*.MD5" />
2005-12-19 21:49:03 +08:00
</delete>
<checksum totalproperty= "strap.md5" >
2005-12-20 01:17:19 +08:00
<fileset dir= "${strap.dir}" >
<include name= "${lib.dir.name}/**" />
<include name= "${comp.dir.name}/**" />
</fileset>
2005-12-19 21:49:03 +08:00
</checksum>
2005-12-24 02:17:24 +08:00
<delete quiet= "yes" failonerror= "no" >
2006-03-06 22:12:09 +08:00
<fileset dir= "${strap.dir}" includes= "**/*.MD5" />
2005-12-19 21:49:03 +08:00
</delete>
<fail message= "Build is not stable" >
<condition > <not >
<equals arg1= "${quick.md5}" arg2= "${strap.md5}" />
</not> </condition>
</fail>
2006-03-06 22:12:09 +08:00
<echo level= "info" message= "Build is stable." />
2005-12-19 21:49:03 +08:00
</target>
2006-03-02 22:01:45 +08:00
2006-01-21 00:15:13 +08:00
<target name= "test.strap" depends= "build.strap" >
2006-03-06 22:12:09 +08:00
<echo level= "error" message= "Ant test bench is not available yet." />
2006-01-21 00:15:13 +08:00
</target>
2005-12-19 21:49:03 +08:00
2005-12-24 02:17:24 +08:00
<!-- ===========================================================================
2006-03-08 00:42:36 +08:00
DOCUMENTATION
2005-12-24 02:17:24 +08:00
============================================================================ -->
2006-03-02 22:01:45 +08:00
2006-03-06 22:12:09 +08:00
<target
name="docs"
description="Generated the API for library and compiler sources"
>
<echo level= "error" message= "Docs is not available yet." />
2005-12-19 21:49:03 +08:00
</target>
2005-12-24 02:17:24 +08:00
<!-- ===========================================================================
GENERATES A DISTRIBUTION
============================================================================ -->
2005-12-23 02:21:56 +08:00
2006-03-06 22:12:09 +08:00
<target
name="dist"
depends="test"
description="Creates a complete Scala distribution"
>
2005-12-22 04:31:59 +08:00
<mkdir dir= "${dist.current.dir}" />
<mkdir dir= "${dist.current.dir}/lib" />
2006-03-06 22:12:09 +08:00
<jar
destfile="${dist.current.dir}/lib/${comp.jar.name}"
basedir="${strap.comp.dir}"
>
2005-12-20 01:17:19 +08:00
<manifest >
2005-12-24 02:17:24 +08:00
<attribute name= "Signature-Version" value= "${version.number}" />
2005-12-20 01:17:19 +08:00
</manifest>
</jar>
2006-03-06 22:12:09 +08:00
<jar
destfile="${dist.current.dir}/lib/${lib.jar.name}"
basedir="${strap.lib.dir}"
>
2005-12-24 02:17:24 +08:00
<manifest >
<attribute name= "Signature-Version" value= "${version.number}" />
</manifest>
2005-12-20 01:17:19 +08:00
</jar>
2005-12-22 04:31:59 +08:00
<copy file= "${fjbg.jar}" todir= "${dist.current.dir}/lib" />
<mkdir dir= "${dist.current.dir}/bin" />
2006-01-10 01:19:23 +08:00
<!-- Build executable files -->
<mkdir dir= "${dist.current.dir}/bin" />
2006-03-06 22:12:09 +08:00
<quicktool
file="${dist.current.dir}/bin/${scalac.exec.name}"
genericFile="${dist.current.dir}/bin/${scala.exec.name}"
name="Scala compiler"
class="scala.tools.nsc.Main"
version="${version.number}"
copyright="${copyright}"
classpath=""
properties="scala.boot.class.path=#CLASSPATH#"
javaFlags="-Xmx256M -Xms16M"
/>
<chmod
file="${dist.current.dir}/bin/${scalac.exec.name}"
perm="ugo+rx"
/>
<chmod
file="${dist.current.dir}/bin/${scala.exec.name}"
perm="ugo+rx"
/>
2006-03-08 18:08:40 +08:00
<quicktool
file="${dist.current.dir}/bin/${scaladoc.exec.name}"
genericFile="${dist.current.dir}/bin/${scala.exec.name}"
name="Scala compiler"
class="scala.tools.nsc.Main"
toolflags="-doc"
version="${version.number}"
copyright="${copyright}"
classpath=""
properties="scala.boot.class.path=#CLASSPATH#"
javaFlags="-Xmx256M -Xms16M"
/>
<chmod
file="${dist.current.dir}/bin/${scaladoc.exec.name}"
perm="ugo+rx"
/>
2006-03-06 22:12:09 +08:00
<lockertool
file="${dist.current.dir}/bin/${scalaint.exec.name}"
name="Scala interpreter"
class="scala.tools.nsc.MainInterpreter"
version="${version.number}"
copyright="${copyright}"
classpath=""
javaFlags="-Xmx256M -Xms16M"
/>
<chmod
file="${dist.current.dir}/bin/${scalaint.exec.name}"
perm="ugo+rx"
/>
2005-12-24 02:17:24 +08:00
<if > <isset property= "os.unix" />
<then >
2006-03-06 22:12:09 +08:00
<symlink
link="${dist.latest.dir}"
resource="${dist.current.dir}"
overwrite="yes"
failonerror="no"
/>
2005-12-24 02:17:24 +08:00
</then>
2006-03-02 22:01:45 +08:00
</if>
2006-01-19 23:22:54 +08:00
<quicksbaz
2006-03-06 22:12:09 +08:00
file="${dist.dir}/${scalac.sbaz.name}-${version.number}.sbp"
adfile="${dist.dir}/${scalac.sbaz.name}-${version.number}.advert"
name="${scalac.sbaz.name}"
version="${version.number}"
desc="The Scala compiler. This is used to compile Scala programs into Java .class files."
depends="scalac2-support"
>
2006-02-16 17:43:31 +08:00
<libset dir= "${dist.current.dir}/lib" includes= "${dist.name}-compiler.jar" />
<binset dir= "${dist.current.dir}/bin" includes= "${scalac.exec.name}" />
2006-02-20 11:03:23 +08:00
<binset dir= "${dist.current.dir}/bin" includes= "${scalac.exec.name}.bat" />
2006-03-08 18:08:40 +08:00
<binset dir= "${dist.current.dir}/bin" includes= "${scaladoc.exec.name}" />
<binset dir= "${dist.current.dir}/bin" includes= "${scaladoc.exec.name}.bat" />
2006-02-16 17:43:31 +08:00
<manset dir= "${docs.dir}/man" includes= "${scalac.exec.name}.1" />
2006-01-19 23:22:54 +08:00
</quicksbaz>
<quicksbaz
2006-03-06 22:12:09 +08:00
file="${dist.dir}/${scala.sbaz.name}-${version.number}.sbp"
adfile="${dist.dir}/${scala.sbaz.name}-${version.number}.advert"
name="${scala.sbaz.name}"
version="${version.number}"
desc="The Scala command runner. It is a wrapper around the Java VM that, by default, sets up a large CLASSPATH including the Scala library as well as all jars installed in the lib directory of the sbaz-managed directory."
>
2006-02-16 17:43:31 +08:00
<binset dir= "${dist.current.dir}/bin" includes= "${scala.exec.name}" />
2006-02-20 11:03:23 +08:00
<binset dir= "${dist.current.dir}/bin" includes= "${scala.exec.name}.bat" />
2006-02-16 17:43:31 +08:00
<manset dir= "${docs.dir}/man" includes= "${scala.exec.name}.1" />
2006-01-19 23:22:54 +08:00
</quicksbaz>
<quicksbaz
2006-03-06 22:12:09 +08:00
file="${dist.dir}/${scala.sbaz.name}-library-${version.number}.sbp"
adfile="${dist.dir}/${scala.sbaz.name}-library-${version.number}.advert"
name="${scala.sbaz.name}-library"
version="${version.number}"
desc="The base Scala library, required for running all Scala programs."
>
2006-02-16 17:43:31 +08:00
<libset dir= "${dist.current.dir}/lib" includes= "${dist.name}-library.jar" />
2006-01-19 17:35:35 +08:00
</quicksbaz>
2006-02-20 11:03:23 +08:00
<quicksbaz
file="${dist.dir}/${scalaint.sbaz.name}-${version.number}.sbp"
adfile="${dist.dir}/${scalaint.sbaz.name}-${version.number}.advert"
name="${scalaint.sbaz.name}"
version="${version.number}"
depends="${scalac.sbaz.name}"
2006-03-06 22:12:09 +08:00
desc="A command-line interpreter for Scala."
>
2006-02-20 11:03:23 +08:00
<binset dir= "${dist.current.dir}/bin" includes= "${scalaint.exec.name}" />
<binset dir= "${dist.current.dir}/bin" includes= "${scalaint.exec.name}.bat" />
</quicksbaz>
2005-12-19 21:49:03 +08:00
</target>
2005-12-24 02:17:24 +08:00
<!-- ===========================================================================
CLEAN
============================================================================ -->
2006-03-02 22:01:45 +08:00
2005-12-19 21:49:03 +08:00
<macrodef name= "remove" >
<attribute name= "dir" />
<sequential >
2006-03-06 22:12:09 +08:00
<delete
dir="@{dir}"
includeemptydirs="yes"
quiet="yes"
failonerror="no"
/>
2005-12-19 21:49:03 +08:00
</sequential>
</macrodef>
2006-03-02 22:01:45 +08:00
2006-03-06 22:12:09 +08:00
<target name= "clean" description= "Removes QUICK and STRAP build products" >
2006-03-03 22:32:42 +08:00
<remove dir= "${quick.dir}" />
2006-03-06 22:12:09 +08:00
<remove dir= "${strap.dir}" />
</target>
<target name= "clean.build" description= "Removes all build products" >
<remove dir= "${build.dir}" />
2005-12-19 21:49:03 +08:00
</target>
2006-03-02 22:01:45 +08:00
2006-03-06 22:12:09 +08:00
<target
name="clean.all"
description="Removes all build products and distributions"
>
2006-01-21 00:15:13 +08:00
<remove dir= "${build.dir}" />
<remove dir= "${dist.dir}" />
</target>
2006-03-02 22:01:45 +08:00
2006-01-21 00:15:13 +08:00
<target name= "clean.unfreeze" depends= "init" >
2006-03-06 22:12:09 +08:00
<delete
file="${locker.dir}/complete"
quiet="yes"
failonerror="no"
/>
2006-01-21 00:15:13 +08:00
<if >
<not > <isset property= "unsafe" /> </not>
<then >
<remove dir= "${quick.dir}" />
</then>
</if>
2005-12-19 21:49:03 +08:00
</target>
2005-10-11 17:39:32 +08:00
</project>