diff options
-rw-r--r-- | build-old.xml | 2012 | ||||
-rw-r--r-- | build.xml | 2702 |
2 files changed, 2897 insertions, 1817 deletions
diff --git a/build-old.xml b/build-old.xml new file mode 100644 index 0000000000..f8f8dab8c6 --- /dev/null +++ b/build-old.xml @@ -0,0 +1,2012 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- $Id$ --> + +<project name="scala-core" default="build"> + + <description> + I am SABBUS for Scala core, the build system for the Scala compiler and core + library. Please check the 'docs/README' file for more information about me. + </description> + + <echo level="info" message="Running SABBUS for ${ant.project.name}..."/> + +<!-- =========================================================================== +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="src.dir" value="${basedir}/src"/> + <property name="test.dir" value="${basedir}/test"/> + + <!-- Loads custom properties definitions --> + <property name="properties.file" value="${basedir}/build.properties"/> + <property file="${properties.file}"/> + + <!-- Defines the product being built --> + <property name="vendor.name" value="LAMP/EPFL"/> + <property name="copyright.string" value="(c) 2002-2008 ${vendor.name}"/> + <property name="java.flags" value="-Xmx768M -Xms16M"/> + <property name="number.file" value="${basedir}/build.number"/> + + <!-- Configuring how the compiler is run --> + <property name="nsc.log-files" value="no"/> + <property name="nsc.excludes.file" value="${basedir}/build.excludes"/> + <property name="nsc.params" value=""/> + <condition property="nsc.target" value="jvm-1.4"> + <contains string="${ant.java.version}" substring="1.4"/> + </condition> + <property name="nsc.target" value="jvm-1.5"/> + + <!-- 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="ant.jar" value="${ant.home}/lib/ant.jar"/> + <property name="jline.jar" value="${lib.dir}/jline.jar"/> + <property name="ant-contrib.jar" value="${lib.dir}/ant-contrib.jar"/> + + <!-- Sets location of build folders --> + <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"/> + <property name="optimised.dir" value="${build.dir}/optimised"/> + <property name="api-lib.dir" value="${build.dir}/api-library"/> + <property name="api-comp.dir" value="${build.dir}/api-compiler"/> + <property name="tooldocs.dir" value="${build.dir}/tooldocs"/> + <property name="examples.dir" value="${build.dir}/examples"/> +<!-- <property name="cldc.dir" value="${build.dir}/cldc"/> --> + <property name="android.dir" value="${build.dir}/android"/> + <property name="msil.dir" value="${build.dir}/msil"/> + <property name="mono.dir" value="${src.dir}/mono"/> + + <!-- Sets location and structure of the distribution --> + <property name="dist.dir" value="${basedir}/dists"/> + <property name="lib.jar.name" value="scala-library.jar"/> + <property name="dbc.jar.name" value="scala-dbc.jar"/> + <property name="comp.jar.name" value="scala-compiler.jar"/> + <property name="partest.jar.name" value="scala-partest.jar"/> + <property name="jline.jar.name" value="jline.jar"/> + <property name="libsrc.jar.name" value="scala-library-src.jar"/> + <property name="dbcsrc.jar.name" value="scala-dbc-src.jar"/> + <property name="parsrc.jar.name" value="scala-partest-src.jar"/> + <property name="compsrc.jar.name" value="scala-compiler-src.jar"/> + <property name="scala.exec.name" value="scala"/> + <property name="scalac.exec.name" value="scalac"/> + <property name="scaladoc.exec.name" value="scaladoc"/> + <property name="fsc.exec.name" value="fsc"/> + <property name="comp.prop.name" value="compiler.properties"/> + <property name="lib.prop.name" value="library.properties"/> + <property name="par.prop.name" value="partest.properties"/> + + <!-- if available, faster stability checking --> + <property name="stability.tool" value="/home/linuxsoft/apps/stability/stability"/> + +<!-- =========================================================================== +ANT INITIALISATION +============================================================================ --> + + <target name="ant-init"> + <!-- Making sure lib/ contains everything that is needed --> + <fail message="A required library is missing in 'lib/'. The README file describes what should be there."> + <condition><not><and> + <available file="${lib.starr.jar}"/> + <available file="${comp.starr.jar}"/> + <available file="${fjbg.jar}"/> + <available file="${msil.jar}"/> + <available file="${ant-contrib.jar}"/> + </and></not></condition> + </fail> + <!-- Setting-up Ant contrib tasks --> + <taskdef resource="net/sf/antcontrib/antlib.xml" + classpath="${ant-contrib.jar}"/> + <fail message="External library ${ant-contrib.jar} requires the optional Ant tasks to be installed"> + <condition><not><and> + <available file="${ant.home}/lib/ant-nodeps.jar"/> + </and></not></condition> + </fail> + </target> + +<!-- =========================================================================== +INITIALISATION +============================================================================ --> + + <target name="init" depends="ant-init" unless="init.avail"> + <!-- Making sure enough memory is available --> + <propertyregex + property="memory.set" input="${env.ANT_OPTS}" select="\1" + regexp="-Xmx([1-9][0-9]{3,}|[6-9][0-9]{2}|5[2-9][0-9]|51[2-9])(M|m)"/> + <fail + unless="memory.set" + message="SABBUS requires additional memory. Please set the 'ANT_OPTS' environment property to '-Xmx512M' or more."/> + <propertyregex + property="memory.info" input="${env.ANT_OPTS}" defaultValue="" + select=" (raise to 600 MB for performance)" + regexp="-Xmx([1-5][0-9]{2})(M|m)"/> + <!-- This is the start time for the distribution --> + <stopwatch name="timer.dist"/> + <tstamp prefix="time"> + <format property="human" pattern="EEEE, d MMMM yyyy, HH:mm:ss (zz)"/> + <format property="short" pattern="yyyyMMddHHmmss"/> + </tstamp> + <!-- Finding out what system architecture is being used --> + <condition property="os.win"><os family="windows"/></condition> + <if><isset property="os.win"/><then> + <exec + executable="cygpath" vmlauncher="no" + errorproperty="cygpath.err" outputproperty="cygpath.out"> + <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"/> + <then><property name="os.type" value="Cygwin"/></then> + <elseif><isset property="os.win"/> + <then><property name="os.type" value="Windows"/></then> + </elseif> + <elseif><isset property="os.unix"/> + <then><property name="os.type" value="UNIX"/></then> + </elseif> + <else><fail>System environment could not be determined</fail></else> + </if> + <!-- Setting flag for Java versions 1.4.x --> + <condition property="java14"> + <contains string="${java.version}" substring="1.4"/> + </condition> + <!-- Finding out SVN revision --> + <exec + executable="svn" vmlauncher="no" + errorproperty="svn.err" outputproperty="svn.out"> + <arg line=" info ${basedir}"/> + </exec> + <propertyregex + property="svn.number" input="${svn.out}" select="\1" + regexp="Revision: ([0-9]+)" + defaultValue="x"/> + <property name="init.avail" value="yes"/> + <!-- Printing out some information about what environment I am running in --> + <echo level="info" + message="OS: ${os.type} (${os.name} ${os.arch} ${os.version});"/> + <echo level="info" + message="Java: ${java.vm.name} ${java.vm.version} ('${java.home}');"/> + <echo level="info" + message="Memory: ${memory.set} MB${memory.info};"/> + <echo level="info" + message="Ant: ${ant.version}."/> + </target> + +<!-- =========================================================================== +SETUP +============================================================================ --> + + <target name="setup.weave"> + <!-- Sets location of RetroWeaver installation --> + <condition property="retroweaver.home" value="${unix.retroweaver.home}"> + <and><os family="unix"/><isset property="unix.retroweaver.home"/></and> + </condition> + <condition property="retroweaver.home" value="${win.retroweaver.home}"> + <and><os family="windows"/><isset property="win.retroweaver.home"/></and> + </condition> + <property name="retroweaver.home" value="${env.RETROWEAVER_HOME}"/> + + <fail message="Set property 'retroweaver.home' to a valid RetroWeaver installation"> + <condition><not><and> + <available file="${retroweaver.home}/lib" type="dir"/> + <available file="${retroweaver.home}/release" type="dir"/> + </and></not></condition> + </fail> + <taskdef name="retroweaver" classname="net.sourceforge.retroweaver.ant.RetroWeaverTask"> + <classpath> + <fileset dir="${retroweaver.home}/lib" includes="**/*.jar"/> + <fileset dir="${retroweaver.home}/release" includes="**/*-all-*jar"/> + </classpath> + </taskdef> + <retroweaver + inputjar="${lib.starr.jar}" + outputjar="${lib.starr14.jar}" + /> + <retroweaver + inputjar="${comp.starr.jar}" + outputjar="${comp.starr14.jar}" + /> + </target> + + <target name="setup" depends="init"> + <!-- Creating class-pathes --> + <if> + <contains string="${java.version}" substring="1.4"/> + <then> + <mkdir dir="${build.dir}/starr"/> + <property name="lib.starr14.jar" value="${build.dir}/starr/scala-library-14.jar"/> + <property name="comp.starr14.jar" value="${build.dir}/starr/scala-compiler-14.jar"/> + <antcall target="setup.weave"> + <param name="lib.starr14.jar" value="${lib.starr14.jar}"/> + <param name="comp.starr14.jar" value="${comp.starr14.jar}"/> + </antcall> + <path id="starr.classpath"> + <pathelement location="${lib.starr14.jar}"/> + <pathelement location="${comp.starr14.jar}"/> + <pathelement location="${fjbg.jar}"/> + <pathelement location="${msil.jar}"/> + <pathelement location="${ant.jar}"/> + <pathelement location="${jline.jar}"/> + </path> + </then> + <else> + <path id="starr.classpath"> + <pathelement location="${lib.starr.jar}"/> + <pathelement location="${comp.starr.jar}"/> + <pathelement location="${fjbg.jar}"/> + <pathelement location="${msil.jar}"/> + <pathelement location="${ant.jar}"/> + <pathelement location="${jline.jar}"/> + </path> + </else> + </if> + <!-- Creating boot-level tasks --> + <taskdef + name="starr" + classname="scala.tools.ant.Scalac" + classpathref="starr.classpath"/> + <taskdef + name="starrtool" + classname="scala.tools.ant.ScalaTool" + classpathref="starr.classpath" /> + <!-- 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> + <echo level="warning" + message="STARR updated: LOCKER is obsolete and will be rebuilt."/> + <runtarget target="clean.build"/> + </then> + </if> + <!-- Finding out what is available --> + <available property="excludes.avail" file="${nsc.excludes.file}"/> + <condition property="locker.avail"> + <available file="${locker.dir}/complete"/> + </condition> + <!-- Generating version number --> + <property file="${number.file}"/> + <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 SVN revision ${svn.number}"/> + </target> + + <target name="setup.locker" depends="setup, build.locker"> + <path id="locker.classpath"> + <pathelement location="${locker.dir}/lib/library"/> + <pathelement location="${locker.dir}/lib/compiler"/> + <pathelement location="${fjbg.jar}"/> + <pathelement location="${msil.jar}"/> + </path> + <taskdef + name="locker" + classname="scala.tools.ant.Scalac" + classpathref="locker.classpath"/> + </target> + + <target name="setup.quick" depends="setup, build"> + <path id="quick.classpath"> + <pathelement location="${quick.dir}/lib/library"/> + <pathelement location="${quick.dir}/lib/compiler"/> + <pathelement location="${fjbg.jar}"/> + <pathelement location="${msil.jar}"/> + </path> + <taskdef + name="quick" classname="scala.tools.ant.Scalac" + classpathref="quick.classpath"/> + <taskdef + name="quicksbaz" classname="scala.tools.ant.ScalaBazaar" + classpathref="quick.classpath"/> + <taskdef + name="quickdoc" classname="scala.tools.ant.Scaladoc" + classpathref="quick.classpath"/> + </target> + +<!-- =========================================================================== +BUILD SUPPORT MACROS +============================================================================ --> + + <macrodef name="build.support"> + <attribute name="build.dir"/> + <sequential> + <copy todir="@{build.dir}/lib/library"> + <fileset dir="${src.dir}/library"> + <include name="**/*.tmpl"/> + <include name="**/*.xml"/> + <include name="**/*.js"/> + <include name="**/*.css"/> + </fileset> + </copy> + <copy todir="@{build.dir}/lib/compiler"> + <fileset dir="${src.dir}/compiler"> + <include name="**/*.tmpl"/> + <include name="**/*.xml"/> + <include name="**/*.js"/> + <include name="**/*.css"/> + </fileset> + </copy> + </sequential> + </macrodef> + + <macrodef name="build.links"> + <attribute name="build.dir"/> + <sequential> + <if><not><available file="@{build.dir}/lib/fjbg.jar"/></not><then> + <if><isset property="os.win"/><then> + <copy file="${fjbg.jar}" tofile="@{build.dir}/lib/fjbg.jar"/> + </then><else> + <symlink + link="@{build.dir}/lib/fjbg.jar" + resource="${fjbg.jar}" overwrite="yes" failonerror="no"/> + </else></if> + </then></if> + <if><not><available file="@{build.dir}/lib/msil.jar"/></not><then> + <if><isset property="os.win"/><then> + <copy file="${msil.jar}" tofile="@{build.dir}/lib/msil.jar"/> + </then><else> + <symlink + link="@{build.dir}/lib/msil.jar" + resource="${msil.jar}" overwrite="yes" failonerror="no"/> + </else></if> + </then></if> + <if><not><available file="@{build.dir}/lib/jline.jar"/></not><then> + <if><isset property="os.win"/><then> + <copy file="${jline.jar}" tofile="@{build.dir}/lib/jline.jar"/> + </then><else> + <symlink + link="@{build.dir}/lib/jline.jar" + resource="${jline.jar}" overwrite="yes" failonerror="no"/> + </else></if> + </then></if> + </sequential> + </macrodef> + +<!-- =========================================================================== +BUILD LOCAL REFERENCE (LOCKER) LAYER +============================================================================ --> + + <target name="newlocker" + depends="clean.unfreeze, build.locker" + description="Rebuilds LOCKER from the current sources"/> + + <target name="build.locker" depends="setup" unless="locker.avail"> + <property name="built.locker" value="yes"/> + <stopwatch name="timer.locker"/> + <!-- Build library --> + <if><and> + <isset property="os.unix"/> + <isset property="build.resource"/></and> + <then> + <symlink + link="${build.dir}" + resource="${build.resource}" overwrite="yes" failonerror="no"/> + <touch file="${build.dir}/is_symlink" verbose="no"/> + </then></if> + <mkdir dir="${locker.dir}/lib/library"/> + <javac + srcdir="${src.dir}/library" + destdir="${locker.dir}/lib/library" + source="1.4" target="1.4" deprecation="yes" + classpath="${locker.dir}/lib/library" + includes="**/*.java"/> + <starr + srcdir="${src.dir}/library" + destdir="${locker.dir}/lib/library" + addparams="${nsc.params}" target="${nsc.target}" + deprecation="yes" unchecked="yes" + classpath="${locker.dir}/lib/library" + includes="scala/Predef.scala"/> + <starr + srcdir="${src.dir}/library" + destdir="${locker.dir}/lib/library" + addparams="${nsc.params}" target="${nsc.target}" + deprecation="yes" unchecked="yes" + classpath="${locker.dir}/lib/library"> + <include name="**/*.scala"/> + <exclude name="scala/Predef.scala"/> + <exclude name="scala/dbc/**"/> + <exclude name="scala/actors/**"/> + <excludesfile name="${nsc.excludes.file}" if="excludes.avail"/> + </starr> + <echo + file="${locker.dir}/lib/library/${lib.prop.name}" + message="version.number=${version.number}${line.separator}" + append="false" + /> + <echo + file="${locker.dir}/lib/library/${lib.prop.name}" + message="copyright.string=${copyright.string}${line.separator}" + append="true" + /> + <!-- Build compiler --> + <mkdir dir="${locker.dir}/lib/compiler"/> + <starr + srcdir="${src.dir}/compiler" + destdir="${locker.dir}/lib/compiler" + addparams="${nsc.params}" target="${nsc.target}" + deprecation="yes" unchecked="yes"> + <classpath> + <pathelement location="${locker.dir}/lib/library"/> + <pathelement location="${locker.dir}/lib/compiler"/> + <pathelement location="${fjbg.jar}"/> + <pathelement location="${msil.jar}"/> + <pathelement location="${ant.jar}"/> + <pathelement location="${jline.jar}"/> + </classpath> + <include name="**/*.scala"/> + <excludesfile name="${nsc.excludes.file}" if="excludes.avail"/> + </starr> + <echo + file="${locker.dir}/lib/compiler/${comp.prop.name}" + message="version.number=${version.number}${line.separator}" + append="false" + /> + <echo + file="${locker.dir}/lib/compiler/${comp.prop.name}" + message="copyright.string=${copyright.string}${line.separator}" + append="true" + /> + <!-- Timing the build --> + <stopwatch name="timer.locker" action="total"/> + <!-- Copy support files to build folder and links external libraries--> + <build.support build.dir="${locker.dir}"/> + <build.links build.dir="${locker.dir}"/> + <!-- Build executable files --> + <taskdef + name="lockertool" + classname="scala.tools.ant.ScalaTool" + classpathref="locker.classpath"/> + <mkdir dir="${locker.dir}/bin"/> + <lockertool + file="${locker.dir}/bin/${scala.exec.name}" + class="scala.tools.nsc.MainGenericRunner" + javaFlags="${java.flags}"/> + <lockertool + file="${locker.dir}/bin/${scalac.exec.name}" + class="scala.tools.nsc.Main" + javaFlags="${java.flags}"/> + <lockertool + file="${locker.dir}/bin/${scaladoc.exec.name}" + class="scala.tools.nsc.ScalaDoc" + javaFlags="${java.flags}"/> + <lockertool + file="${locker.dir}/bin/${fsc.exec.name}" + class="scala.tools.nsc.CompileClient" + javaFlags="${java.flags}"/> + <chmod perm="ugo+rx" + file="${locker.dir}/bin/${scalac.exec.name}"/> + <chmod perm="ugo+rx" + file="${locker.dir}/bin/${scala.exec.name}"/> + <chmod perm="ugo+rx" + file="${locker.dir}/bin/${scaladoc.exec.name}"/> + <chmod perm="ugo+rx" + file="${locker.dir}/bin/${fsc.exec.name}"/> + <fixcrlf + srcdir="${locker.dir}/bin" + eol="dos" + includes="**/*.bat"/> + <!-- Mark LOCKER as being completely built --> + <touch file="${locker.dir}/complete" verbose="no"/> + </target> + +<!-- =========================================================================== +BUILD QUICK-TEST LAYER +============================================================================ --> + + <target name="build" depends="setup.locker" + description="Builds a quick-test (QUICK) version of the compiler"> + <stopwatch name="timer.quick"/> + <!-- Build library --> + <mkdir dir="${quick.dir}/lib/library"/> + <javac + srcdir="${src.dir}/library" + destdir="${quick.dir}/lib/library" + source="1.4" target="1.4" deprecation="yes" + classpath="${quick.dir}/lib/library" + includes="**/*.java"/> + <locker + srcdir="${src.dir}/library" + destdir="${quick.dir}/lib/library" + addparams="${nsc.params}" target="${nsc.target}" + deprecation="yes" unchecked="yes" + scalacdebugging="${nsc.log-files}" + classpath="${quick.dir}/lib/library" + includes="scala/Predef.scala"/> + <locker + srcdir="${src.dir}/library" + destdir="${quick.dir}/lib/library" + addparams="${nsc.params}" target="${nsc.target}" + deprecation="yes" unchecked="yes" + scalacdebugging="${nsc.log-files}" + classpath="${quick.dir}/lib/library"> + <include name="**/*.scala"/> + <exclude name="scala/Predef.scala"/> + <exclude name="scala/dbc/**"/> + <exclude name="scala/actors/**"/> + <excludesfile name="${nsc.excludes.file}" if="excludes.avail"/> + </locker> + <echo + file="${quick.dir}/lib/library/${lib.prop.name}" + message="version.number=${version.number}${line.separator}" + append="false" + /> + <echo + file="${quick.dir}/lib/library/${lib.prop.name}" + message="copyright.string=${copyright.string}${line.separator}" + append="true" + /> + <!-- Build DBC --> + <mkdir dir="${quick.dir}/lib/dbc"/> + <locker + srcdir="${src.dir}/dbc" + destdir="${quick.dir}/lib/dbc" + addparams="${nsc.params}" target="${nsc.target}" + deprecation="yes" unchecked="yes" + scalacdebugging="${nsc.log-files}"> + <classpath> + <pathelement location="${quick.dir}/lib/library"/> + <pathelement location="${quick.dir}/lib/dbc"/> + </classpath> + <include name="scala/dbc/**/*.scala"/> + <excludesfile name="${nsc.excludes.file}" if="excludes.avail"/> + </locker> + <!-- Build actors library --> + <mkdir dir="${quick.dir}/lib/actors"/> + <javac + srcdir="${src.dir}/actors" + destdir="${quick.dir}/lib/actors" + source="1.4" target="1.4" deprecation="yes" + classpath="${quick.dir}/lib/actors" + includes="scala/actors/**/*.java"/> + <locker + srcdir="${src.dir}/actors" + destdir="${quick.dir}/lib/actors" + addparams="${nsc.params}" target="${nsc.target}" + deprecation="yes" unchecked="yes" + scalacdebugging="${nsc.log-files}"> + <classpath> + <pathelement location="${quick.dir}/lib/library"/> + <pathelement location="${quick.dir}/lib/actors"/> + </classpath> + <include name="scala/actors/**/*.scala"/> + <excludesfile name="${nsc.excludes.file}" if="excludes.avail"/> + </locker> + <!-- Build compiler --> + <mkdir dir="${quick.dir}/lib/compiler"/> + <locker + srcdir="${src.dir}/compiler" + destdir="${quick.dir}/lib/compiler" + addparams="${nsc.params}" target="${nsc.target}" + deprecation="yes" unchecked="yes" + scalacdebugging="${nsc.log-files}"> + <classpath> + <pathelement location="${quick.dir}/lib/library"/> + <pathelement location="${quick.dir}/lib/compiler"/> + <pathelement location="${fjbg.jar}"/> + <pathelement location="${msil.jar}"/> + <pathelement location="${ant.jar}"/> + <pathelement location="${jline.jar}"/> + </classpath> + <include name="**/*.scala"/> + <excludesfile name="${nsc.excludes.file}" if="excludes.avail"/> + </locker> + <echo + file="${quick.dir}/lib/compiler/${comp.prop.name}" + message="version.number=${version.number}${line.separator}" + append="false" + /> + <echo + file="${quick.dir}/lib/compiler/${comp.prop.name}" + message="copyright.string=${copyright.string}${line.separator}" + append="true" + /> + <!-- Build partest --> + <mkdir dir="${quick.dir}/lib/partest"/> + <javac + srcdir="${src.dir}/partest" + destdir="${quick.dir}/lib/partest" + source="1.4" target="1.4" deprecation="yes" + classpath="${quick.dir}/lib/partest" + includes="scala/tools/partest/**/*.java"/> + <locker + srcdir="${src.dir}/partest" + destdir="${quick.dir}/lib/partest" + addparams="${nsc.params}" target="${nsc.target}" + deprecation="yes" unchecked="yes"> + <classpath> + <pathelement location="${quick.dir}/lib/library"/> + <pathelement location="${quick.dir}/lib/compiler"/> + <pathelement location="${quick.dir}/lib/actors"/> + <pathelement location="${ant.jar}"/> + </classpath> + </locker> + <echo + file="${quick.dir}/lib/partest/${par.prop.name}" + message="version.number=${version.number}${line.separator}" + append="false" + /> + <echo + file="${quick.dir}/lib/partest/${par.prop.name}" + message="copyright.string=${copyright.string}${line.separator}" + append="true" + /> + <!-- Timing the build --> + <stopwatch name="timer.quick" action="total"/> + <!-- Copy support files to build folder and links external libraries--> + <build.support build.dir="${quick.dir}"/> + <build.links build.dir="${quick.dir}"/> + <!-- Build executable files --> + <taskdef + name="quicktool" + classname="scala.tools.ant.ScalaTool" + classpathref="quick.classpath"/> + <mkdir dir="${quick.dir}/bin"/> + <quicktool + file="${quick.dir}/bin/${scala.exec.name}" + class="scala.tools.nsc.MainGenericRunner" + javaFlags="${java.flags}"/> + <quicktool + file="${quick.dir}/bin/${scalac.exec.name}" + class="scala.tools.nsc.Main" + javaFlags="${java.flags}"/> + <quicktool + file="${quick.dir}/bin/${scaladoc.exec.name}" + class="scala.tools.nsc.ScalaDoc" + javaFlags="${java.flags}"/> + <quicktool + file="${quick.dir}/bin/${fsc.exec.name}" + class="scala.tools.nsc.CompileClient" + javaFlags="${java.flags}"/> + <chmod perm="ugo+rx" + file="${quick.dir}/bin/${scalac.exec.name}"/> + <chmod perm="ugo+rx" + file="${quick.dir}/bin/${scala.exec.name}"/> + <chmod perm="ugo+rx" + file="${quick.dir}/bin/${scaladoc.exec.name}"/> + <chmod perm="ugo+rx" + file="${quick.dir}/bin/${fsc.exec.name}"/> + <fixcrlf + srcdir="${quick.dir}/bin" + eol="dos" + includes="**/*.bat"/> + </target> + + <target name="test.quick" depends="build"> + <echo level="info" + message="Ant test bench is not available yet."/> + </target> + +<!-- =========================================================================== +CLDC +============================================================================ --> +<!-- + <property name="cldcapi.jar" value="${lib.dir}/cldcapi10.jar"/> + <property name="midpapi.jar" value="${lib.dir}/midpapi10.jar"/> + + <target name="cldc.sources" + description="Create the source directory for the J2ME (CLDC) library" + > + <mkdir dir="${cldc.dir}/src"/> + + <copy todir="${cldc.dir}/src"> + <fileset dir="${src.dir}/library" includes="**/*.scala, **/*.java"> + <not> + <present targetdir="${src.dir}/cldc-library"/> + </not> + <exclude name="**/*CharSequence.scala"/> + <exclude name="**/jcl/**"/> + <exclude name="**/ref/**"/> + <exclude name="**/compat/**"/> + <exclude name="**/concurrent/**"/> + <exclude name="**/runtime/RichFloat.scala"/> + <exclude name="**/runtime/RichDouble.scala"/> + <exclude name="**/util/**"/> + <exclude name="**/xml/**"/> + </fileset> + </copy> + + <copy todir="${cldc.dir}/src"> + <fileset dir="${src.dir}/cldc-library"> + <include name="**/*.scala"/> + <include name="**/*.java"/> + </fileset> + </copy> + + </target> + + <target name="cldc.libraries" + depends="setup.quick, cldc.sources" + description="Builds the Scala library for J2ME (CLDC)" + > + <mkdir dir="${cldc.dir}/lib/library"/> + <javac + srcdir="${cldc.dir}/src" + destdir="${cldc.dir}/lib/library" + compiler="javac1.4" + source="1.1" + target="1.1" + deprecation="${jc.deprecation}" + > + <bootclasspath> + <pathelement location="${cldcapi.jar}"/> + </bootclasspath> + <include name="**/*.java"/> + <exclude name="scala/runtime/FloatRef.java"/> + <exclude name="scala/runtime/DoubleRef.java"/> + </javac> + + <quick + srcdir="${cldc.dir}/src" + destdir="${cldc.dir}/lib/library" + addparams="${nsc.params}" + target="cldc" + scalacdebugging="${nsc.log-files}" + > + <bootclasspath> + <pathelement location="${cldcapi.jar}"/> + </bootclasspath> + <classpath> + <pathelement location="${cldc.dir}"/> + </classpath> + <include name="scala/Predef.scala"/> + </quick> + <quick + srcdir="${cldc.dir}/src" + destdir="${cldc.dir}/lib/library" + target="cldc" + addparams="${nsc.params}" + scalacdebugging="${nsc.log-files}" + > + <bootclasspath> + <pathelement location="${cldcapi.jar}"/> + </bootclasspath> + <classpath> + <pathelement location="${cldc.dir}"/> + </classpath> + <include name="**/*.scala"/> + <exclude name="scala/Predef.scala"/> + <exclude name="scala/BigDecimal.scala"/> + <exclude name="scala/BigInt.scala"/> + <exclude name="scala/collection/mutable/JavaMapAdaptor.scala"/> + <exclude name="scala/collection/mutable/JavaSetAdaptor.scala"/> + <exclude name="scala/collection/mutable/LinkedHashSet.scala"/> + <exclude name="scala/util/Fluid.scala"/> + <exclude name="scala/runtime/BoxedFloatArray.scala"/> + <exclude name="scala/runtime/BoxedDoubleArray.scala"/> + <exclude name="scala/io/**"/> + <exclude name="scala/mobile/**"/> + <exclude name="scala/reflect/**"/> + <exclude name="scala/text/**"/> + <exclude name="scala/testing/**"/> + <exclude name="scala/xml/**"/> + <excludesfile name="${nsc.excludes}" if="excludes.avail"/> + </quick> + <macrodef name="preverify"> + <attribute name="srcdir"/> + <attribute name="destdir"/> + <sequential> + <exec executable="preverify" failonerror="false"> + <arg line="-classpath ${cldcapi.jar}${path.separator}${midpapi.jar}"/> + <arg line="-target cldc1.0"/> + <arg line="-d @{destdir}"/> + <arg value="@{srcdir}"/> + </exec> + </sequential> + </macrodef> + <mkdir dir="${cldc.dir}/lib/preverified"/> + <preverify + srcdir="${cldc.dir}/lib/library" + destdir="${cldc.dir}/lib/preverified" + /> + <jar + destfile="${cldc.dir}/lib/scalaapi10-unverified.jar" + basedir="${cldc.dir}/lib/library" + includes="scala/**/*.class"> + <manifest> + <attribute name="Created-By" value="${version.number} (${vendor.name})"/> + </manifest> + </jar> + <jar + destfile="${cldc.dir}/lib/scalaapi10.jar" + basedir="${cldc.dir}/lib/preverified" + includes="scala/**/*.class"> + <manifest> + <attribute name="Created-By" value="${version.number} (${vendor.name})"/> + <attribute name="API-Specification-Version" value="1.0"/> + <attribute name="API" value="Scala CLDC"/> + <attribute name="API-Name" value="Scala Connected Limited Device Configuration"/> + <attribute name="API-Type" value="Configuration"/> + </manifest> + </jar> + </target> + + <target name="cldc" depends="cldc.libraries"> + </target> +--> + +<!-- =========================================================================== +ANDROID +============================================================================ --> + + <target name="android.init"> + <!-- Sets location of Android installation --> + <condition property="android.home" value="${unix.android.home}"> + <and><os family="unix"/><isset property="unix.android.home"/></and> + </condition> + <condition property="android.home" value="${win.android.home}"> + <and><os family="windows"/><isset property="win.android.home"/></and> + </condition> + <property name="android.home" value="${env.ANDROID_HOME}"/> + + <fail message="Android home is not set or could not find android.jar in ${android.home}"> + <condition><not> + <available file="${android.home}/android.jar"/> + </not></condition> + </fail> + </target> + + <target name="android.sources" depends="android.init" + description="Create the source directory for Android library" + > + <mkdir dir="${android.dir}/src"/> + <copy todir="${android.dir}/src"> + <fileset dir="${src.dir}/android-library" includes="**/*.scala, **/*.java"/> + </copy> + <copy todir="${android.dir}/src"> + <fileset dir="${src.dir}/library" includes="**/*.scala, **/*.java" /> + </copy> + </target> + + <target name="android.libraries" + depends="setup.quick, android.sources" + description="Builds the Scala library for Android"> + <mkdir dir="${android.dir}/lib/library"/> + <javac + srcdir="${android.dir}/src" + destdir="${android.dir}/lib/library" + deprecation="${jc.deprecation}" + > + <bootclasspath> + <pathelement location="${android.home}/android.jar}"/> + </bootclasspath> + <include name="**/*.java"/> + </javac> + + <quick + srcdir="${android.dir}/src" + destdir="${android.dir}/lib/library" + deprecation="yes" unchecked="yes" + addparams="${nsc.params}" + extdirs="" + scalacdebugging="${nsc.log-files}" + > + <bootclasspath> + <pathelement location="${android.home}/android.jar"/> + </bootclasspath> + <include name="scala/Predef.scala"/> + </quick> + + <quick + srcdir="${android.dir}/src" + destdir="${android.dir}/lib/library" + deprecation="yes" unchecked="yes" + extdirs="" + addparams="${nsc.params}" + scalacdebugging="${nsc.log-files}" + > + <bootclasspath> + <pathelement location="${android.home}/android.jar"/> + </bootclasspath> + <classpath> + <pathelement location="${android.dir}"/> + </classpath> + <include name="**/*.scala"/> + <exclude name="scala/Predef.scala"/> + <excludesfile name="${nsc.excludes}" if="excludes.avail"/> + </quick> + </target> + + <target name="android.build" depends="android.libraries" + description="Convert this project's .class files into .dex files"> + <property name="dx.jar" value="${android.home}/tools/lib/dx.jar"/> + <java jar="${dx.jar}" fork="true" failonerror="true"> + <jvmarg value="-Djava.ext.dirs=${android.home}${file.separator}tools${file.separator}lib"/> + <jvmarg value="-Xmx384M"/> + <arg value="--dex"/> + <arg value="--output=${android.dir}/lib/scala.dex"/> + <arg value="--locals=full"/> + <arg value="--positions=lines"/> + <arg value="--no-optimize"/> <!-- workaround for M5-RC14 bug --> + <arg value="${android.dir}/lib/library"/> + </java> + <jar + destfile="${android.dir}/lib/scala-dex.jar" + basedir="${android.dir}/lib" + includes="scala.dex" + /> + <jar + destfile="${android.dir}/lib/scala-android.jar" + basedir="${android.dir}/lib/library" + includes="scala/**/*.class" + /> + </target> + + <target name="android" depends="init"> + <condition property="android.supported"> + <and> + <not><contains string="${java.version}" substring="1.4"/></not> + <contains string="${java.vendor}" substring="Sun"/> + </and> + </condition> + <if><isset property="android.supported"/><then> + <antcall target="android.build"/> + </then><else> + <echo message="The Android library build requires Sun Java 1.5 or newer"/> + </else></if> + </target> + +<!-- =========================================================================== +MSIL +============================================================================ --> + + <target name="msil.init" depends="ant-init"> + <!-- Sets ilasm command (either Microsoft .NET Framework or Mono) --> + <condition property="ilasm.cmd" value="${msdn.home}/ilasm.exe"> + <and> + <os family="windows"/><isset property="msdn.home"/> + <available file="${msdn.home}/ilasm.exe"/> + </and> + </condition> + <condition property="ilasm.cmd" value="${unix.mono.home}/ilasm"> + <and> + <os family="unix"/><isset property="unix.mono.home"/> + <available file="${unix.mono.home}/ilasm"/> + </and> + </condition> + <condition property="ilasm.cmd" value="${win.mono.home}/ilasm"> + <and> + <os family="windows"/><isset property="${win.mono.home}/lib/mono/2.0/ilasm.exe"/> + <available file="${win.mono.home}/lib/mono/2.0/ilasm.exe"/> + </and> + </condition> + <echo level="verbose" message="Found: ${ilasm.cmd}"/> + <condition property="ilasm.cmd" value="ilasm"> + <and><available file="ilasm" filepath="${env.PATH}"/></and> + </condition> + <fail message="Command 'ilasm' not found"> + <condition><not><isset property="ilasm.cmd"/></not></condition> + </fail> + <!-- Sets ilasm arguments (either Windows or Unix) --> + <property name="ilasm.outfile" value="${msil.dir}/predef.dll"/> + <if> + <isset property="os.win"/> + <then> + <property + name="ilasm.args" + value="/quiet /dll /output=${ilasm.outfile}" + /> + </then> + <else> + <property + name="ilasm.args" + value="/dll /output:${ilasm.outfile}" + /> + </else> + </if> + </target> + + <target name="msil.sources" depends="msil.init"> + <mkdir dir="${msil.dir}/src"/> + <copy todir="${msil.dir}/src"> + <fileset dir="${src.dir}/dotnet-library" includes="**/*.scala, **/*.cs"/> + </copy> + <copy todir="${msil.dir}/src"> + <fileset dir="${src.dir}/library" includes="**/*.scala"/> + </copy> + </target> + + <target name="msil.libraries" depends="setup.quick, msil.sources"> + <quick srcdir="${msil.dir}/src" destdir="${msil.dir}" target="msil" + assemname="predef" assemrefs="${lib.dir}" + failonerror="false"> + <include name="**/*.scala"/> + <exclude name="scala/ScalaObject.scala"/> + <!-- + <include name="scala/Predef.scala"/> + <include name="scala/Either.scala"/> + <include name="scala/Option.scala"/> + <include name="scala/Pair.scala"/> + <include name="scala/Console.scala"/> + <include name="scala/Application.scala"/> + <include name="scala/ByNameFunction.scala"/> + <include name="scala/Stream.scala"/> + <include name="scala/*Annotation.scala"/> + <include name="scala/Function*.scala"/> + <include name="scala/Tuple*.scala"/> + <include name="scala/Product*.scala"/> + <include name="scala/List.scala"/> + <include name="scala/cloneable.scala"/> + <include name="scala/deprecated.scala"/> + <include name="scala/native.scala"/> + <include name="scala/serializable.scala"/> + <include name="scala/transient.scala"/> + <include name="scala/volatile.scala"/> + <include name="scala/remote.scala"/> + <include name="scala/throws.scala"/> + <include name="scala/BigInt.scala"/> + <include name="scala/CountedIterator.scala"/> + <include name="scala/collection/**/*.scala"/> + <include name="scala/runtime/*.scala"/> + <include name="scala/concurrent/*.scala"/> + <include name="scala/ref/*.scala"/> + <include name="scala/reflect/*.scala"/> + <include name="scala/testing/*.scala"/> + <include name="scala/text/*.scala"/> --> + </quick> + <pathconvert property="ilasm.infile" pathsep=" "> + <fileset dir="${msil.dir}" includes="*.msil"/> + </pathconvert> + <exec + executable="${ilasm.cmd}" vmlauncher="no"> + <!-- + errorproperty="ilasm.err" outputproperty="ilasm.out"> + --> + <arg line="${ilasm.args} ${ilasm.infile}"/> + </exec> + </target> + + <target name="msil" depends="msil.libraries"> + <copy todir="${quick.dir}/bin"> + <fileset + dir="${mono.dir}/bin" + includes="scala-net*" + /> + <filterset> + <filter token="VERSION" value="${version.number}"/> + <filter token="COPYRIGHT" value="${copyright.string}"/> + <filter token="NAME" value="Scala code runner"/> + </filterset> + </copy> + <copy todir="${quick.dir}/bin"> + <fileset + dir="${mono.dir}/bin" + includes="scalac-net*" + /> + <filterset> + <filter token="VERSION" value="${version.number}"/> + <filter token="COPYRIGHT" value="${copyright.string}"/> + <filter token="NAME" value="Scala compiler"/> + </filterset> + </copy> + <chmod perm="ugo+rx" + dir="${quick.dir}/bin" includes="*-net*"/> + <if><isset property="os.win"/> + <then> + <copy todir="${quick.dir}/lib"> + <fileset dir="${msil.dir}" includes="*.dll"/> + <fileset dir="${lib.dir}" includes="*.dll"/> + </copy> + </then> + <else> + <symlink + link="${quick.dir}/lib/predef.dll" + resource="${msil.dir}/predef.dll" + overwrite="yes" failonerror="no"/> + <symlink + link="${quick.dir}/lib/scalaruntime.dll" + resource="${lib.dir}/scalaruntime.dll" + overwrite="yes" failonerror="no"/> + <symlink + link="${quick.dir}/lib/mscorlib.dll" + resource="${lib.dir}/mscorlib.dll" + overwrite="yes" failonerror="no"/> + </else> + </if> + </target> + +<!-- =========================================================================== +OPTIMIZE +============================================================================ --> + <target name="optimised" depends="build.optimised" + description="Build the compiler with optimizations on."/> + + <!-- Build the bootstrap layer --> + <target name="build.optimised" depends="setup.quick"> + <stopwatch name="timer.optimised"/> + <!-- Build library --> + <mkdir dir="${optimised.dir}/lib/library"/> + <javac + srcdir="${src.dir}/library" + destdir="${optimised.dir}/lib/library" + source="1.4" target="1.4" deprecation="yes" + classpath="${optimised.dir}/lib/library" + includes="**/*.java"/> + <quick + srcdir="${src.dir}/library" + destdir="${optimised.dir}/lib/library" + addparams="${nsc.params}" target="${nsc.target}" + deprecation="yes" unchecked="yes" + optimise="yes" + classpath="${optimised.dir}/lib/library" + includes="scala/Predef.scala"/> + <quick + srcdir="${src.dir}/library" + destdir="${optimised.dir}/lib/library" + addparams="${nsc.params}" target="${nsc.target}" + optimise="yes" + deprecation="yes" unchecked="yes" + classpath="${optimised.dir}/lib/library"> + <include name="**/*.scala"/> + <exclude name="scala/Predef.scala"/> + <exclude name="scala/dbc/**"/> + <exclude name="scala/actors/**"/> + <excludesfile name="${nsc.excludes.file}" if="excludes.avail"/> + </quick> + <echo + file="${optimised.dir}/lib/library/${lib.prop.name}" + message="version.number=${version.number}${line.separator}" + append="false" + /> + <echo + file="${optimised.dir}/lib/library/${lib.prop.name}" + message="copyright.string=${copyright.string}${line.separator}" + append="true" + /> + <!-- Build compiler --> + <mkdir dir="${optimised.dir}/lib/compiler"/> + <quick + srcdir="${src.dir}" + destdir="${optimised.dir}/lib/compiler" + optimise="yes" + addparams="${nsc.params}" target="${nsc.target}"> + <classpath> + <pathelement location="${optimised.dir}/lib/library"/> + <pathelement location="${optimised.dir}/lib/compiler"/> + <pathelement location="${fjbg.jar}"/> + <pathelement location="${msil.jar}"/> + <pathelement location="${ant.jar}"/> + <pathelement location="${jline.jar}"/> + </classpath> + <include name="compiler/**/*.scala"/> + <include name="library/scala/List.scala"/> + <excludesfile name="${nsc.excludes.file}" if="excludes.avail"/> + </quick> + <echo + file="${optimised.dir}/lib/compiler/${comp.prop.name}" + message="version.number=${version.number}${line.separator}" + append="false" + /> + <echo + file="${optimised.dir}/lib/compiler/${comp.prop.name}" + message="copyright.string=${copyright.string}${line.separator}" + append="true" + /> + <!-- Timing the build --> + <stopwatch name="timer.strap" action="total"/> + <!-- Copy support files to build folder and links external libraries--> + <build.support build.dir="${optimised.dir}"/> + <build.links build.dir="${optimised.dir}"/> + <!-- Build executable files --> + <taskdef + name="straptool" + classname="scala.tools.ant.ScalaTool" + classpathref="quick.classpath"/> + <mkdir dir="${optimised.dir}/bin"/> + <straptool + file="${optimised.dir}/bin/${scala.exec.name}" + class="scala.tools.nsc.MainGenericRunner" + javaFlags="${java.flags}"/> + <straptool + file="${optimised.dir}/bin/${scalac.exec.name}" + class="scala.tools.nsc.Main" + javaFlags="${java.flags}"/> + <straptool + file="${optimised.dir}/bin/${scaladoc.exec.name}" + class="scala.tools.nsc.ScalaDoc" + javaFlags="${java.flags}"/> + <straptool + file="${optimised.dir}/bin/${fsc.exec.name}" + class="scala.tools.nsc.CompileClient" + javaFlags="${java.flags}"/> + <chmod perm="ugo+rx" + file="${optimised.dir}/bin/${scalac.exec.name}"/> + <chmod perm="ugo+rx" + file="${optimised.dir}/bin/${scala.exec.name}"/> + <chmod perm="ugo+rx" + file="${optimised.dir}/bin/${scaladoc.exec.name}"/> + <chmod perm="ugo+rx" + file="${optimised.dir}/bin/${fsc.exec.name}"/> + <fixcrlf + srcdir="${optimised.dir}/bin" + eol="dos" + includes="**/*.bat"/> + </target> + + +<!-- =========================================================================== +TEST +============================================================================ --> + + <target name="test" depends="test.stability, test.strap" + description="Tests the build for stability"/> + + <!-- Build the bootstrap layer --> + <target name="build.strap" depends="setup.quick"> + <stopwatch name="timer.strap"/> + <!-- Build library --> + <mkdir dir="${strap.dir}/lib/library"/> + <javac + srcdir="${src.dir}/library" + destdir="${strap.dir}/lib/library" + source="1.4" target="1.4" deprecation="yes" + classpath="${strap.dir}/lib/library" + includes="**/*.java"/> + <quick + srcdir="${src.dir}/library" + destdir="${strap.dir}/lib/library" + addparams="${nsc.params}" target="${nsc.target}" + deprecation="yes" unchecked="yes" + classpath="${strap.dir}/lib/library" + includes="scala/Predef.scala"/> + <quick + srcdir="${src.dir}/library" + destdir="${strap.dir}/lib/library" + addparams="${nsc.params}" target="${nsc.target}" + deprecation="yes" unchecked="yes" + classpath="${strap.dir}/lib/library"> + <include name="**/*.scala"/> + <exclude name="scala/Predef.scala"/> + <exclude name="scala/dbc/**"/> + <exclude name="scala/actors/**"/> + <excludesfile name="${nsc.excludes.file}" if="excludes.avail"/> + </quick> + <echo + file="${strap.dir}/lib/library/${lib.prop.name}" + message="version.number=${version.number}${line.separator}" + append="false" + /> + <echo + file="${strap.dir}/lib/library/${lib.prop.name}" + message="copyright.string=${copyright.string}${line.separator}" + append="true" + /> + <!-- Build DBC --> + <mkdir dir="${strap.dir}/lib/dbc"/> + <quick + srcdir="${src.dir}/dbc" + destdir="${strap.dir}/lib/dbc" + addparams="${nsc.params}" target="${nsc.target}" + deprecation="yes" unchecked="yes"> + <classpath> + <pathelement location="${strap.dir}/lib/library"/> + <pathelement location="${strap.dir}/lib/dbc"/> + </classpath> + <include name="scala/dbc/**/*.scala"/> + <excludesfile name="${nsc.excludes.file}" if="excludes.avail"/> + </quick> + <!-- Build actors library --> + <mkdir dir="${strap.dir}/lib/actors"/> + <javac + srcdir="${src.dir}/actors" + destdir="${strap.dir}/lib/actors" + source="1.4" target="1.4" deprecation="yes" + classpath="${strap.dir}/lib/actors" + includes="scala/actors/**/*.java"/> + <quick + srcdir="${src.dir}/actors" + destdir="${strap.dir}/lib/actors" + addparams="${nsc.params}" target="${nsc.target}"> + <classpath> + <pathelement location="${strap.dir}/lib/library"/> + <pathelement location="${strap.dir}/lib/actors"/> + </classpath> + <include name="scala/actors/**/*.scala"/> + <excludesfile name="${nsc.excludes.file}" if="excludes.avail"/> + </quick> + <!-- Build compiler --> + <mkdir dir="${strap.dir}/lib/compiler"/> + <quick + srcdir="${src.dir}/compiler" + destdir="${strap.dir}/lib/compiler" + addparams="${nsc.params}" target="${nsc.target}"> + <classpath> + <pathelement location="${strap.dir}/lib/library"/> + <pathelement location="${strap.dir}/lib/compiler"/> + <pathelement location="${fjbg.jar}"/> + <pathelement location="${msil.jar}"/> + <pathelement location="${ant.jar}"/> + <pathelement location="${jline.jar}"/> + </classpath> + <include name="**/*.scala"/> + <excludesfile name="${nsc.excludes.file}" if="excludes.avail"/> + </quick> + <echo + file="${strap.dir}/lib/compiler/${comp.prop.name}" + message="version.number=${version.number}${line.separator}" + append="false" + /> + <echo + file="${strap.dir}/lib/compiler/${comp.prop.name}" + message="copyright.string=${copyright.string}${line.separator}" + append="true" + /> + <!-- Build partest --> + <mkdir dir="${strap.dir}/lib/partest"/> + <javac + srcdir="${src.dir}/partest" + destdir="${strap.dir}/lib/partest" + source="1.4" target="1.4" deprecation="yes" + classpath="${strap.dir}/lib/partest" + includes="scala/tools/partest/**/*.java"/> + <quick + srcdir="${src.dir}/partest" + destdir="${strap.dir}/lib/partest" + addparams="${nsc.params}" target="${nsc.target}" + deprecation="yes" unchecked="yes"> + <classpath> + <pathelement location="${strap.dir}/lib/library"/> + <pathelement location="${strap.dir}/lib/compiler"/> + <pathelement location="${strap.dir}/lib/actors"/> + <pathelement location="${ant.jar}"/> + </classpath> + </quick> + <echo + file="${strap.dir}/lib/partest/${par.prop.name}" + message="version.number=${version.number}${line.separator}" + append="false" + /> + <echo + file="${strap.dir}/lib/partest/${par.prop.name}" + message="copyright.string=${copyright.string}${line.separator}" + append="true" + /> + <!-- Timing the build --> + <stopwatch name="timer.strap" action="total"/> + <!-- Copy support files to build folder and links external libraries--> + <build.support build.dir="${strap.dir}"/> + <build.links build.dir="${strap.dir}"/> + <!-- Build executable files --> + <taskdef + name="straptool" + classname="scala.tools.ant.ScalaTool" + classpathref="quick.classpath"/> + <mkdir dir="${strap.dir}/bin"/> + <straptool + file="${strap.dir}/bin/${scala.exec.name}" + class="scala.tools.nsc.MainGenericRunner" + javaFlags="${java.flags}"/> + <straptool + file="${strap.dir}/bin/${scalac.exec.name}" + class="scala.tools.nsc.Main" + javaFlags="${java.flags}"/> + <straptool + file="${strap.dir}/bin/${scaladoc.exec.name}" + class="scala.tools.nsc.ScalaDoc" + javaFlags="${java.flags}"/> + <straptool + file="${strap.dir}/bin/${fsc.exec.name}" + class="scala.tools.nsc.CompileClient" + javaFlags="${java.flags}"/> + <chmod perm="ugo+rx" + file="${strap.dir}/bin/${scalac.exec.name}"/> + <chmod perm="ugo+rx" + file="${strap.dir}/bin/${scala.exec.name}"/> + <chmod perm="ugo+rx" + file="${strap.dir}/bin/${scaladoc.exec.name}"/> + <chmod perm="ugo+rx" + file="${strap.dir}/bin/${fsc.exec.name}"/> + <fixcrlf + srcdir="${strap.dir}/bin" + eol="dos" + includes="**/*.bat"/> + </target> + + <!-- Compares quick and test level --> + <target name="test.stability" depends="build.strap"> + <if><available file="${stability.tool}"/> + <then> <!-- use stability tool for fast checking --> + <exec executable="${stability.tool}" failonerror="true"> + <arg value="${quick.dir}"/> + <arg value="${strap.dir}"/> + </exec> + </then><else> <!-- check stability the slow way --> + <checksum totalproperty="quick.md5"> + <fileset dir="${quick.dir}/lib"> + <include name="library/**"/> + <include name="compiler/**"/> + </fileset> + </checksum> + <delete quiet="yes" failonerror="no"> + <fileset dir="${quick.dir}" includes="**/*.MD5"/> + </delete> + <checksum totalproperty="strap.md5"> + <fileset dir="${strap.dir}/lib"> + <include name="library/**"/> + <include name="compiler/**"/> + </fileset> + </checksum> + <delete quiet="yes" failonerror="no"> + <fileset dir="${strap.dir}" includes="**/*.MD5"/> + </delete> + <fail message="Build ${version.number} is not stable"> + <condition><not> + <equals arg1="${quick.md5}" arg2="${strap.md5}"/> + </not></condition> + </fail> + <echo level="info" message="Build ${version.number} is stable."/> + </else></if> + </target> + + <target name="test.strap" depends="build.strap"> + <echo level="info" message="Ant test bench is not available yet."/> + </target> + +<!-- =========================================================================== +DOCUMENTATION +============================================================================ --> + + <target name="docs" depends="setup.quick" + description="Generated the API for library sources"> + <mkdir dir="${api-lib.dir}"/> + <quickdoc + srcdir="${src.dir}" + destdir="${api-lib.dir}" + sourcepath="" + deprecation="yes" unchecked="yes" + windowtitle="Scala Library Documentation" + doctitle="<div>Scala ${version.number}<br/>API Specification</div>" + classpath="${quick.dir}/lib/library${path.separator}${quick.dir}/lib/actors"> + <include name="dbc/**/*.scala"/> + <include name="actors/**/*.scala"/> + <include name="library/**/*.scala"/> + <excludesfile name="${nsc.excludes.file}" if="excludes.avail"/> + </quickdoc> + </target> + + <target name="docs.compiler" depends="setup.quick" + description="Generated the API for compiler sources"> + <mkdir dir="${api-comp.dir}"/> + <quickdoc + srcdir="${src.dir}/compiler" + destdir="${api-comp.dir}" + sourcepath="" + windowtitle="Scala Compiler Documentation" + doctitle="<div>Scala ${version.number}<br/>API Specification</div>"> + <classpath> + <pathelement location="${quick.dir}/lib/library"/> + <pathelement location="${quick.dir}/lib/compiler"/> + <pathelement location="${fjbg.jar}"/> + <pathelement location="${msil.jar}"/> + <pathelement location="${ant.jar}"/> + <pathelement location="${jline.jar}"/> + </classpath> + <include name="**/*.scala"/> + <excludesfile name="${nsc.excludes.file}" if="excludes.avail"/> + </quickdoc> + </target> + + <target name="docs.manual" depends="setup.quick" + description="Generated the manual for the Scala tools"> + <mkdir dir="${tooldocs.dir}/classes"/> + <path id="manual.classpath"> + <pathelement location="${quick.dir}/lib/library"/> + <pathelement location="${tooldocs.dir}/classes"/> + </path> + <quick + srcdir="${src.dir}/manual" + destdir="${tooldocs.dir}/classes" + addparams="${nsc.params}" target="${nsc.target}" + deprecation="yes" unchecked="yes" + classpathref="manual.classpath"> + <include name="**/*.scala"/> + </quick> + <emit command="fsc"/> + <emit command="sbaz"/> + <emit command="scala"/> + <emit command="scalac"/> + <emit command="scaladoc"/> + <emit command="scalap"/> + <fixcrlf srcdir="${tooldocs.dir}" eol="unix" includes="**/*.1"/> + <copy todir="${tooldocs.dir}"> + <fileset dir="${src.dir}/manual/scala/tools/docutil/resources"> + <include name="**/*.html"/> + <include name="**/*.css"/> + <include name="**/*.gif"/> + <include name="**/*.png"/> + </fileset> + </copy> + </target> + + <macrodef name="emit"> + <attribute name="command"/> + <sequential> + <java classname="scala.tools.docutil.EmitHtml" + output="${tooldocs.dir}/@{command}.html" + classpathref="manual.classpath" + fork="true" logError="yes" + > + <arg value="scala.man1.@{command}"/> + </java> + <java classname="scala.tools.docutil.EmitManPage" + output="${tooldocs.dir}/@{command}.1" + classpathref="manual.classpath" + fork="true" logError="yes" + > + <arg value="scala.man1.@{command}"/> + </java> + </sequential> + </macrodef> + +<!-- =========================================================================== +GENERATES A DISTRIBUTION +============================================================================ --> + + <target name="dist.devel" depends="init"> + <property file="${number.file}"/> + <property name="version.number" + value="${version.major}.${version.minor}.${version.patch}.r${svn.number}"/> + <runtarget target="pack"/> + </target> + + <target name="dist.patch" depends="init"> + <property file="${number.file}"/> + <property name="version.number" + value="${version.major}.${version.minor}.${version.patch}.${version.suffix}"/> + <runtarget target="pack"/> + </target> + + <target name="dist.minor" depends="init"> + <property file="${number.file}"/> + <property name="version.number" + value="${version.major}.${version.minor}.${version.patch}.${version.suffix}"/> + <runtarget target="pack"/> + </target> + + <target name="dist" + depends="clean.build, test, build.dist" + description="Creates a (stability-)tested, complete Scala distribution *from scratch*"/> + + <target name="pack" + depends="build.archive, build.sbaz" + description="Packs a distribution for SBaz and ZIP/TAR"/> + + <target name="binaries" + depends="setup, build.strap" + description="Creates a binary Scala distribution"> + <property name="dist.current.dir" + value="${dist.dir}/scala-${version.number}"/> + <if><and> + <isset property="os.unix"/> + <isset property="dist.resource"/></and> + <then> + <symlink + link="${dist.dir}" + resource="${dist.resource}" overwrite="yes" failonerror="no"/> + <touch file="${dist.dir}/is_symlink" verbose="no"/> + </then></if> + <mkdir dir="${dist.current.dir}"/> + <!-- Copy all requires libraries --> + <mkdir dir="${dist.current.dir}/lib"/> + <property name="ant.version.number" value="1.6.0"/> + <!-- see http://swik.net/Spring/Interface21+Team+Blog/Creating+OSGi+bundles/b2yoy --> + <propertyregex + property="osgi.version.number" input="${version.number}" + regexp="([^-]*)(-.*)?" select="\1" + /> + <echo level="verbose" message="OSGi version: ${osgi.version.number}"/> + <jar destfile="${dist.current.dir}/lib/${comp.jar.name}"> + <fileset dir="${strap.dir}/lib/compiler"/> + <zipfileset src="${fjbg.jar}"/> + <zipfileset src="${msil.jar}"/> + <manifest> + <attribute name="Signature-Version" value="${version.number}"/> + <attribute name="Built-By" value="${user.name}"/> + <attribute name="Main-Class" value="scala.tools.nsc.Main"/> + <attribute name="Class-Path" value="${lib.jar.name}"/> + <section name="scala/tools/nsc"> + <attribute name="Extension-Name" value="scala.tools.nsc"/> + <attribute name="Specification-Title" value="Scala Compiler"/> + <attribute name="Specification-Version" value="${version.number}"/> + <attribute name="Specification-Vendor" value="${vendor.name}"/> + <attribute name="Implementation-Title" value="scala.tools.nsc"/> + <attribute name="Implementation-Version" value="${version.number}"/> + <attribute name="Implementation-Vendor" value="${vendor.name}"/> + </section> + <attribute name="Bundle-DocURL" value="http://www.scala-lang.org/"/> + <attribute name="Bundle-ManifestVersion" value="2"/> + <attribute name="Bundle-Name" value="Scala Compiler Bundle"/> + <attribute name="Bundle-SymbolicName" value="scala_compiler"/> + <attribute name="Bundle-Version" value="${osgi.version.number}"/> + <attribute name="Bundle-Vendor" value="${vendor.name}"/> + <attribute name="Export-Package" value="scala.tools.ant;version="${osgi.version.number}",scala.tools.nsc;version="${osgi.version.number}",scala.tools.nsc.ast;version="${osgi.version.number}",scala.tools.nsc.ast.parser;version="${osgi.version.number}",scala.tools.nsc.backend;version="${osgi.version.number}",scala.tools.nsc.doc;version="${osgi.version.number}",scala.tools.nsc.io;version="${osgi.version.number}",scala.tools.nsc.matching;version="${osgi.version.number}",scala.tools.nsc.models;version="${osgi.version.number}",scala.tools.nsc.symtab;version="${osgi.version.number}",scala.tools.nsc.symtab.classfile;version="${osgi.version.number}",scala.tools.nsc.symtab.clr;version="${osgi.version.number}",scala.tools.nsc.transform;version="${osgi.version.number}",scala.tools.nsc.typechecker;version="${osgi.version.number}",scala.tools.nsc.util;version="${osgi.version.number}",scala.tools.util;version="${osgi.version.number}""/> + <attribute name="Import-Package" value="org.apache.ant.tools;version="${ant.version.number}";resolution:=optional,org.apache.ant.tools.taskdefs;version="${ant.version.number}";resolution:=optional,org.apache.ant.types;version="${ant.version.number}";resolution:=optional,org.apache.ant.tools.util;version="${ant.version.number}";resolution:=optional,org.xml.sax"/> + <attribute name="Bundle-RequiredExecutionEnvironment" value="J2SE-1.4"/> + </manifest> + </jar> + <jar destfile="${dist.current.dir}/lib/${lib.jar.name}"> + <fileset dir="${strap.dir}/lib/library"/> + <fileset dir="${strap.dir}/lib/actors"/> + <manifest> + <attribute name="Signature-Version" value="${version.number}"/> + <attribute name="Built-By" value="${user.name}"/> + <attribute name="Main-Class" value="scala.util.Properties"/> + <section name="scala"> + <attribute name="Extension-Name" value="scala"/> + <attribute name="Specification-Title" value="Scala Library"/> + <attribute name="Specification-Version" value="${version.number}"/> + <attribute name="Specification-Vendor" value="${vendor.name}"/> + <attribute name="Implementation-Title" value="scala"/> + <attribute name="Implementation-Version" value="${version.number}"/> + <attribute name="Implementation-Vendor" value="${vendor.name}"/> + </section> + <attribute name="Bundle-DocURL" value="http://www.scala-lang.org/"/> + <attribute name="Bundle-ManifestVersion" value="2"/> + <attribute name="Bundle-Name" value="Scala Library Bundle"/> + <attribute name="Bundle-SymbolicName" value="scala_library"/> + <attribute name="Bundle-Version" value="${osgi.version.number}"/> + <attribute name="Bundle-Vendor" value="${vendor.name}"/> + <attribute name="Export-Package" value="scala;version="${osgi.version.number}",scala.actors;version="${osgi.version.number}",scala.actors.remote;version="${osgi.version.number}",scala.collection;version="${osgi.version.number}",scala.collection.immutable;version="${osgi.version.number}",scala.collection.jcl;version="${osgi.version.number}",scala.collection.mutable;version="${osgi.version.number}",scala.compat;version="${osgi.version.number}",scala.concurrent;version="${osgi.version.number}",scala.io;version="${osgi.version.number}",scala.mobile;version="${osgi.version.number}",scala.ref;version="${osgi.version.number}",scala.reflect;version="${osgi.version.number}",scala.runtime;version="${osgi.version.number}",scala.testing;version="${osgi.version.number}",scala.text;version="${osgi.version.number}",scala.util;version="${osgi.version.number}",scala.util.automata;version="${osgi.version.number}",scala.util.grammar;version="${osgi.version.number}",scala.util.logging;version="${osgi.version.number}",scala.util.parsing;version="${osgi.version.number}",scala.util.parsing.ast;version="${osgi.version.number}",scala.util.parsing.combinator;version="${osgi.version.number}",scala.util.parsing.combinator.lexical;version="${osgi.version.number}",scala.util.parsing.combinator.syntactical;version="${osgi.version.number}",scala.util.parsing.combinator.testing;version="${osgi.version.number}",scala.util.parsing.combinatorold;version="${osgi.version.number}",scala.util.parsing.combinatorold.lexical;version="${osgi.version.number}",scala.util.parsing.combinatorold.syntactical;version="${osgi.version.number}",scala.util.parsing.combinatorold.testing;version="${osgi.version.number}",scala.util.parsing.input;version="${osgi.version.number}",scala.util.parsing.json;version="${osgi.version.number}",scala.util.parsing.syntax;version="${osgi.version.number}",scala.util.regexp;version="${osgi.version.number}",scala.xml;version="${osgi.version.number}",scala.xml.dtd;version="${osgi.version.number}",scala.xml.factory;version="${osgi.version.number}",scala.xml.parsing;version="${osgi.version.number}",scala.xml.path;version="${osgi.version.number}",scala.xml.pull;version="${osgi.version.number}",scala.xml.transform;version="${osgi.version.number}""/> + <attribute name="Import-Package" value="javax.xml.parsers,org.xml.sax,org.xml.sax.helpers"/> + <attribute name="Bundle-RequiredExecutionEnvironment" value="J2SE-1.4"/> + </manifest> + </jar> + <jar destfile="${dist.current.dir}/lib/${dbc.jar.name}"> + <fileset dir="${strap.dir}/lib/dbc"/> + <manifest> + <attribute name="Signature-Version" value="${version.number}"/> + <attribute name="Built-By" value="${user.name}"/> + <attribute name="Class-Path" value="${lib.jar.name}"/> + <section name="scala/dbc"> + <attribute name="Extension-Name" value="scala.dbc"/> + <attribute name="Specification-Title" value="Scala DBC Library"/> + <attribute name="Specification-Version" value="${version.number}"/> + <attribute name="Specification-Vendor" value="${vendor.name}"/> + <attribute name="Implementation-Title" value="scala.dbc"/> + <attribute name="Implementation-Version" value="${version.number}"/> + <attribute name="Implementation-Vendor" value="${vendor.name}"/> + </section> + <attribute name="Bundle-DocURL" value="http://www.scala-lang.org/"/> + <attribute name="Bundle-ManifestVersion" value="2"/> + <attribute name="Bundle-Name" value="Scala DBC Library Bundle"/> + <attribute name="Bundle-SymbolicName" value="scala_dbc_library"/> + <attribute name="Bundle-Version" value="${osgi.version.number}"/> + <attribute name="Bundle-Vendor" value="${vendor.name}"/> + <attribute name="Export-Package" value="scala.dbc;version="${osgi.version.number}",scala.dbc.datatype;version="${osgi.version.number}",scala.dbc.exception;version="${osgi.version.number}",scala.dbc.result;version="${osgi.version.number}",scala.dbc.statement;version="${osgi.version.number}",scala.dbc.statement.expression;version="${osgi.version.number}",scala.dbc.syntax;version="${osgi.version.number}",scala.dbc.value;version="${osgi.version.number}",scala.dbc.vendor;version="${osgi.version.number}""/> + <attribute name="Import-Package" value="scala;version="${osgi.version.number}",scala.compat;version="${osgi.version.number}""/> + <attribute name="Bundle-RequiredExecutionEnvironment" value="J2SE-1.4"/> + </manifest> + </jar> + <jar destfile="${dist.current.dir}/lib/${partest.jar.name}"> + <fileset dir="${strap.dir}/lib/partest"/> + <manifest> + <attribute name="Signature-Version" value="${version.number}"/> + <attribute name="Built-By" value="${user.name}"/> + <attribute name="Main-Class" value="scala.tools.partest.TestRunner"/> + <attribute name="Class-Path" value="${lib.jar.name}"/> + <section name="scala/tools/partest"> + <attribute name="Extension-Name" value="scala.tools.partest"/> + <attribute name="Specification-Title" value="Scala Test Utility"/> + <attribute name="Specification-Version" value="${version.number}"/> + <attribute name="Specification-Vendor" value="${vendor.name}"/> + <attribute name="Implementation-Title" value="scala.tools.partest"/> + <attribute name="Implementation-Version" value="${version.number}"/> + <attribute name="Implementation-Vendor" value="${vendor.name}"/> + </section> + <attribute name="Bundle-DocURL" value="http://www.scala-lang.org/"/> + <attribute name="Bundle-ManifestVersion" value="2"/> + <attribute name="Bundle-Name" value="Scala Test Bundle"/> + <attribute name="Bundle-SymbolicName" value="scala_compiler"/> + <attribute name="Bundle-Version" value="${osgi.version.number}"/> + <attribute name="Bundle-Vendor" value="${vendor.name}"/> + <attribute name="Export-Package" value="scala.tools.partest;version="${osgi.version.number}",scala.tools.partest.utils;version="${osgi.version.number}""/> + <attribute name="Import-Package" value="javax.swing"/> + <attribute name="Bundle-RequiredExecutionEnvironment" value="J2SE-1.4"/> + </manifest> + </jar> + <copy todir="${dist.current.dir}/lib" file="${jline.jar}"/> + + <!-- build source jars --> + <mkdir dir="${dist.current.dir}/src"/> + <jar + destfile="${dist.current.dir}/src/${libsrc.jar.name}"> + <fileset dir="${src.dir}/library"/> + <fileset dir="${src.dir}/actors"/> + </jar> + <jar + destfile="${dist.current.dir}/src/${dbcsrc.jar.name}" + basedir="${src.dir}/dbc" + includes="**/*.scala" + /> + <jar + destfile="${dist.current.dir}/src/${parsrc.jar.name}" + basedir="${src.dir}/partest" + includes="**/*.scala" + /> + <jar + destfile="${dist.current.dir}/src/${compsrc.jar.name}" + basedir="${src.dir}/compiler" + includes="**/*.scala" + /> + + <!-- Copy executable files --> + <mkdir dir="${dist.current.dir}/bin"/> + <copy todir="${dist.current.dir}/bin"> + <fileset dir="${strap.dir}/bin"/> + </copy> + <chmod perm="ugo+rx" file="${dist.current.dir}/bin/${scalac.exec.name}"/> + <chmod perm="ugo+rx" file="${dist.current.dir}/bin/${scala.exec.name}"/> + <chmod perm="ugo+rx" file="${dist.current.dir}/bin/${scaladoc.exec.name}"/> + <chmod perm="ugo+rx" file="${dist.current.dir}/bin/${fsc.exec.name}"/> + <!-- Recreate the 'latest' link to point to this distribution --> + <if><isset property="os.win"/> + <then> + <copy todir="${dist.dir}/latest"> + <fileset dir="${dist.current.dir}"/> + </copy> + </then> + <else> + <symlink + link="${dist.dir}/latest" + resource="${dist.current.dir}" + overwrite="yes" failonerror="no"/> + </else> + </if> + </target> + + <target name="build.dist" + depends="binaries,docs,docs.manual" + description="Creates the latest Scala distribution"> + <!-- Copy the API, examples and man --> + <copy todir="${dist.current.dir}/doc/scala"> + <fileset dir="${docs.dir}" includes="README,LICENSE"/> + </copy> + <copy todir="${dist.current.dir}/doc/scala/api"> + <fileset dir="${api-lib.dir}"/> + </copy> + <copy todir="${dist.current.dir}/doc/scala/examples"> + <fileset dir="${docs.dir}/examples"/> + </copy> + <copy todir="${dist.current.dir}/man/man1"> + <fileset dir="${tooldocs.dir}" includes="**/*.1"/> + </copy> + <copy todir="${dist.current.dir}/doc/scala/tools"> + <fileset dir="${tooldocs.dir}"> + <include name="**/*.html"/> + <include name="**/*.css"/> + <include name="**/*.gif"/> + <include name="**/*.png"/> + </fileset> + </copy> + <stopwatch name="timer.dist" action="total"/> + </target> + + <!-- Create the SBaz packages --> + <target name="build.sbaz" depends="build.dist,msil,android"> + <property name="sbaz.universe" value="http://www.scala-lang.org/downloads/packages"/> + <mkdir dir="${dist.dir}"/> + <!-- Create the Scala library package --> + <quicksbaz + file="${dist.dir}/scala-library-${version.number}.sbp" + adfile="${dist.dir}/scala-library-${version.number}.advert" + name="scala-library" + version="${version.number}" + desc="The Scala library. This is the minimal requirement to run any Scala program." + link="${sbaz.universe}/scala-library-${version.number}.sbp"> + <libset dir="${dist.current.dir}/lib" includes="${lib.jar.name},${dbc.jar.name}"/> + <srcset dir="${dist.current.dir}/src" includes="${libsrc.jar.name},${dbcsrc.jar.name}"/> + </quicksbaz> + <!-- Create the Scala developer package --> + <quicksbaz + file="${dist.dir}/scala-devel-${version.number}.sbp" + adfile="${dist.dir}/scala-devel-${version.number}.advert" + name="scala-devel" + version="${version.number}" + desc="The Scala developer tools. This contains everything that is required to write, test and document new Scala programs." + depends="scala-library" + link="${sbaz.universe}/scala-devel-${version.number}.sbp"> + <binset dir="${dist.current.dir}/bin" includes="**"/> + <docset dir="${dist.current.dir}/doc" includes="**" excludes="**/scala/api/**,**/scala/tools/**"/> + <libset dir="${dist.current.dir}/lib" includes="${comp.jar.name},${jline.jar.name}"/> + <manset dir="${dist.current.dir}/man" includes="**"/> + <srcset dir="${dist.current.dir}/src" includes="${compsrc.jar.name}"/> + </quicksbaz> + <!-- Create the Scala developer docs package --> + <quicksbaz + file="${dist.dir}/scala-devel-docs-${version.number}.sbp" + adfile="${dist.dir}/scala-devel-docs-${version.number}.advert" + name="scala-devel-docs" + version="${version.number}" + desc="The Scala developer documentation. This contains all developer documentation." + link="${sbaz.universe}/scala-devel-docs-${version.number}.sbp"> + <docset dir="${dist.current.dir}/doc" includes="**/scala/api/**,**/scala/tools/**"/> + </quicksbaz> + <!-- Creates the empty umbrella Scala package --> + <quicksbaz + file="${dist.dir}/scala-${version.number}.sbp" + adfile="${dist.dir}/scala-${version.number}.advert" + name="scala" + version="${version.number}" + desc="The base Scala package that contains everything needed to start using Scala." + depends="scala-library,scala-devel" + link="${sbaz.universe}/scala-${version.number}.sbp"/> + <!-- Creates the Scala test package --> + <quicksbaz + file="${dist.dir}/scala-test-${version.number}.sbp" + adfile="${dist.dir}/scala-test-${version.number}.advert" + name="scala-test" + version="${version.number}" + desc="The Scala test package contains everything needed to test Scala." + link="${sbaz.universe}/scala-test-${version.number}.sbp"> + <binset dir="${basedir}/test" + includes="clitest,diff/diff.*,diff/lib*.dll,scalatest,scalatest.bat,partest"/> + <miscset + dir="${basedir}/test" + includes="files/**/*.args,files/**/*.check,files/**/*.jar,files/**/*.java,files/**/*.scala,files/cli/**/*.check.*,files/jvm/*.so,files/shootout/*.javaopts,files/shootout/*.runner,files/shootout/*.txt"/> + <srcset dir="${dist.current.dir}/src" includes="${parsrc.jar.name}"/> + <libset dir="${dist.current.dir}/lib" includes="${partest.jar.name}"/> + </quicksbaz> + <!-- Creates the MSIL package --> + <quicksbaz + file="${dist.dir}/scala-msil-${version.number}.sbp" + adfile="${dist.dir}/scala-msil-${version.number}.advert" + name="scala-msil" + version="${version.number}" + desc="The Scala MSIL package contains everything needed to use Scala on .NET." + depends="scala-library,scala-devel" + link="${sbaz.universe}/scala-msil-${version.number}.sbp"> + <binset dir="${quick.dir}/bin" includes="scala*net*"/> + <libset dir="${quick.dir}/lib" includes="*.dll"/> + </quicksbaz> + <!-- Creates the CLDC package --> +<!-- + <quicksbaz + file="${dist.dir}/scala-cldc-${version.number}.sbp" + adfile="${dist.dir}/scala-cldc-${version.number}.advert" + name="scala-cldc" + version="${version.number}" + desc="The Scala CLDC package contains everything needed to use Scala on CLDC devices." + link="${sbaz.universe}/scala-cldc-${version.number}.sbp"> + <libset dir="${cldc.dir}/lib" includes="*.jar"/> + </quicksbaz> +--> + <!-- Creates the Android package --> + <if><isset property="android.supported"/><then> + <copy todir="${dist.current.dir}/doc/scala-android/examples"> + <fileset dir="${docs.dir}/android-examples"> + <exclude name="**/R.java"/> + </fileset> + </copy> + <quicksbaz + file="${dist.dir}/scala-android-${version.number}.sbp" + adfile="${dist.dir}/scala-android-${version.number}.advert" + name="scala-android" + version="${version.number}" + desc="The Scala Android package contains everything needed to use Scala on Android." + link="${sbaz.universe}/scala-android-${version.number}.sbp"> + <libset dir="${android.dir}/lib" includes="*.jar"/> + <docset dir="${dist.current.dir}/doc/scala-android" includes="**"/> + </quicksbaz> + </then></if> + </target> + + <target name="build.archive" depends="build.dist"> + <tar + destfile="${dist.dir}/scala-${version.number}.tgz" + compression="gzip"> + <tarfileset + prefix="scala-${version.number}" + dir="${dist.current.dir}" + includes="bin/**" mode="755" + /> + <tarfileset + prefix="scala-${version.number}" + dir="${dist.current.dir}" + excludes="bin/**" + /> + </tar> + <checksum + file="${dist.dir}/scala-${version.number}.tgz" + forceOverwrite="yes" + fileext=".md5"/> + <!-- Create zip archive --> + <zip + destfile="${dist.dir}/scala-${version.number}.zip"> + <zipfileset + prefix="scala-${version.number}" + dir="${dist.current.dir}" + /> + </zip> + <checksum + file="${dist.dir}/scala-${version.number}.zip" + forceOverwrite="yes" + fileext=".md5"/> + <!-- Create source archive --> + <copy todir="${dist.dir}/scala-${version.number}"> + <fileset + dir="${basedir}" + excludes="build,build/**,dists/**" + /> + </copy> + <tar basedir="${dist.dir}" + destfile="${dist.dir}/scala-${version.number}-sources.tgz" + compression="gzip" + includes="scala-${version.number}/**" + /> + </target> + +<!-- =========================================================================== +CLEAN +============================================================================ --> + + <macrodef name="remove"> + <attribute name="dir"/> + <sequential> + <if> + <available file="@{dir}/is_symlink"/> + <then> + <delete includeemptydirs="true" quiet="yes" failonerror="no"> + <fileset dir="@{dir}" includes="**/*"/> + </delete> + </then></if> + <delete dir="@{dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/> + </sequential> + </macrodef> + + <target name="clean" depends="ant-init" description="Removes QUICK, STRAP and API build products"> + <remove dir="${quick.dir}"/> + <remove dir="${strap.dir}"/> + <remove dir="${api.dir}"/> + </target> + + <target name="clean.build" depends="ant-init" + description="Removes all build products"> + <remove dir="${build.dir}"/> + </target> + + <target name="clean.msil" depends="ant-init" description="Removes all MSIL build products"> + <remove dir="${msil.dir}"/> + </target> + +<!-- + <target name="clean.cldc" depends="ant-init" description="Removes all CLDC build products"> + <remove dir="${cldc.dir}"/> + </target> +--> + + <target name="clean.all" depends="ant-init" + description="Removes all build products and distributions"> + <remove dir="${build.dir}"/> + <remove dir="${dist.dir}"/> + </target> + + <target name="clean.unfreeze" depends="init"> + <delete file="${locker.dir}/complete" quiet="yes" failonerror="no"/> + <remove dir="${quick.dir}"/> + </target> + +</project> @@ -1,15 +1,63 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- $Id$ --> -<project name="scala-core" default="build"> +<project name="sabbus" default="build"> <description> - I am SABBUS for Scala core, the build system for the Scala compiler and core - library. Please check the 'docs/README' file for more information about me. + 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> - <echo level="info" message="Running SABBUS for ${ant.project.name}..."/> - +<!-- =========================================================================== +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="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 ============================================================================ --> @@ -22,1991 +70,1011 @@ PROPERTIES <!-- 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 name="properties.file" value="${basedir}/build.properties"/> - <property file="${properties.file}"/> - - <!-- Defines the product being built --> - <property name="vendor.name" value="LAMP/EPFL"/> - <property name="copyright.string" value="(c) 2002-2008 ${vendor.name}"/> - <property name="java.flags" value="-Xmx768M -Xms16M"/> - <property name="number.file" value="${basedir}/build.number"/> - - <!-- Configuring how the compiler is run --> - <property name="nsc.log-files" value="no"/> - <property name="nsc.excludes.file" value="${basedir}/build.excludes"/> - <property name="nsc.params" value=""/> - <condition property="nsc.target" value="jvm-1.4"> - <contains string="${ant.java.version}" substring="1.4"/> - </condition> - <property name="nsc.target" value="jvm-1.5"/> + <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="ant.jar" value="${ant.home}/lib/ant.jar"/> <property name="jline.jar" value="${lib.dir}/jline.jar"/> - <property name="ant-contrib.jar" value="${lib.dir}/ant-contrib.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="locker.dir" value="${build.dir}/locker"/> - <property name="quick.dir" value="${build.dir}/quick"/> - <property name="strap.dir" value="${build.dir}/strap"/> - <property name="optimised.dir" value="${build.dir}/optimised"/> - <property name="api-lib.dir" value="${build.dir}/api-library"/> - <property name="api-comp.dir" value="${build.dir}/api-compiler"/> - <property name="tooldocs.dir" value="${build.dir}/tooldocs"/> - <property name="examples.dir" value="${build.dir}/examples"/> -<!-- <property name="cldc.dir" value="${build.dir}/cldc"/> --> - <property name="android.dir" value="${build.dir}/android"/> - <property name="msil.dir" value="${build.dir}/msil"/> - <property name="mono.dir" value="${src.dir}/mono"/> - - <!-- Sets location and structure of the distribution --> - <property name="dist.dir" value="${basedir}/dists"/> - <property name="lib.jar.name" value="scala-library.jar"/> - <property name="dbc.jar.name" value="scala-dbc.jar"/> - <property name="comp.jar.name" value="scala-compiler.jar"/> - <property name="partest.jar.name" value="scala-partest.jar"/> - <property name="jline.jar.name" value="jline.jar"/> - <property name="libsrc.jar.name" value="scala-library-src.jar"/> - <property name="dbcsrc.jar.name" value="scala-dbc-src.jar"/> - <property name="parsrc.jar.name" value="scala-partest-src.jar"/> - <property name="compsrc.jar.name" value="scala-compiler-src.jar"/> - <property name="scala.exec.name" value="scala"/> - <property name="scalac.exec.name" value="scalac"/> - <property name="scaladoc.exec.name" value="scaladoc"/> - <property name="fsc.exec.name" value="fsc"/> - <property name="comp.prop.name" value="compiler.properties"/> - <property name="lib.prop.name" value="library.properties"/> - <property name="par.prop.name" value="partest.properties"/> - - <!-- if available, faster stability checking --> - <property name="stability.tool" value="/home/linuxsoft/apps/stability/stability"/> - -<!-- =========================================================================== -ANT INITIALISATION -============================================================================ --> - - <target name="ant-init"> - <!-- Making sure lib/ contains everything that is needed --> - <fail message="A required library is missing in 'lib/'. The README file describes what should be there."> - <condition><not><and> - <available file="${lib.starr.jar}"/> - <available file="${comp.starr.jar}"/> - <available file="${fjbg.jar}"/> - <available file="${msil.jar}"/> - <available file="${ant-contrib.jar}"/> - </and></not></condition> - </fail> - <!-- Setting-up Ant contrib tasks --> - <taskdef resource="net/sf/antcontrib/antlib.xml" - classpath="${ant-contrib.jar}"/> - <fail message="External library ${ant-contrib.jar} requires the optional Ant tasks to be installed"> - <condition><not><and> - <available file="${ant.home}/lib/ant-nodeps.jar"/> - </and></not></condition> - </fail> - </target> + <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" depends="ant-init" unless="init.avail"> - <!-- Making sure enough memory is available --> - <propertyregex - property="memory.set" input="${env.ANT_OPTS}" select="\1" - regexp="-Xmx([1-9][0-9]{3,}|[6-9][0-9]{2}|5[2-9][0-9]|51[2-9])(M|m)"/> - <fail - unless="memory.set" - message="SABBUS requires additional memory. Please set the 'ANT_OPTS' environment property to '-Xmx512M' or more."/> - <propertyregex - property="memory.info" input="${env.ANT_OPTS}" defaultValue="" - select=" (raise to 600 MB for performance)" - regexp="-Xmx([1-5][0-9]{2})(M|m)"/> + <target name="init"> + <!-- Setting-up Ant contrib tasks --> + <taskdef resource="net/sf/antcontrib/antlib.xml" classpath="${lib.dir}/ant-contrib.jar"/> <!-- This is the start time for the distribution --> - <stopwatch name="timer.dist"/> <tstamp prefix="time"> - <format property="human" pattern="EEEE, d MMMM yyyy, HH:mm:ss (zz)"/> + <format property="human" pattern="d MMMM yyyy, HH:mm:ss"/> <format property="short" pattern="yyyyMMddHHmmss"/> </tstamp> - <!-- Finding out what system architecture is being used --> - <condition property="os.win"><os family="windows"/></condition> - <if><isset property="os.win"/><then> - <exec - executable="cygpath" vmlauncher="no" - errorproperty="cygpath.err" outputproperty="cygpath.out"> - <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"/> - <then><property name="os.type" value="Cygwin"/></then> - <elseif><isset property="os.win"/> - <then><property name="os.type" value="Windows"/></then> - </elseif> - <elseif><isset property="os.unix"/> - <then><property name="os.type" value="UNIX"/></then> - </elseif> - <else><fail>System environment could not be determined</fail></else> - </if> - <!-- Setting flag for Java versions 1.4.x --> - <condition property="java14"> - <contains string="${java.version}" substring="1.4"/> + <!-- Find out whether we are running on Windows --> + <condition property="os.win"> + <os family="windows"/> </condition> <!-- Finding out SVN revision --> - <exec - executable="svn" vmlauncher="no" - errorproperty="svn.err" outputproperty="svn.out"> + <exec executable="svn" vmlauncher="no" outputproperty="svn.out"> <arg line=" info ${basedir}"/> </exec> <propertyregex property="svn.number" input="${svn.out}" select="\1" regexp="Revision: ([0-9]+)" - defaultValue="x"/> + defaultValue="0"/> <property name="init.avail" value="yes"/> - <!-- Printing out some information about what environment I am running in --> - <echo level="info" - message="OS: ${os.type} (${os.name} ${os.arch} ${os.version});"/> - <echo level="info" - message="Java: ${java.vm.name} ${java.vm.version} ('${java.home}');"/> - <echo level="info" - message="Memory: ${memory.set} MB${memory.info};"/> - <echo level="info" - message="Ant: ${ant.version}."/> - </target> - -<!-- =========================================================================== -SETUP -============================================================================ --> - - <target name="setup.weave"> - <!-- Sets location of RetroWeaver installation --> - <condition property="retroweaver.home" value="${unix.retroweaver.home}"> - <and><os family="unix"/><isset property="unix.retroweaver.home"/></and> - </condition> - <condition property="retroweaver.home" value="${win.retroweaver.home}"> - <and><os family="windows"/><isset property="win.retroweaver.home"/></and> - </condition> - <property name="retroweaver.home" value="${env.RETROWEAVER_HOME}"/> - - <fail message="Set property 'retroweaver.home' to a valid RetroWeaver installation"> - <condition><not><and> - <available file="${retroweaver.home}/lib" type="dir"/> - <available file="${retroweaver.home}/release" type="dir"/> - </and></not></condition> - </fail> - <taskdef name="retroweaver" classname="net.sourceforge.retroweaver.ant.RetroWeaverTask"> - <classpath> - <fileset dir="${retroweaver.home}/lib" includes="**/*.jar"/> - <fileset dir="${retroweaver.home}/release" includes="**/*-all-*jar"/> - </classpath> - </taskdef> - <retroweaver - inputjar="${lib.starr.jar}" - outputjar="${lib.starr14.jar}" - /> - <retroweaver - inputjar="${comp.starr.jar}" - outputjar="${comp.starr14.jar}" - /> - </target> - - <target name="setup" depends="init"> - <!-- Creating class-pathes --> - <if> - <contains string="${java.version}" substring="1.4"/> - <then> - <mkdir dir="${build.dir}/starr"/> - <property name="lib.starr14.jar" value="${build.dir}/starr/scala-library-14.jar"/> - <property name="comp.starr14.jar" value="${build.dir}/starr/scala-compiler-14.jar"/> - <antcall target="setup.weave"> - <param name="lib.starr14.jar" value="${lib.starr14.jar}"/> - <param name="comp.starr14.jar" value="${comp.starr14.jar}"/> - </antcall> - <path id="starr.classpath"> - <pathelement location="${lib.starr14.jar}"/> - <pathelement location="${comp.starr14.jar}"/> - <pathelement location="${fjbg.jar}"/> - <pathelement location="${msil.jar}"/> - <pathelement location="${ant.jar}"/> - <pathelement location="${jline.jar}"/> - </path> - </then> - <else> - <path id="starr.classpath"> - <pathelement location="${lib.starr.jar}"/> - <pathelement location="${comp.starr.jar}"/> - <pathelement location="${fjbg.jar}"/> - <pathelement location="${msil.jar}"/> - <pathelement location="${ant.jar}"/> - <pathelement location="${jline.jar}"/> - </path> - </else> - </if> - <!-- Creating boot-level tasks --> - <taskdef - name="starr" - classname="scala.tools.ant.Scalac" - classpathref="starr.classpath"/> - <taskdef - name="starrtool" - classname="scala.tools.ant.ScalaTool" - classpathref="starr.classpath" /> - <!-- 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> - <echo level="warning" - message="STARR updated: LOCKER is obsolete and will be rebuilt."/> - <runtarget target="clean.build"/> - </then> - </if> - <!-- Finding out what is available --> - <available property="excludes.avail" file="${nsc.excludes.file}"/> - <condition property="locker.avail"> - <available file="${locker.dir}/complete"/> - </condition> <!-- Generating version number --> - <property file="${number.file}"/> + <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 SVN revision ${svn.number}"/> - </target> - - <target name="setup.locker" depends="setup, build.locker"> - <path id="locker.classpath"> - <pathelement location="${locker.dir}/lib/library"/> - <pathelement location="${locker.dir}/lib/compiler"/> - <pathelement location="${fjbg.jar}"/> - <pathelement location="${msil.jar}"/> - </path> - <taskdef - name="locker" - classname="scala.tools.ant.Scalac" - classpathref="locker.classpath"/> - </target> - - <target name="setup.quick" depends="setup, build"> - <path id="quick.classpath"> - <pathelement location="${quick.dir}/lib/library"/> - <pathelement location="${quick.dir}/lib/compiler"/> + <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="${msil.jar}"/> + <pathelement location="${ant.jar}"/> </path> - <taskdef - name="quick" classname="scala.tools.ant.Scalac" - classpathref="quick.classpath"/> - <taskdef - name="quicksbaz" classname="scala.tools.ant.ScalaBazaar" - classpathref="quick.classpath"/> - <taskdef - name="quickdoc" classname="scala.tools.ant.Scaladoc" - classpathref="quick.classpath"/> + <taskdef resource="scala/tools/ant/sabbus/antlib.xml" classpathref="starr.classpath"/> </target> <!-- =========================================================================== -BUILD SUPPORT MACROS -============================================================================ --> - - <macrodef name="build.support"> - <attribute name="build.dir"/> - <sequential> - <copy todir="@{build.dir}/lib/library"> - <fileset dir="${src.dir}/library"> - <include name="**/*.tmpl"/> - <include name="**/*.xml"/> - <include name="**/*.js"/> - <include name="**/*.css"/> - </fileset> - </copy> - <copy todir="@{build.dir}/lib/compiler"> - <fileset dir="${src.dir}/compiler"> - <include name="**/*.tmpl"/> - <include name="**/*.xml"/> - <include name="**/*.js"/> - <include name="**/*.css"/> - </fileset> - </copy> - </sequential> - </macrodef> - - <macrodef name="build.links"> - <attribute name="build.dir"/> - <sequential> - <if><not><available file="@{build.dir}/lib/fjbg.jar"/></not><then> - <if><isset property="os.win"/><then> - <copy file="${fjbg.jar}" tofile="@{build.dir}/lib/fjbg.jar"/> - </then><else> - <symlink - link="@{build.dir}/lib/fjbg.jar" - resource="${fjbg.jar}" overwrite="yes" failonerror="no"/> - </else></if> - </then></if> - <if><not><available file="@{build.dir}/lib/msil.jar"/></not><then> - <if><isset property="os.win"/><then> - <copy file="${msil.jar}" tofile="@{build.dir}/lib/msil.jar"/> - </then><else> - <symlink - link="@{build.dir}/lib/msil.jar" - resource="${msil.jar}" overwrite="yes" failonerror="no"/> - </else></if> - </then></if> - <if><not><available file="@{build.dir}/lib/jline.jar"/></not><then> - <if><isset property="os.win"/><then> - <copy file="${jline.jar}" tofile="@{build.dir}/lib/jline.jar"/> - </then><else> - <symlink - link="@{build.dir}/lib/jline.jar" - resource="${jline.jar}" overwrite="yes" failonerror="no"/> - </else></if> - </then></if> - </sequential> - </macrodef> - -<!-- =========================================================================== -BUILD LOCAL REFERENCE (LOCKER) LAYER +LOCAL REFERENCE BUILD (LOCKER) ============================================================================ --> - <target name="newlocker" - depends="clean.unfreeze, build.locker" - description="Rebuilds LOCKER from the current sources"/> + <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="build.locker" depends="setup" unless="locker.avail"> - <property name="built.locker" value="yes"/> - <stopwatch name="timer.locker"/> - <!-- Build library --> - <if><and> - <isset property="os.unix"/> - <isset property="build.resource"/></and> - <then> - <symlink - link="${build.dir}" - resource="${build.resource}" overwrite="yes" failonerror="no"/> - <touch file="${build.dir}/is_symlink" verbose="no"/> - </then></if> - <mkdir dir="${locker.dir}/lib/library"/> + <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="${locker.dir}/lib/library" - source="1.4" target="1.4" deprecation="yes" - classpath="${locker.dir}/lib/library" - includes="**/*.java"/> - <starr - srcdir="${src.dir}/library" - destdir="${locker.dir}/lib/library" - addparams="${nsc.params}" target="${nsc.target}" - deprecation="yes" unchecked="yes" - classpath="${locker.dir}/lib/library" - includes="scala/Predef.scala"/> - <starr - srcdir="${src.dir}/library" - destdir="${locker.dir}/lib/library" - addparams="${nsc.params}" target="${nsc.target}" - deprecation="yes" unchecked="yes" - classpath="${locker.dir}/lib/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/**"/> - <excludesfile name="${nsc.excludes.file}" if="excludes.avail"/> - </starr> - <echo - file="${locker.dir}/lib/library/${lib.prop.name}" - message="version.number=${version.number}${line.separator}" - append="false" - /> - <echo - file="${locker.dir}/lib/library/${lib.prop.name}" - message="copyright.string=${copyright.string}${line.separator}" - append="true" - /> - <!-- Build compiler --> - <mkdir dir="${locker.dir}/lib/compiler"/> - <starr - srcdir="${src.dir}/compiler" - destdir="${locker.dir}/lib/compiler" - addparams="${nsc.params}" target="${nsc.target}" - deprecation="yes" unchecked="yes"> - <classpath> - <pathelement location="${locker.dir}/lib/library"/> - <pathelement location="${locker.dir}/lib/compiler"/> + </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="${ant.jar}"/> <pathelement location="${jline.jar}"/> - </classpath> + <pathelement location="${ant.jar}"/> + </compilationpath> + </sabmake> + <sabuse id="starr.comp.scalac" srcdir="${src.dir}/compiler"> <include name="**/*.scala"/> - <excludesfile name="${nsc.excludes.file}" if="excludes.avail"/> - </starr> - <echo - file="${locker.dir}/lib/compiler/${comp.prop.name}" - message="version.number=${version.number}${line.separator}" - append="false" - /> - <echo - file="${locker.dir}/lib/compiler/${comp.prop.name}" - message="copyright.string=${copyright.string}${line.separator}" - append="true" - /> - <!-- Timing the build --> - <stopwatch name="timer.locker" action="total"/> - <!-- Copy support files to build folder and links external libraries--> - <build.support build.dir="${locker.dir}"/> - <build.links build.dir="${locker.dir}"/> - <!-- Build executable files --> - <taskdef - name="lockertool" - classname="scala.tools.ant.ScalaTool" - classpathref="locker.classpath"/> - <mkdir dir="${locker.dir}/bin"/> - <lockertool - file="${locker.dir}/bin/${scala.exec.name}" - class="scala.tools.nsc.MainGenericRunner" - javaFlags="${java.flags}"/> - <lockertool - file="${locker.dir}/bin/${scalac.exec.name}" - class="scala.tools.nsc.Main" - javaFlags="${java.flags}"/> - <lockertool - file="${locker.dir}/bin/${scaladoc.exec.name}" - class="scala.tools.nsc.ScalaDoc" - javaFlags="${java.flags}"/> - <lockertool - file="${locker.dir}/bin/${fsc.exec.name}" - class="scala.tools.nsc.CompileClient" - javaFlags="${java.flags}"/> - <chmod perm="ugo+rx" - file="${locker.dir}/bin/${scalac.exec.name}"/> - <chmod perm="ugo+rx" - file="${locker.dir}/bin/${scala.exec.name}"/> - <chmod perm="ugo+rx" - file="${locker.dir}/bin/${scaladoc.exec.name}"/> - <chmod perm="ugo+rx" - file="${locker.dir}/bin/${fsc.exec.name}"/> - <fixcrlf - srcdir="${locker.dir}/bin" - eol="dos" - includes="**/*.bat"/> - <!-- Mark LOCKER as being completely built --> - <touch file="${locker.dir}/complete" verbose="no"/> + </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> <!-- =========================================================================== -BUILD QUICK-TEST LAYER +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="build" depends="setup.locker" - description="Builds a quick-test (QUICK) version of the compiler"> - <stopwatch name="timer.quick"/> - <!-- Build library --> - <mkdir dir="${quick.dir}/lib/library"/> + <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="${quick.dir}/lib/library" - source="1.4" target="1.4" deprecation="yes" - classpath="${quick.dir}/lib/library" - includes="**/*.java"/> - <locker - srcdir="${src.dir}/library" - destdir="${quick.dir}/lib/library" - addparams="${nsc.params}" target="${nsc.target}" - deprecation="yes" unchecked="yes" - scalacdebugging="${nsc.log-files}" - classpath="${quick.dir}/lib/library" - includes="scala/Predef.scala"/> - <locker - srcdir="${src.dir}/library" - destdir="${quick.dir}/lib/library" - addparams="${nsc.params}" target="${nsc.target}" - deprecation="yes" unchecked="yes" - scalacdebugging="${nsc.log-files}" - classpath="${quick.dir}/lib/library"> - <include name="**/*.scala"/> - <exclude name="scala/Predef.scala"/> - <exclude name="scala/dbc/**"/> - <exclude name="scala/actors/**"/> - <excludesfile name="${nsc.excludes.file}" if="excludes.avail"/> - </locker> - <echo - file="${quick.dir}/lib/library/${lib.prop.name}" - message="version.number=${version.number}${line.separator}" - append="false" - /> - <echo - file="${quick.dir}/lib/library/${lib.prop.name}" - message="copyright.string=${copyright.string}${line.separator}" - append="true" - /> - <!-- Build DBC --> - <mkdir dir="${quick.dir}/lib/dbc"/> - <locker - srcdir="${src.dir}/dbc" - destdir="${quick.dir}/lib/dbc" - addparams="${nsc.params}" target="${nsc.target}" - deprecation="yes" unchecked="yes" - scalacdebugging="${nsc.log-files}"> - <classpath> - <pathelement location="${quick.dir}/lib/library"/> - <pathelement location="${quick.dir}/lib/dbc"/> - </classpath> - <include name="scala/dbc/**/*.scala"/> - <excludesfile name="${nsc.excludes.file}" if="excludes.avail"/> - </locker> - <!-- Build actors library --> - <mkdir dir="${quick.dir}/lib/actors"/> + 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="${quick.dir}/lib/actors" - source="1.4" target="1.4" deprecation="yes" - classpath="${quick.dir}/lib/actors" - includes="scala/actors/**/*.java"/> - <locker - srcdir="${src.dir}/actors" - destdir="${quick.dir}/lib/actors" - addparams="${nsc.params}" target="${nsc.target}" - deprecation="yes" unchecked="yes" - scalacdebugging="${nsc.log-files}"> - <classpath> - <pathelement location="${quick.dir}/lib/library"/> - <pathelement location="${quick.dir}/lib/actors"/> - </classpath> - <include name="scala/actors/**/*.scala"/> - <excludesfile name="${nsc.excludes.file}" if="excludes.avail"/> - </locker> - <!-- Build compiler --> - <mkdir dir="${quick.dir}/lib/compiler"/> - <locker - srcdir="${src.dir}/compiler" - destdir="${quick.dir}/lib/compiler" - addparams="${nsc.params}" target="${nsc.target}" - deprecation="yes" unchecked="yes" - scalacdebugging="${nsc.log-files}"> - <classpath> - <pathelement location="${quick.dir}/lib/library"/> - <pathelement location="${quick.dir}/lib/compiler"/> + 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="${ant.jar}"/> <pathelement location="${jline.jar}"/> - </classpath> + <pathelement location="${ant.jar}"/> + </compilationpath> + </sabmake> + <sabuse id="locker.comp.scalac" srcdir="${src.dir}/compiler"> <include name="**/*.scala"/> - <excludesfile name="${nsc.excludes.file}" if="excludes.avail"/> - </locker> - <echo - file="${quick.dir}/lib/compiler/${comp.prop.name}" - message="version.number=${version.number}${line.separator}" - append="false" - /> - <echo - file="${quick.dir}/lib/compiler/${comp.prop.name}" - message="copyright.string=${copyright.string}${line.separator}" - append="true" - /> - <!-- Build partest --> - <mkdir dir="${quick.dir}/lib/partest"/> + </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="${quick.dir}/lib/partest" - source="1.4" target="1.4" deprecation="yes" - classpath="${quick.dir}/lib/partest" - includes="scala/tools/partest/**/*.java"/> - <locker - srcdir="${src.dir}/partest" - destdir="${quick.dir}/lib/partest" - addparams="${nsc.params}" target="${nsc.target}" - deprecation="yes" unchecked="yes"> + destdir="${build-quick.dir}/classes/partest" + target="1.5" source="1.5"> <classpath> - <pathelement location="${quick.dir}/lib/library"/> - <pathelement location="${quick.dir}/lib/compiler"/> - <pathelement location="${quick.dir}/lib/actors"/> - <pathelement location="${ant.jar}"/> + <pathelement location="${build-quick.dir}/classes/library"/> + <pathelement location="${build-quick.dir}/classes/compiler"/> + <pathelement location="${build-quick.dir}/classes/partest"/> </classpath> - </locker> - <echo - file="${quick.dir}/lib/partest/${par.prop.name}" - message="version.number=${version.number}${line.separator}" - append="false" - /> - <echo - file="${quick.dir}/lib/partest/${par.prop.name}" - message="copyright.string=${copyright.string}${line.separator}" - append="true" - /> - <!-- Timing the build --> - <stopwatch name="timer.quick" action="total"/> - <!-- Copy support files to build folder and links external libraries--> - <build.support build.dir="${quick.dir}"/> - <build.links build.dir="${quick.dir}"/> - <!-- Build executable files --> - <taskdef - name="quicktool" - classname="scala.tools.ant.ScalaTool" - classpathref="quick.classpath"/> - <mkdir dir="${quick.dir}/bin"/> - <quicktool - file="${quick.dir}/bin/${scala.exec.name}" + <include name="**/*.java"/> + </javac> + <sabmake id="locker.partest.scalac" + destdir="${build-quick.dir}/classes/partest" + compilerpathref="locker.classpath" + srcpath="${src.dir}/paartest" + 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}"/> - <quicktool - file="${quick.dir}/bin/${scalac.exec.name}" + javaFlags="${java.flags}" + classpathref="quick.bin.classpath"/> + <quick-bin + file="${build-quick.dir}/bin/scalac" class="scala.tools.nsc.Main" - javaFlags="${java.flags}"/> - <quicktool - file="${quick.dir}/bin/${scaladoc.exec.name}" + javaFlags="${java.flags}" + classpathref="quick.bin.classpath"/> + <quick-bin + file="${build-quick.dir}/bin/scaladoc" class="scala.tools.nsc.ScalaDoc" - javaFlags="${java.flags}"/> - <quicktool - file="${quick.dir}/bin/${fsc.exec.name}" + javaFlags="${java.flags}" + classpathref="quick.bin.classpath"/> + <quick-bin + file="${build-quick.dir}/bin/fsc" class="scala.tools.nsc.CompileClient" - javaFlags="${java.flags}"/> - <chmod perm="ugo+rx" - file="${quick.dir}/bin/${scalac.exec.name}"/> - <chmod perm="ugo+rx" - file="${quick.dir}/bin/${scala.exec.name}"/> - <chmod perm="ugo+rx" - file="${quick.dir}/bin/${scaladoc.exec.name}"/> - <chmod perm="ugo+rx" - file="${quick.dir}/bin/${fsc.exec.name}"/> - <fixcrlf - srcdir="${quick.dir}/bin" - eol="dos" - includes="**/*.bat"/> + 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="test.quick" depends="build"> - <echo level="info" - message="Ant test bench is not available yet."/> + + <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> <!-- =========================================================================== -CLDC +PACKED QUICK BUILD (PACK) ============================================================================ --> -<!-- - <property name="cldcapi.jar" value="${lib.dir}/cldcapi10.jar"/> - <property name="midpapi.jar" value="${lib.dir}/midpapi10.jar"/> - - <target name="cldc.sources" - description="Create the source directory for the J2ME (CLDC) library" - > - <mkdir dir="${cldc.dir}/src"/> - - <copy todir="${cldc.dir}/src"> - <fileset dir="${src.dir}/library" includes="**/*.scala, **/*.java"> - <not> - <present targetdir="${src.dir}/cldc-library"/> - </not> - <exclude name="**/*CharSequence.scala"/> - <exclude name="**/jcl/**"/> - <exclude name="**/ref/**"/> - <exclude name="**/compat/**"/> - <exclude name="**/concurrent/**"/> - <exclude name="**/runtime/RichFloat.scala"/> - <exclude name="**/runtime/RichDouble.scala"/> - <exclude name="**/util/**"/> - <exclude name="**/xml/**"/> - </fileset> - </copy> - - <copy todir="${cldc.dir}/src"> - <fileset dir="${src.dir}/cldc-library"> - <include name="**/*.scala"/> - <include name="**/*.java"/> - </fileset> - </copy> - + + <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="cldc.libraries" - depends="setup.quick, cldc.sources" - description="Builds the Scala library for J2ME (CLDC)" - > - <mkdir dir="${cldc.dir}/lib/library"/> - <javac - srcdir="${cldc.dir}/src" - destdir="${cldc.dir}/lib/library" - compiler="javac1.4" - source="1.1" - target="1.1" - deprecation="${jc.deprecation}" - > - <bootclasspath> - <pathelement location="${cldcapi.jar}"/> - </bootclasspath> - <include name="**/*.java"/> - <exclude name="scala/runtime/FloatRef.java"/> - <exclude name="scala/runtime/DoubleRef.java"/> - </javac> - - <quick - srcdir="${cldc.dir}/src" - destdir="${cldc.dir}/lib/library" - addparams="${nsc.params}" - target="cldc" - scalacdebugging="${nsc.log-files}" - > - <bootclasspath> - <pathelement location="${cldcapi.jar}"/> - </bootclasspath> - <classpath> - <pathelement location="${cldc.dir}"/> - </classpath> - <include name="scala/Predef.scala"/> - </quick> - <quick - srcdir="${cldc.dir}/src" - destdir="${cldc.dir}/lib/library" - target="cldc" - addparams="${nsc.params}" - scalacdebugging="${nsc.log-files}" - > - <bootclasspath> - <pathelement location="${cldcapi.jar}"/> - </bootclasspath> - <classpath> - <pathelement location="${cldc.dir}"/> - </classpath> - <include name="**/*.scala"/> - <exclude name="scala/Predef.scala"/> - <exclude name="scala/BigDecimal.scala"/> - <exclude name="scala/BigInt.scala"/> - <exclude name="scala/collection/mutable/JavaMapAdaptor.scala"/> - <exclude name="scala/collection/mutable/JavaSetAdaptor.scala"/> - <exclude name="scala/collection/mutable/LinkedHashSet.scala"/> - <exclude name="scala/util/Fluid.scala"/> - <exclude name="scala/runtime/BoxedFloatArray.scala"/> - <exclude name="scala/runtime/BoxedDoubleArray.scala"/> - <exclude name="scala/io/**"/> - <exclude name="scala/mobile/**"/> - <exclude name="scala/reflect/**"/> - <exclude name="scala/text/**"/> - <exclude name="scala/testing/**"/> - <exclude name="scala/xml/**"/> - <excludesfile name="${nsc.excludes}" if="excludes.avail"/> - </quick> - <macrodef name="preverify"> - <attribute name="srcdir"/> - <attribute name="destdir"/> - <sequential> - <exec executable="preverify" failonerror="false"> - <arg line="-classpath ${cldcapi.jar}${path.separator}${midpapi.jar}"/> - <arg line="-target cldc1.0"/> - <arg line="-d @{destdir}"/> - <arg value="@{srcdir}"/> - </exec> - </sequential> - </macrodef> - <mkdir dir="${cldc.dir}/lib/preverified"/> - <preverify - srcdir="${cldc.dir}/lib/library" - destdir="${cldc.dir}/lib/preverified" - /> - <jar - destfile="${cldc.dir}/lib/scalaapi10-unverified.jar" - basedir="${cldc.dir}/lib/library" - includes="scala/**/*.class"> - <manifest> - <attribute name="Created-By" value="${version.number} (${vendor.name})"/> - </manifest> + <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="${cldc.dir}/lib/scalaapi10.jar" - basedir="${cldc.dir}/lib/preverified" - includes="scala/**/*.class"> - <manifest> - <attribute name="Created-By" value="${version.number} (${vendor.name})"/> - <attribute name="API-Specification-Version" value="1.0"/> - <attribute name="API" value="Scala CLDC"/> - <attribute name="API-Name" value="Scala Connected Limited Device Configuration"/> - <attribute name="API-Type" value="Configuration"/> - </manifest> + <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="cldc" depends="cldc.libraries"> - </target> ---> - -<!-- =========================================================================== -ANDROID -============================================================================ --> - - <target name="android.init"> - <!-- Sets location of Android installation --> - <condition property="android.home" value="${unix.android.home}"> - <and><os family="unix"/><isset property="unix.android.home"/></and> - </condition> - <condition property="android.home" value="${win.android.home}"> - <and><os family="windows"/><isset property="win.android.home"/></and> - </condition> - <property name="android.home" value="${env.ANDROID_HOME}"/> - - <fail message="Android home is not set or could not find android.jar in ${android.home}"> - <condition><not> - <available file="${android.home}/android.jar"/> - </not></condition> - </fail> - </target> - - <target name="android.sources" depends="android.init" - description="Create the source directory for Android library" - > - <mkdir dir="${android.dir}/src"/> - <copy todir="${android.dir}/src"> - <fileset dir="${src.dir}/android-library" includes="**/*.scala, **/*.java"/> - </copy> - <copy todir="${android.dir}/src"> - <fileset dir="${src.dir}/library" includes="**/*.scala, **/*.java" /> - </copy> - </target> - - <target name="android.libraries" - depends="setup.quick, android.sources" - description="Builds the Scala library for Android"> - <mkdir dir="${android.dir}/lib/library"/> - <javac - srcdir="${android.dir}/src" - destdir="${android.dir}/lib/library" - deprecation="${jc.deprecation}" - > - <bootclasspath> - <pathelement location="${android.home}/android.jar}"/> - </bootclasspath> - <include name="**/*.java"/> - </javac> - - <quick - srcdir="${android.dir}/src" - destdir="${android.dir}/lib/library" - deprecation="yes" unchecked="yes" - addparams="${nsc.params}" - extdirs="" - scalacdebugging="${nsc.log-files}" - > - <bootclasspath> - <pathelement location="${android.home}/android.jar"/> - </bootclasspath> - <include name="scala/Predef.scala"/> - </quick> - - <quick - srcdir="${android.dir}/src" - destdir="${android.dir}/lib/library" - deprecation="yes" unchecked="yes" - extdirs="" - addparams="${nsc.params}" - scalacdebugging="${nsc.log-files}" - > - <bootclasspath> - <pathelement location="${android.home}/android.jar"/> - </bootclasspath> - <classpath> - <pathelement location="${android.dir}"/> - </classpath> - <include name="**/*.scala"/> - <exclude name="scala/Predef.scala"/> - <excludesfile name="${nsc.excludes}" if="excludes.avail"/> - </quick> - </target> - - <target name="android.build" depends="android.libraries" - description="Convert this project's .class files into .dex files"> - <property name="dx.jar" value="${android.home}/tools/lib/dx.jar"/> - <java jar="${dx.jar}" fork="true" failonerror="true"> - <jvmarg value="-Djava.ext.dirs=${android.home}${file.separator}tools${file.separator}lib"/> - <jvmarg value="-Xmx384M"/> - <arg value="--dex"/> - <arg value="--output=${android.dir}/lib/scala.dex"/> - <arg value="--locals=full"/> - <arg value="--positions=lines"/> - <arg value="--no-optimize"/> <!-- workaround for M5-RC14 bug --> - <arg value="${android.dir}/lib/library"/> - </java> - <jar - destfile="${android.dir}/lib/scala-dex.jar" - basedir="${android.dir}/lib" - includes="scala.dex" - /> - <jar - destfile="${android.dir}/lib/scala-android.jar" - basedir="${android.dir}/lib/library" - includes="scala/**/*.class" - /> - </target> - - <target name="android" depends="init"> - <condition property="android.supported"> - <and> - <not><contains string="${java.version}" substring="1.4"/></not> - <contains string="${java.vendor}" substring="Sun"/> - </and> - </condition> - <if><isset property="android.supported"/><then> - <antcall target="android.build"/> - </then><else> - <echo message="The Android library build requires Sun Java 1.5 or newer"/> - </else></if> - </target> - -<!-- =========================================================================== -MSIL -============================================================================ --> - - <target name="msil.init" depends="ant-init"> - <!-- Sets ilasm command (either Microsoft .NET Framework or Mono) --> - <condition property="ilasm.cmd" value="${msdn.home}/ilasm.exe"> - <and> - <os family="windows"/><isset property="msdn.home"/> - <available file="${msdn.home}/ilasm.exe"/> - </and> - </condition> - <condition property="ilasm.cmd" value="${unix.mono.home}/ilasm"> - <and> - <os family="unix"/><isset property="unix.mono.home"/> - <available file="${unix.mono.home}/ilasm"/> - </and> - </condition> - <condition property="ilasm.cmd" value="${win.mono.home}/ilasm"> - <and> - <os family="windows"/><isset property="${win.mono.home}/lib/mono/2.0/ilasm.exe"/> - <available file="${win.mono.home}/lib/mono/2.0/ilasm.exe"/> - </and> - </condition> - <echo level="verbose" message="Found: ${ilasm.cmd}"/> - <condition property="ilasm.cmd" value="ilasm"> - <and><available file="ilasm" filepath="${env.PATH}"/></and> - </condition> - <fail message="Command 'ilasm' not found"> - <condition><not><isset property="ilasm.cmd"/></not></condition> - </fail> - <!-- Sets ilasm arguments (either Windows or Unix) --> - <property name="ilasm.outfile" value="${msil.dir}/predef.dll"/> - <if> - <isset property="os.win"/> - <then> - <property - name="ilasm.args" - value="/quiet /dll /output=${ilasm.outfile}" - /> - </then> - <else> - <property - name="ilasm.args" - value="/dll /output:${ilasm.outfile}" - /> - </else> - </if> + + <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="msil.sources" depends="msil.init"> - <mkdir dir="${msil.dir}/src"/> - <copy todir="${msil.dir}/src"> - <fileset dir="${src.dir}/dotnet-library" includes="**/*.scala, **/*.cs"/> - </copy> - <copy todir="${msil.dir}/src"> - <fileset dir="${src.dir}/library" includes="**/*.scala"/> - </copy> + <target name="pack.comp" depends="pack.pre-comp" unless="pack.comp.available"> + <mkdir dir="${build-pack.dir}/lib"/> + <jar destfile="${build-pack.dir}/lib/scala-compiler.jar"> + <fileset dir="${build-quick.dir}/classes/compiler"/> + <zipfileset src="${fjbg.jar}"/> + <zipfileset src="${msil.jar}"/> + <zipfileset src="${jline.jar}"/> + </jar> </target> - - <target name="msil.libraries" depends="setup.quick, msil.sources"> - <quick srcdir="${msil.dir}/src" destdir="${msil.dir}" target="msil" - assemname="predef" assemrefs="${lib.dir}" - failonerror="false"> - <include name="**/*.scala"/> - <exclude name="scala/ScalaObject.scala"/> - <!-- - <include name="scala/Predef.scala"/> - <include name="scala/Either.scala"/> - <include name="scala/Option.scala"/> - <include name="scala/Pair.scala"/> - <include name="scala/Console.scala"/> - <include name="scala/Application.scala"/> - <include name="scala/ByNameFunction.scala"/> - <include name="scala/Stream.scala"/> - <include name="scala/*Annotation.scala"/> - <include name="scala/Function*.scala"/> - <include name="scala/Tuple*.scala"/> - <include name="scala/Product*.scala"/> - <include name="scala/List.scala"/> - <include name="scala/cloneable.scala"/> - <include name="scala/deprecated.scala"/> - <include name="scala/native.scala"/> - <include name="scala/serializable.scala"/> - <include name="scala/transient.scala"/> - <include name="scala/volatile.scala"/> - <include name="scala/remote.scala"/> - <include name="scala/throws.scala"/> - <include name="scala/BigInt.scala"/> - <include name="scala/CountedIterator.scala"/> - <include name="scala/collection/**/*.scala"/> - <include name="scala/runtime/*.scala"/> - <include name="scala/concurrent/*.scala"/> - <include name="scala/ref/*.scala"/> - <include name="scala/reflect/*.scala"/> - <include name="scala/testing/*.scala"/> - <include name="scala/text/*.scala"/> --> - </quick> - <pathconvert property="ilasm.infile" pathsep=" "> - <fileset dir="${msil.dir}" includes="*.msil"/> - </pathconvert> - <exec - executable="${ilasm.cmd}" vmlauncher="no"> - <!-- - errorproperty="ilasm.err" outputproperty="ilasm.out"> - --> - <arg line="${ilasm.args} ${ilasm.infile}"/> - </exec> + + <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="msil" depends="msil.libraries"> - <copy todir="${quick.dir}/bin"> - <fileset - dir="${mono.dir}/bin" - includes="scala-net*" - /> - <filterset> - <filter token="VERSION" value="${version.number}"/> - <filter token="COPYRIGHT" value="${copyright.string}"/> - <filter token="NAME" value="Scala code runner"/> - </filterset> - </copy> - <copy todir="${quick.dir}/bin"> - <fileset - dir="${mono.dir}/bin" - includes="scalac-net*" - /> - <filterset> - <filter token="VERSION" value="${version.number}"/> - <filter token="COPYRIGHT" value="${copyright.string}"/> - <filter token="NAME" value="Scala compiler"/> - </filterset> - </copy> - <chmod perm="ugo+rx" - dir="${quick.dir}/bin" includes="*-net*"/> - <if><isset property="os.win"/> - <then> - <copy todir="${quick.dir}/lib"> - <fileset dir="${msil.dir}" includes="*.dll"/> - <fileset dir="${lib.dir}" includes="*.dll"/> - </copy> - </then> - <else> - <symlink - link="${quick.dir}/lib/predef.dll" - resource="${msil.dir}/predef.dll" - overwrite="yes" failonerror="no"/> - <symlink - link="${quick.dir}/lib/scalaruntime.dll" - resource="${lib.dir}/scalaruntime.dll" - overwrite="yes" failonerror="no"/> - <symlink - link="${quick.dir}/lib/mscorlib.dll" - resource="${lib.dir}/mscorlib.dll" - overwrite="yes" failonerror="no"/> - </else> - </if> + <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> -<!-- =========================================================================== -OPTIMIZE -============================================================================ --> - <target name="optimised" depends="build.optimised" - description="Build the compiler with optimizations on."/> + <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> - <!-- Build the bootstrap layer --> - <target name="build.optimised" depends="setup.quick"> - <stopwatch name="timer.optimised"/> - <!-- Build library --> - <mkdir dir="${optimised.dir}/lib/library"/> - <javac - srcdir="${src.dir}/library" - destdir="${optimised.dir}/lib/library" - source="1.4" target="1.4" deprecation="yes" - classpath="${optimised.dir}/lib/library" - includes="**/*.java"/> - <quick - srcdir="${src.dir}/library" - destdir="${optimised.dir}/lib/library" - addparams="${nsc.params}" target="${nsc.target}" - deprecation="yes" unchecked="yes" - optimise="yes" - classpath="${optimised.dir}/lib/library" - includes="scala/Predef.scala"/> - <quick - srcdir="${src.dir}/library" - destdir="${optimised.dir}/lib/library" - addparams="${nsc.params}" target="${nsc.target}" - optimise="yes" - deprecation="yes" unchecked="yes" - classpath="${optimised.dir}/lib/library"> - <include name="**/*.scala"/> - <exclude name="scala/Predef.scala"/> - <exclude name="scala/dbc/**"/> - <exclude name="scala/actors/**"/> - <excludesfile name="${nsc.excludes.file}" if="excludes.avail"/> - </quick> - <echo - file="${optimised.dir}/lib/library/${lib.prop.name}" - message="version.number=${version.number}${line.separator}" - append="false" - /> - <echo - file="${optimised.dir}/lib/library/${lib.prop.name}" - message="copyright.string=${copyright.string}${line.separator}" - append="true" - /> - <!-- Build compiler --> - <mkdir dir="${optimised.dir}/lib/compiler"/> - <quick - srcdir="${src.dir}" - destdir="${optimised.dir}/lib/compiler" - optimise="yes" - addparams="${nsc.params}" target="${nsc.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="${optimised.dir}/lib/library"/> - <pathelement location="${optimised.dir}/lib/compiler"/> - <pathelement location="${fjbg.jar}"/> - <pathelement location="${msil.jar}"/> - <pathelement location="${ant.jar}"/> - <pathelement location="${jline.jar}"/> + <pathelement location="${build-pack.dir}/lib/scala-library.jar"/> + <pathelement location="${build-pack.dir}/lib/scala-compiler.jar"/> </classpath> - <include name="compiler/**/*.scala"/> - <include name="library/scala/List.scala"/> - <excludesfile name="${nsc.excludes.file}" if="excludes.avail"/> - </quick> - <echo - file="${optimised.dir}/lib/compiler/${comp.prop.name}" - message="version.number=${version.number}${line.separator}" - append="false" - /> - <echo - file="${optimised.dir}/lib/compiler/${comp.prop.name}" - message="copyright.string=${copyright.string}${line.separator}" - append="true" - /> - <!-- Timing the build --> - <stopwatch name="timer.strap" action="total"/> - <!-- Copy support files to build folder and links external libraries--> - <build.support build.dir="${optimised.dir}"/> - <build.links build.dir="${optimised.dir}"/> - <!-- Build executable files --> - <taskdef - name="straptool" - classname="scala.tools.ant.ScalaTool" - classpathref="quick.classpath"/> - <mkdir dir="${optimised.dir}/bin"/> - <straptool - file="${optimised.dir}/bin/${scala.exec.name}" + </taskdef> + <mkdir dir="${build-pack.dir}/bin"/> + <pack-bin + file="${build-pack.dir}/bin/scala" class="scala.tools.nsc.MainGenericRunner" javaFlags="${java.flags}"/> - <straptool - file="${optimised.dir}/bin/${scalac.exec.name}" + <pack-bin + file="${build-pack.dir}/bin/scalac" class="scala.tools.nsc.Main" javaFlags="${java.flags}"/> - <straptool - file="${optimised.dir}/bin/${scaladoc.exec.name}" + <pack-bin + file="${build-pack.dir}/bin/scaladoc" class="scala.tools.nsc.ScalaDoc" javaFlags="${java.flags}"/> - <straptool - file="${optimised.dir}/bin/${fsc.exec.name}" + <pack-bin + file="${build-pack.dir}/bin/fsc" class="scala.tools.nsc.CompileClient" javaFlags="${java.flags}"/> - <chmod perm="ugo+rx" - file="${optimised.dir}/bin/${scalac.exec.name}"/> - <chmod perm="ugo+rx" - file="${optimised.dir}/bin/${scala.exec.name}"/> - <chmod perm="ugo+rx" - file="${optimised.dir}/bin/${scaladoc.exec.name}"/> - <chmod perm="ugo+rx" - file="${optimised.dir}/bin/${fsc.exec.name}"/> - <fixcrlf - srcdir="${optimised.dir}/bin" - eol="dos" - includes="**/*.bat"/> + <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> + <!-- =========================================================================== -TEST +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="test" depends="test.stability, test.strap" - description="Tests the build for stability"/> - - <!-- Build the bootstrap layer --> - <target name="build.strap" depends="setup.quick"> - <stopwatch name="timer.strap"/> - <!-- Build library --> - <mkdir dir="${strap.dir}/lib/library"/> + <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="${strap.dir}/lib/library" - source="1.4" target="1.4" deprecation="yes" - classpath="${strap.dir}/lib/library" - includes="**/*.java"/> - <quick + 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="${strap.dir}/lib/library" - addparams="${nsc.params}" target="${nsc.target}" - deprecation="yes" unchecked="yes" - classpath="${strap.dir}/lib/library" - includes="scala/Predef.scala"/> - <quick + 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="${strap.dir}/lib/library" - addparams="${nsc.params}" target="${nsc.target}" - deprecation="yes" unchecked="yes" - classpath="${strap.dir}/lib/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"/> - <exclude name="scala/dbc/**"/> - <exclude name="scala/actors/**"/> - <excludesfile name="${nsc.excludes.file}" if="excludes.avail"/> - </quick> - <echo - file="${strap.dir}/lib/library/${lib.prop.name}" - message="version.number=${version.number}${line.separator}" - append="false" - /> - <echo - file="${strap.dir}/lib/library/${lib.prop.name}" - message="copyright.string=${copyright.string}${line.separator}" - append="true" - /> - <!-- Build DBC --> - <mkdir dir="${strap.dir}/lib/dbc"/> - <quick - srcdir="${src.dir}/dbc" - destdir="${strap.dir}/lib/dbc" - addparams="${nsc.params}" target="${nsc.target}" - deprecation="yes" unchecked="yes"> - <classpath> - <pathelement location="${strap.dir}/lib/library"/> - <pathelement location="${strap.dir}/lib/dbc"/> - </classpath> - <include name="scala/dbc/**/*.scala"/> - <excludesfile name="${nsc.excludes.file}" if="excludes.avail"/> - </quick> - <!-- Build actors library --> - <mkdir dir="${strap.dir}/lib/actors"/> - <javac - srcdir="${src.dir}/actors" - destdir="${strap.dir}/lib/actors" - source="1.4" target="1.4" deprecation="yes" - classpath="${strap.dir}/lib/actors" - includes="scala/actors/**/*.java"/> - <quick + </scalac> + <scalac srcdir="${src.dir}/actors" - destdir="${strap.dir}/lib/actors" - addparams="${nsc.params}" target="${nsc.target}"> - <classpath> - <pathelement location="${strap.dir}/lib/library"/> - <pathelement location="${strap.dir}/lib/actors"/> - </classpath> - <include name="scala/actors/**/*.scala"/> - <excludesfile name="${nsc.excludes.file}" if="excludes.avail"/> - </quick> - <!-- Build compiler --> - <mkdir dir="${strap.dir}/lib/compiler"/> - <quick + 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="${strap.dir}/lib/compiler" - addparams="${nsc.params}" target="${nsc.target}"> + destdir="${build-strap.dir}/classes/compiler" + target="jvm-1.5"> + <include name="**/*.scala"/> <classpath> - <pathelement location="${strap.dir}/lib/library"/> - <pathelement location="${strap.dir}/lib/compiler"/> + <pathelement location="${build-strap.dir}/classes/library"/> + <pathelement location="${build-strap.dir}/classes/compiler"/> <pathelement location="${fjbg.jar}"/> <pathelement location="${msil.jar}"/> - <pathelement location="${ant.jar}"/> <pathelement location="${jline.jar}"/> + <pathelement location="${ant.jar}"/> </classpath> - <include name="**/*.scala"/> - <excludesfile name="${nsc.excludes.file}" if="excludes.avail"/> - </quick> - <echo - file="${strap.dir}/lib/compiler/${comp.prop.name}" - message="version.number=${version.number}${line.separator}" - append="false" - /> - <echo - file="${strap.dir}/lib/compiler/${comp.prop.name}" - message="copyright.string=${copyright.string}${line.separator}" - append="true" - /> - <!-- Build partest --> - <mkdir dir="${strap.dir}/lib/partest"/> + </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="${strap.dir}/lib/partest" - source="1.4" target="1.4" deprecation="yes" - classpath="${strap.dir}/lib/partest" - includes="scala/tools/partest/**/*.java"/> - <quick + 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="${strap.dir}/lib/partest" - addparams="${nsc.params}" target="${nsc.target}" - deprecation="yes" unchecked="yes"> + destdir="${build-strap.dir}/classes/partest" + target="jvm-1.5"> + <include name="**/*.scala"/> <classpath> - <pathelement location="${strap.dir}/lib/library"/> - <pathelement location="${strap.dir}/lib/compiler"/> - <pathelement location="${strap.dir}/lib/actors"/> + <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> - </quick> - <echo - file="${strap.dir}/lib/partest/${par.prop.name}" - message="version.number=${version.number}${line.separator}" - append="false" - /> - <echo - file="${strap.dir}/lib/partest/${par.prop.name}" - message="copyright.string=${copyright.string}${line.separator}" - append="true" - /> - <!-- Timing the build --> - <stopwatch name="timer.strap" action="total"/> - <!-- Copy support files to build folder and links external libraries--> - <build.support build.dir="${strap.dir}"/> - <build.links build.dir="${strap.dir}"/> - <!-- Build executable files --> - <taskdef - name="straptool" - classname="scala.tools.ant.ScalaTool" - classpathref="quick.classpath"/> - <mkdir dir="${strap.dir}/bin"/> - <straptool - file="${strap.dir}/bin/${scala.exec.name}" - class="scala.tools.nsc.MainGenericRunner" - javaFlags="${java.flags}"/> - <straptool - file="${strap.dir}/bin/${scalac.exec.name}" - class="scala.tools.nsc.Main" - javaFlags="${java.flags}"/> - <straptool - file="${strap.dir}/bin/${scaladoc.exec.name}" - class="scala.tools.nsc.ScalaDoc" - javaFlags="${java.flags}"/> - <straptool - file="${strap.dir}/bin/${fsc.exec.name}" - class="scala.tools.nsc.CompileClient" - javaFlags="${java.flags}"/> - <chmod perm="ugo+rx" - file="${strap.dir}/bin/${scalac.exec.name}"/> - <chmod perm="ugo+rx" - file="${strap.dir}/bin/${scala.exec.name}"/> - <chmod perm="ugo+rx" - file="${strap.dir}/bin/${scaladoc.exec.name}"/> - <chmod perm="ugo+rx" - file="${strap.dir}/bin/${fsc.exec.name}"/> - <fixcrlf - srcdir="${strap.dir}/bin" - eol="dos" - includes="**/*.bat"/> - </target> - - <!-- Compares quick and test level --> - <target name="test.stability" depends="build.strap"> - <if><available file="${stability.tool}"/> - <then> <!-- use stability tool for fast checking --> - <exec executable="${stability.tool}" failonerror="true"> - <arg value="${quick.dir}"/> - <arg value="${strap.dir}"/> - </exec> - </then><else> <!-- check stability the slow way --> - <checksum totalproperty="quick.md5"> - <fileset dir="${quick.dir}/lib"> - <include name="library/**"/> - <include name="compiler/**"/> - </fileset> - </checksum> - <delete quiet="yes" failonerror="no"> - <fileset dir="${quick.dir}" includes="**/*.MD5"/> - </delete> - <checksum totalproperty="strap.md5"> - <fileset dir="${strap.dir}/lib"> - <include name="library/**"/> - <include name="compiler/**"/> + </scalac> + <copy todir="${build-strap.dir}/classes/partest"> + <fileset dir="${src.dir}/partest"> + <include name="**/*.xml"/> </fileset> - </checksum> - <delete quiet="yes" failonerror="no"> - <fileset dir="${strap.dir}" includes="**/*.MD5"/> - </delete> - <fail message="Build ${version.number} is not stable"> - <condition><not> - <equals arg1="${quick.md5}" arg2="${strap.md5}"/> - </not></condition> - </fail> - <echo level="info" message="Build ${version.number} is stable."/> - </else></if> + </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="test.strap" depends="build.strap"> - <echo level="info" message="Ant test bench is not available yet."/> + <target name="strap.clean"> + <delete dir="${build-strap.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/> </target> <!-- =========================================================================== DOCUMENTATION ============================================================================ --> - - <target name="docs" depends="setup.quick" - description="Generated the API for library sources"> - <mkdir dir="${api-lib.dir}"/> - <quickdoc - srcdir="${src.dir}" - destdir="${api-lib.dir}" - sourcepath="" - deprecation="yes" unchecked="yes" - windowtitle="Scala Library Documentation" - doctitle="<div>Scala ${version.number}<br/>API Specification</div>" - classpath="${quick.dir}/lib/library${path.separator}${quick.dir}/lib/actors"> - <include name="dbc/**/*.scala"/> - <include name="actors/**/*.scala"/> - <include name="library/**/*.scala"/> - <excludesfile name="${nsc.excludes.file}" if="excludes.avail"/> - </quickdoc> + + <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.compiler" depends="setup.quick" - description="Generated the API for compiler sources"> - <mkdir dir="${api-comp.dir}"/> - <quickdoc - srcdir="${src.dir}/compiler" - destdir="${api-comp.dir}" - sourcepath="" - windowtitle="Scala Compiler Documentation" - doctitle="<div>Scala ${version.number}<br/>API Specification</div>"> - <classpath> - <pathelement location="${quick.dir}/lib/library"/> - <pathelement location="${quick.dir}/lib/compiler"/> - <pathelement location="${fjbg.jar}"/> - <pathelement location="${msil.jar}"/> - <pathelement location="${ant.jar}"/> - <pathelement location="${jline.jar}"/> - </classpath> + <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"/> - <excludesfile name="${nsc.excludes.file}" if="excludes.avail"/> - </quickdoc> + <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-comp" depends="docs.lib"> + <uptodate property="docs.comp.available" targetfile="${build-docs.dir}/compiler.complete"> + <srcfiles dir="${src.dir}/compiler"/> + </uptodate> </target> - <target name="docs.manual" depends="setup.quick" - description="Generated the manual for the Scala tools"> - <mkdir dir="${tooldocs.dir}/classes"/> - <path id="manual.classpath"> - <pathelement location="${quick.dir}/lib/library"/> - <pathelement location="${tooldocs.dir}/classes"/> - </path> - <quick - srcdir="${src.dir}/manual" - destdir="${tooldocs.dir}/classes" - addparams="${nsc.params}" target="${nsc.target}" - deprecation="yes" unchecked="yes" - classpathref="manual.classpath"> + <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"/> - </quick> - <emit command="fsc"/> - <emit command="sbaz"/> - <emit command="scala"/> - <emit command="scalac"/> - <emit command="scaladoc"/> - <emit command="scalap"/> - <fixcrlf srcdir="${tooldocs.dir}" eol="unix" includes="**/*.1"/> - <copy todir="${tooldocs.dir}"> - <fileset dir="${src.dir}/manual/scala/tools/docutil/resources"> - <include name="**/*.html"/> - <include name="**/*.css"/> - <include name="**/*.gif"/> - <include name="**/*.png"/> - </fileset> - </copy> + </scaladoc> + <touch file="${build-docs.dir}/compiler.complete" verbose="no"/> + <stopwatch name="docs.comp.timer" action="total"/> </target> + + <target name="docs.done" depends="docs.lib"/> - <macrodef name="emit"> - <attribute name="command"/> - <sequential> - <java classname="scala.tools.docutil.EmitHtml" - output="${tooldocs.dir}/@{command}.html" - classpathref="manual.classpath" - fork="true" logError="yes" - > - <arg value="scala.man1.@{command}"/> - </java> - <java classname="scala.tools.docutil.EmitManPage" - output="${tooldocs.dir}/@{command}.1" - classpathref="manual.classpath" - fork="true" logError="yes" - > - <arg value="scala.man1.@{command}"/> - </java> - </sequential> - </macrodef> - + <target name="docs.clean"> + <delete dir="${build-docs.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/> + </target> + <!-- =========================================================================== -GENERATES A DISTRIBUTION +BOOTRAPING TEST AND TEST SUITE ============================================================================ --> - - <target name="dist.devel" depends="init"> - <property file="${number.file}"/> - <property name="version.number" - value="${version.major}.${version.minor}.${version.patch}.r${svn.number}"/> - <runtarget target="pack"/> + + <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="dist.patch" depends="init"> - <property file="${number.file}"/> - <property name="version.number" - value="${version.major}.${version.minor}.${version.patch}.${version.suffix}"/> - <runtarget target="pack"/> + <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"/> - <target name="dist.minor" depends="init"> - <property file="${number.file}"/> - <property name="version.number" - value="${version.major}.${version.minor}.${version.patch}.${version.suffix}"/> - <runtarget target="pack"/> +<!-- =========================================================================== +DISTRIBUTION +============================================================================ --> + + <target name="dist.start" depends="docs.done, pack.done"> + <property name="dist.dir" value="${dists.dir}/scala-${version.number}"/> </target> - - <target name="dist" - depends="clean.build, test, build.dist" - description="Creates a (stability-)tested, complete Scala distribution *from scratch*"/> - - <target name="pack" - depends="build.archive, build.sbaz" - description="Packs a distribution for SBaz and ZIP/TAR"/> - - <target name="binaries" - depends="setup, build.strap" - description="Creates a binary Scala distribution"> - <property name="dist.current.dir" - value="${dist.dir}/scala-${version.number}"/> - <if><and> - <isset property="os.unix"/> - <isset property="dist.resource"/></and> - <then> - <symlink - link="${dist.dir}" - resource="${dist.resource}" overwrite="yes" failonerror="no"/> - <touch file="${dist.dir}/is_symlink" verbose="no"/> - </then></if> - <mkdir dir="${dist.current.dir}"/> - <!-- Copy all requires libraries --> - <mkdir dir="${dist.current.dir}/lib"/> - <property name="ant.version.number" value="1.6.0"/> - <!-- see http://swik.net/Spring/Interface21+Team+Blog/Creating+OSGi+bundles/b2yoy --> - <propertyregex - property="osgi.version.number" input="${version.number}" - regexp="([^-]*)(-.*)?" select="\1" - /> - <echo level="verbose" message="OSGi version: ${osgi.version.number}"/> - <jar destfile="${dist.current.dir}/lib/${comp.jar.name}"> - <fileset dir="${strap.dir}/lib/compiler"/> - <zipfileset src="${fjbg.jar}"/> - <zipfileset src="${msil.jar}"/> - <manifest> - <attribute name="Signature-Version" value="${version.number}"/> - <attribute name="Built-By" value="${user.name}"/> - <attribute name="Main-Class" value="scala.tools.nsc.Main"/> - <attribute name="Class-Path" value="${lib.jar.name}"/> - <section name="scala/tools/nsc"> - <attribute name="Extension-Name" value="scala.tools.nsc"/> - <attribute name="Specification-Title" value="Scala Compiler"/> - <attribute name="Specification-Version" value="${version.number}"/> - <attribute name="Specification-Vendor" value="${vendor.name}"/> - <attribute name="Implementation-Title" value="scala.tools.nsc"/> - <attribute name="Implementation-Version" value="${version.number}"/> - <attribute name="Implementation-Vendor" value="${vendor.name}"/> - </section> - <attribute name="Bundle-DocURL" value="http://www.scala-lang.org/"/> - <attribute name="Bundle-ManifestVersion" value="2"/> - <attribute name="Bundle-Name" value="Scala Compiler Bundle"/> - <attribute name="Bundle-SymbolicName" value="scala_compiler"/> - <attribute name="Bundle-Version" value="${osgi.version.number}"/> - <attribute name="Bundle-Vendor" value="${vendor.name}"/> - <attribute name="Export-Package" value="scala.tools.ant;version="${osgi.version.number}",scala.tools.nsc;version="${osgi.version.number}",scala.tools.nsc.ast;version="${osgi.version.number}",scala.tools.nsc.ast.parser;version="${osgi.version.number}",scala.tools.nsc.backend;version="${osgi.version.number}",scala.tools.nsc.doc;version="${osgi.version.number}",scala.tools.nsc.io;version="${osgi.version.number}",scala.tools.nsc.matching;version="${osgi.version.number}",scala.tools.nsc.models;version="${osgi.version.number}",scala.tools.nsc.symtab;version="${osgi.version.number}",scala.tools.nsc.symtab.classfile;version="${osgi.version.number}",scala.tools.nsc.symtab.clr;version="${osgi.version.number}",scala.tools.nsc.transform;version="${osgi.version.number}",scala.tools.nsc.typechecker;version="${osgi.version.number}",scala.tools.nsc.util;version="${osgi.version.number}",scala.tools.util;version="${osgi.version.number}""/> - <attribute name="Import-Package" value="org.apache.ant.tools;version="${ant.version.number}";resolution:=optional,org.apache.ant.tools.taskdefs;version="${ant.version.number}";resolution:=optional,org.apache.ant.types;version="${ant.version.number}";resolution:=optional,org.apache.ant.tools.util;version="${ant.version.number}";resolution:=optional,org.xml.sax"/> - <attribute name="Bundle-RequiredExecutionEnvironment" value="J2SE-1.4"/> - </manifest> - </jar> - <jar destfile="${dist.current.dir}/lib/${lib.jar.name}"> - <fileset dir="${strap.dir}/lib/library"/> - <fileset dir="${strap.dir}/lib/actors"/> - <manifest> - <attribute name="Signature-Version" value="${version.number}"/> - <attribute name="Built-By" value="${user.name}"/> - <attribute name="Main-Class" value="scala.util.Properties"/> - <section name="scala"> - <attribute name="Extension-Name" value="scala"/> - <attribute name="Specification-Title" value="Scala Library"/> - <attribute name="Specification-Version" value="${version.number}"/> - <attribute name="Specification-Vendor" value="${vendor.name}"/> - <attribute name="Implementation-Title" value="scala"/> - <attribute name="Implementation-Version" value="${version.number}"/> - <attribute name="Implementation-Vendor" value="${vendor.name}"/> - </section> - <attribute name="Bundle-DocURL" value="http://www.scala-lang.org/"/> - <attribute name="Bundle-ManifestVersion" value="2"/> - <attribute name="Bundle-Name" value="Scala Library Bundle"/> - <attribute name="Bundle-SymbolicName" value="scala_library"/> - <attribute name="Bundle-Version" value="${osgi.version.number}"/> - <attribute name="Bundle-Vendor" value="${vendor.name}"/> - <attribute name="Export-Package" value="scala;version="${osgi.version.number}",scala.actors;version="${osgi.version.number}",scala.actors.remote;version="${osgi.version.number}",scala.collection;version="${osgi.version.number}",scala.collection.immutable;version="${osgi.version.number}",scala.collection.jcl;version="${osgi.version.number}",scala.collection.mutable;version="${osgi.version.number}",scala.compat;version="${osgi.version.number}",scala.concurrent;version="${osgi.version.number}",scala.io;version="${osgi.version.number}",scala.mobile;version="${osgi.version.number}",scala.ref;version="${osgi.version.number}",scala.reflect;version="${osgi.version.number}",scala.runtime;version="${osgi.version.number}",scala.testing;version="${osgi.version.number}",scala.text;version="${osgi.version.number}",scala.util;version="${osgi.version.number}",scala.util.automata;version="${osgi.version.number}",scala.util.grammar;version="${osgi.version.number}",scala.util.logging;version="${osgi.version.number}",scala.util.parsing;version="${osgi.version.number}",scala.util.parsing.ast;version="${osgi.version.number}",scala.util.parsing.combinator;version="${osgi.version.number}",scala.util.parsing.combinator.lexical;version="${osgi.version.number}",scala.util.parsing.combinator.syntactical;version="${osgi.version.number}",scala.util.parsing.combinator.testing;version="${osgi.version.number}",scala.util.parsing.combinatorold;version="${osgi.version.number}",scala.util.parsing.combinatorold.lexical;version="${osgi.version.number}",scala.util.parsing.combinatorold.syntactical;version="${osgi.version.number}",scala.util.parsing.combinatorold.testing;version="${osgi.version.number}",scala.util.parsing.input;version="${osgi.version.number}",scala.util.parsing.json;version="${osgi.version.number}",scala.util.parsing.syntax;version="${osgi.version.number}",scala.util.regexp;version="${osgi.version.number}",scala.xml;version="${osgi.version.number}",scala.xml.dtd;version="${osgi.version.number}",scala.xml.factory;version="${osgi.version.number}",scala.xml.parsing;version="${osgi.version.number}",scala.xml.path;version="${osgi.version.number}",scala.xml.pull;version="${osgi.version.number}",scala.xml.transform;version="${osgi.version.number}""/> - <attribute name="Import-Package" value="javax.xml.parsers,org.xml.sax,org.xml.sax.helpers"/> - <attribute name="Bundle-RequiredExecutionEnvironment" value="J2SE-1.4"/> - </manifest> - </jar> - <jar destfile="${dist.current.dir}/lib/${dbc.jar.name}"> - <fileset dir="${strap.dir}/lib/dbc"/> - <manifest> - <attribute name="Signature-Version" value="${version.number}"/> - <attribute name="Built-By" value="${user.name}"/> - <attribute name="Class-Path" value="${lib.jar.name}"/> - <section name="scala/dbc"> - <attribute name="Extension-Name" value="scala.dbc"/> - <attribute name="Specification-Title" value="Scala DBC Library"/> - <attribute name="Specification-Version" value="${version.number}"/> - <attribute name="Specification-Vendor" value="${vendor.name}"/> - <attribute name="Implementation-Title" value="scala.dbc"/> - <attribute name="Implementation-Version" value="${version.number}"/> - <attribute name="Implementation-Vendor" value="${vendor.name}"/> - </section> - <attribute name="Bundle-DocURL" value="http://www.scala-lang.org/"/> - <attribute name="Bundle-ManifestVersion" value="2"/> - <attribute name="Bundle-Name" value="Scala DBC Library Bundle"/> - <attribute name="Bundle-SymbolicName" value="scala_dbc_library"/> - <attribute name="Bundle-Version" value="${osgi.version.number}"/> - <attribute name="Bundle-Vendor" value="${vendor.name}"/> - <attribute name="Export-Package" value="scala.dbc;version="${osgi.version.number}",scala.dbc.datatype;version="${osgi.version.number}",scala.dbc.exception;version="${osgi.version.number}",scala.dbc.result;version="${osgi.version.number}",scala.dbc.statement;version="${osgi.version.number}",scala.dbc.statement.expression;version="${osgi.version.number}",scala.dbc.syntax;version="${osgi.version.number}",scala.dbc.value;version="${osgi.version.number}",scala.dbc.vendor;version="${osgi.version.number}""/> - <attribute name="Import-Package" value="scala;version="${osgi.version.number}",scala.compat;version="${osgi.version.number}""/> - <attribute name="Bundle-RequiredExecutionEnvironment" value="J2SE-1.4"/> - </manifest> - </jar> - <jar destfile="${dist.current.dir}/lib/${partest.jar.name}"> - <fileset dir="${strap.dir}/lib/partest"/> - <manifest> - <attribute name="Signature-Version" value="${version.number}"/> - <attribute name="Built-By" value="${user.name}"/> - <attribute name="Main-Class" value="scala.tools.partest.TestRunner"/> - <attribute name="Class-Path" value="${lib.jar.name}"/> - <section name="scala/tools/partest"> - <attribute name="Extension-Name" value="scala.tools.partest"/> - <attribute name="Specification-Title" value="Scala Test Utility"/> - <attribute name="Specification-Version" value="${version.number}"/> - <attribute name="Specification-Vendor" value="${vendor.name}"/> - <attribute name="Implementation-Title" value="scala.tools.partest"/> - <attribute name="Implementation-Version" value="${version.number}"/> - <attribute name="Implementation-Vendor" value="${vendor.name}"/> - </section> - <attribute name="Bundle-DocURL" value="http://www.scala-lang.org/"/> - <attribute name="Bundle-ManifestVersion" value="2"/> - <attribute name="Bundle-Name" value="Scala Test Bundle"/> - <attribute name="Bundle-SymbolicName" value="scala_compiler"/> - <attribute name="Bundle-Version" value="${osgi.version.number}"/> - <attribute name="Bundle-Vendor" value="${vendor.name}"/> - <attribute name="Export-Package" value="scala.tools.partest;version="${osgi.version.number}",scala.tools.partest.utils;version="${osgi.version.number}""/> - <attribute name="Import-Package" value="javax.swing"/> - <attribute name="Bundle-RequiredExecutionEnvironment" value="J2SE-1.4"/> - </manifest> - </jar> - <copy todir="${dist.current.dir}/lib" file="${jline.jar}"/> - - <!-- build source jars --> - <mkdir dir="${dist.current.dir}/src"/> - <jar - destfile="${dist.current.dir}/src/${libsrc.jar.name}"> - <fileset dir="${src.dir}/library"/> - <fileset dir="${src.dir}/actors"/> - </jar> - <jar - destfile="${dist.current.dir}/src/${dbcsrc.jar.name}" - basedir="${src.dir}/dbc" - includes="**/*.scala" - /> - <jar - destfile="${dist.current.dir}/src/${parsrc.jar.name}" - basedir="${src.dir}/partest" - includes="**/*.scala" - /> - <jar - destfile="${dist.current.dir}/src/${compsrc.jar.name}" - basedir="${src.dir}/compiler" - includes="**/*.scala" - /> - - <!-- Copy executable files --> - <mkdir dir="${dist.current.dir}/bin"/> - <copy todir="${dist.current.dir}/bin"> - <fileset dir="${strap.dir}/bin"/> + + <target name="dist.base" depends="dist.start"> + <mkdir dir="${dist.dir}/lib"/> + <copy toDir="${dist.dir}/lib"> + <fileset dir="${build-pack.dir}/lib"/> </copy> - <chmod perm="ugo+rx" file="${dist.current.dir}/bin/${scalac.exec.name}"/> - <chmod perm="ugo+rx" file="${dist.current.dir}/bin/${scala.exec.name}"/> - <chmod perm="ugo+rx" file="${dist.current.dir}/bin/${scaladoc.exec.name}"/> - <chmod perm="ugo+rx" file="${dist.current.dir}/bin/${fsc.exec.name}"/> - <!-- Recreate the 'latest' link to point to this distribution --> - <if><isset property="os.win"/> - <then> - <copy todir="${dist.dir}/latest"> - <fileset dir="${dist.current.dir}"/> - </copy> - </then> - <else> - <symlink - link="${dist.dir}/latest" - resource="${dist.current.dir}" - overwrite="yes" failonerror="no"/> - </else> - </if> - </target> - - <target name="build.dist" - depends="binaries,docs,docs.manual" - description="Creates the latest Scala distribution"> - <!-- Copy the API, examples and man --> - <copy todir="${dist.current.dir}/doc/scala"> - <fileset dir="${docs.dir}" includes="README,LICENSE"/> + <mkdir dir="${dist.dir}/bin"/> + <copy toDir="${dist.dir}/bin"> + <fileset dir="${build-pack.dir}/bin"/> </copy> - <copy todir="${dist.current.dir}/doc/scala/api"> - <fileset dir="${api-lib.dir}"/> + <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.doc" depends="dist.base"> + <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> - <copy todir="${dist.current.dir}/doc/scala/examples"> + <mkdir dir="${dist.dir}/doc/scala/examples"/> + <copy toDir="${dist.dir}/doc/scala/examples"> <fileset dir="${docs.dir}/examples"/> </copy> - <copy todir="${dist.current.dir}/man/man1"> - <fileset dir="${tooldocs.dir}" includes="**/*.1"/> - </copy> - <copy todir="${dist.current.dir}/doc/scala/tools"> - <fileset dir="${tooldocs.dir}"> - <include name="**/*.html"/> - <include name="**/*.css"/> - <include name="**/*.gif"/> - <include name="**/*.png"/> - </fileset> + </target> + + <target name="dist.man" depends="dist.doc"> + <mkdir dir="${dist.dir}/man"/> + <copy toDir="${dist.dir}/man"> + <fileset dir="${docs.dir}/man"/> </copy> - <stopwatch name="timer.dist" action="total"/> </target> - - <!-- Create the SBaz packages --> - <target name="build.sbaz" depends="build.dist,msil,android"> - <property name="sbaz.universe" value="http://www.scala-lang.org/downloads/packages"/> - <mkdir dir="${dist.dir}"/> - <!-- Create the Scala library package --> - <quicksbaz - file="${dist.dir}/scala-library-${version.number}.sbp" - adfile="${dist.dir}/scala-library-${version.number}.advert" - name="scala-library" - version="${version.number}" - desc="The Scala library. This is the minimal requirement to run any Scala program." - link="${sbaz.universe}/scala-library-${version.number}.sbp"> - <libset dir="${dist.current.dir}/lib" includes="${lib.jar.name},${dbc.jar.name}"/> - <srcset dir="${dist.current.dir}/src" includes="${libsrc.jar.name},${dbcsrc.jar.name}"/> - </quicksbaz> - <!-- Create the Scala developer package --> - <quicksbaz - file="${dist.dir}/scala-devel-${version.number}.sbp" - adfile="${dist.dir}/scala-devel-${version.number}.advert" - name="scala-devel" - version="${version.number}" - desc="The Scala developer tools. This contains everything that is required to write, test and document new Scala programs." - depends="scala-library" - link="${sbaz.universe}/scala-devel-${version.number}.sbp"> - <binset dir="${dist.current.dir}/bin" includes="**"/> - <docset dir="${dist.current.dir}/doc" includes="**" excludes="**/scala/api/**,**/scala/tools/**"/> - <libset dir="${dist.current.dir}/lib" includes="${comp.jar.name},${jline.jar.name}"/> - <manset dir="${dist.current.dir}/man" includes="**"/> - <srcset dir="${dist.current.dir}/src" includes="${compsrc.jar.name}"/> - </quicksbaz> - <!-- Create the Scala developer docs package --> - <quicksbaz - file="${dist.dir}/scala-devel-docs-${version.number}.sbp" - adfile="${dist.dir}/scala-devel-docs-${version.number}.advert" - name="scala-devel-docs" - version="${version.number}" - desc="The Scala developer documentation. This contains all developer documentation." - link="${sbaz.universe}/scala-devel-docs-${version.number}.sbp"> - <docset dir="${dist.current.dir}/doc" includes="**/scala/api/**,**/scala/tools/**"/> - </quicksbaz> - <!-- Creates the empty umbrella Scala package --> - <quicksbaz - file="${dist.dir}/scala-${version.number}.sbp" - adfile="${dist.dir}/scala-${version.number}.advert" - name="scala" - version="${version.number}" - desc="The base Scala package that contains everything needed to start using Scala." - depends="scala-library,scala-devel" - link="${sbaz.universe}/scala-${version.number}.sbp"/> - <!-- Creates the Scala test package --> - <quicksbaz - file="${dist.dir}/scala-test-${version.number}.sbp" - adfile="${dist.dir}/scala-test-${version.number}.advert" - name="scala-test" - version="${version.number}" - desc="The Scala test package contains everything needed to test Scala." - link="${sbaz.universe}/scala-test-${version.number}.sbp"> - <binset dir="${basedir}/test" - includes="clitest,diff/diff.*,diff/lib*.dll,scalatest,scalatest.bat,partest"/> - <miscset - dir="${basedir}/test" - includes="files/**/*.args,files/**/*.check,files/**/*.jar,files/**/*.java,files/**/*.scala,files/cli/**/*.check.*,files/jvm/*.so,files/shootout/*.javaopts,files/shootout/*.runner,files/shootout/*.txt"/> - <srcset dir="${dist.current.dir}/src" includes="${parsrc.jar.name}"/> - <libset dir="${dist.current.dir}/lib" includes="${partest.jar.name}"/> - </quicksbaz> - <!-- Creates the MSIL package --> - <quicksbaz - file="${dist.dir}/scala-msil-${version.number}.sbp" - adfile="${dist.dir}/scala-msil-${version.number}.advert" - name="scala-msil" - version="${version.number}" - desc="The Scala MSIL package contains everything needed to use Scala on .NET." - depends="scala-library,scala-devel" - link="${sbaz.universe}/scala-msil-${version.number}.sbp"> - <binset dir="${quick.dir}/bin" includes="scala*net*"/> - <libset dir="${quick.dir}/lib" includes="*.dll"/> - </quicksbaz> - <!-- Creates the CLDC package --> -<!-- - <quicksbaz - file="${dist.dir}/scala-cldc-${version.number}.sbp" - adfile="${dist.dir}/scala-cldc-${version.number}.advert" - name="scala-cldc" - version="${version.number}" - desc="The Scala CLDC package contains everything needed to use Scala on CLDC devices." - link="${sbaz.universe}/scala-cldc-${version.number}.sbp"> - <libset dir="${cldc.dir}/lib" includes="*.jar"/> - </quicksbaz> ---> - <!-- Creates the Android package --> - <if><isset property="android.supported"/><then> - <copy todir="${dist.current.dir}/doc/scala-android/examples"> - <fileset dir="${docs.dir}/android-examples"> - <exclude name="**/R.java"/> - </fileset> - </copy> - <quicksbaz - file="${dist.dir}/scala-android-${version.number}.sbp" - adfile="${dist.dir}/scala-android-${version.number}.advert" - name="scala-android" - version="${version.number}" - desc="The Scala Android package contains everything needed to use Scala on Android." - link="${sbaz.universe}/scala-android-${version.number}.sbp"> - <libset dir="${android.dir}/lib" includes="*.jar"/> - <docset dir="${dist.current.dir}/doc/scala-android" includes="**"/> - </quicksbaz> - </then></if> + + <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.latest" depends="dist.src" unless="os.win"> + <symlink link="${dists.dir}/latest" resource="${dist.dir}" overwrite="yes"/> + </target> + + <target name="dist.done" depends="dist.latest"/> - <target name="build.archive" depends="build.dist"> - <tar - destfile="${dist.dir}/scala-${version.number}.tgz" - compression="gzip"> - <tarfileset - prefix="scala-${version.number}" - dir="${dist.current.dir}" - includes="bin/**" mode="755" - /> - <tarfileset - prefix="scala-${version.number}" - dir="${dist.current.dir}" - excludes="bin/**" - /> - </tar> - <checksum - file="${dist.dir}/scala-${version.number}.tgz" - forceOverwrite="yes" - fileext=".md5"/> - <!-- Create zip archive --> - <zip - destfile="${dist.dir}/scala-${version.number}.zip"> - <zipfileset - prefix="scala-${version.number}" - dir="${dist.current.dir}" - /> - </zip> - <checksum - file="${dist.dir}/scala-${version.number}.zip" - forceOverwrite="yes" - fileext=".md5"/> - <!-- Create source archive --> - <copy todir="${dist.dir}/scala-${version.number}"> - <fileset - dir="${basedir}" - excludes="build,build/**,dists/**" - /> - </copy> - <tar basedir="${dist.dir}" - destfile="${dist.dir}/scala-${version.number}-sources.tgz" - compression="gzip" - includes="scala-${version.number}/**" - /> + <target name="dist.clean"> + <delete dir="${dists.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/> </target> <!-- =========================================================================== -CLEAN +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"/> - <macrodef name="remove"> - <attribute name="dir"/> - <sequential> - <if> - <available file="@{dir}/is_symlink"/> - <then> - <delete includeemptydirs="true" quiet="yes" failonerror="no"> - <fileset dir="@{dir}" includes="**/*"/> - </delete> - </then></if> - <delete dir="@{dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/> - </sequential> - </macrodef> - - <target name="clean" depends="ant-init" description="Removes QUICK, STRAP and API build products"> - <remove dir="${quick.dir}"/> - <remove dir="${strap.dir}"/> - <remove dir="${api.dir}"/> +<!-- =========================================================================== +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="clean.build" depends="ant-init" - description="Removes all build products"> - <remove dir="${build.dir}"/> + + <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"/> - <target name="clean.msil" depends="ant-init" description="Removes all MSIL build products"> - <remove dir="${msil.dir}"/> +<!-- =========================================================================== +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.build" inheritall="yes" inheritrefs="yes"/> + </target> + + <target name="msilclean"> + <ant antfile="${src.dir}/build/msil.xml" target="msil.clean" inheritall="yes" inheritrefs="yes"/> </target> -<!-- - <target name="clean.cldc" depends="ant-init" description="Removes all CLDC build products"> - <remove dir="${cldc.dir}"/> +<!-- =========================================================================== +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="fourdist"> + <ant antfile="${src.dir}/build/pack.xml" target="fourpack-all.done" inheritall="yes" inheritrefs="yes"/> </target> ---> - <target name="clean.all" depends="ant-init" - description="Removes all build products and distributions"> - <remove dir="${build.dir}"/> - <remove dir="${dist.dir}"/> +<!-- =========================================================================== +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="msilnightly"/> - <target name="clean.unfreeze" depends="init"> - <delete file="${locker.dir}/complete" quiet="yes" failonerror="no"/> - <remove dir="${quick.dir}"/> +<!-- =========================================================================== +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> |