summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Dubochet <gilles.dubochet@epfl.ch>2005-10-10 17:25:44 +0000
committerGilles Dubochet <gilles.dubochet@epfl.ch>2005-10-10 17:25:44 +0000
commit20af4df51a6393718744c20131db8fca6a938c44 (patch)
tree7b8d66208e71388c60fb29596934cd3e20be681c
parent013bdae337f4c9203ede6fbf3a4e070eb05d0ba9 (diff)
downloadscala-20af4df51a6393718744c20131db8fca6a938c44.tar.gz
scala-20af4df51a6393718744c20131db8fca6a938c44.tar.bz2
scala-20af4df51a6393718744c20131db8fca6a938c44.zip
The new build system in pure Ant.
-rw-r--r--build.properties17
-rw-r--r--build.support/build.default37
-rw-r--r--build.xml279
-rw-r--r--config/excludes/nsc.nslib.excludes3
-rw-r--r--config/excludes/nsc.nstools.excludes3
5 files changed, 339 insertions, 0 deletions
diff --git a/build.properties b/build.properties
new file mode 100644
index 0000000000..fae9e5f2ef
--- /dev/null
+++ b/build.properties
@@ -0,0 +1,17 @@
+# The path to the old Scala library.
+oslib.jar=/Developer/Scala/Latest/lib/scala.jar
+
+# The path to the old Scala tools.
+ostools.jar=/Developer/Scala/Latest/lib/tools.jar
+
+# The path to the Jaco/Pico compiler.
+jaco.jar=/Users/dubochet/Documents/Jaco/distrib/pizza/lib/jaco.jar
+
+# The path to the FJBG byte-code generation library.
+fjbg.jar=/Developer/Scala/Stable/lib/fjbg.jar
+
+# The path to the MSIL byte-code generation library.
+msil.jar=/Developer/Scala/MSIL/msil.jar
+
+# Other custom properties come here
+nsc.skip=jvm \ No newline at end of file
diff --git a/build.support/build.default b/build.support/build.default
new file mode 100644
index 0000000000..e3511aa4c2
--- /dev/null
+++ b/build.support/build.default
@@ -0,0 +1,37 @@
+# These are the default properties for the Scala build script.
+
+# DO NOT CHANGE THIS FILE! Changes should be made in the
+# 'build.properties' file, that will override the properties in
+# this file.
+
+nsc.logging=none
+nsc.stop=
+nsc.skip=
+nsc.check=
+nsc.nslib.excludes=${basedir}/build.support/nsc.nslib.excludes
+nsc.nstools.excludes=${basedir}/build.support/nsc.nstools.excludes
+
+oslib.jar=/usr/local/lib/scala.jar
+ostools.jar=/usr/local/lib/tools.jar
+jaco.jar=/usr/local/lib/jaco.jar
+fjbg.jar=/usr/local/lib/fjbg.jar
+msil.jar=/usr/local/lib/msil.jar
+java.jar=${java.home}/jre/lib/rt.jar
+
+ant.jar=${ant.home}/lib/ant.jar
+
+sources.dir=${basedir}/sources
+newsources.dir=${basedir}/newsources
+
+build.dir=${basedir}/build
+build.nslib.dir=${build.dir}/nslib
+build.osc-nstools.dir=${build.dir}/osc-nstools
+build.nstools.dir=${build.dir}/nstools
+build.oslib.dir=${build.dir}/oslib
+build.ostools.dir=${build.dir}/ostools
+distrib.dir=${basedir}/dist
+distrib.current.prefix=nscala
+
+distrib.nslib.jar=nslib.jar
+distrib.nstools.jar=nstools.jar
+distrib.osc-nstools.jar=osc-nstools.jar \ No newline at end of file
diff --git a/build.xml b/build.xml
new file mode 100644
index 0000000000..ae512d8218
--- /dev/null
+++ b/build.xml
@@ -0,0 +1,279 @@
+<?xml version="1.0"?>
+<project name="nsc" default="help">
+
+ <description>This build-file builds the Scala NSC compiler as well as various related tools. The 'build.properties' file must be customised for your own particular system, no other customisation should be required. The build file expects the file structure of a Scala CVS distribution.</description>
+
+ <!-- The system classpath should not be used -->
+ <property name="build.sysclasspath" value="ignore"/>
+
+ <!-- Sets project's properties -->
+ <!-- Properties in 'build.properties' take precedence over properties in 'build.default.properties' -->
+ <property file="${basedir}/build.properties"/>
+ <property file="${basedir}/build.support/build.default"/>
+
+ <!-- A path containing pre-compiled Scala libraries found typically in a scala distribution -->
+ <path id="osc.classpath">
+ <pathelement location="${oslib.jar}"/>
+ <pathelement location="${ostools.jar}"/>
+ <pathelement location="${fjbg.jar}"/>
+ <pathelement location="${msil.jar}"/>
+ </path>
+
+ <!-- A path containing the Pico library -->
+ <path id="pico.classpath">
+ <pathelement location="${jaco.jar}"/>
+ </path>
+
+ <target name="all" description="Builds and tests everything; creates a distribution."/>
+
+ <!--
+ #####################################################################
+ INIT
+ #####################################################################
+ -->
+
+ <target name="init.osc">
+ <echo level="verbose">oslib.jar=${oslib.jar}</echo>
+ <echo level="verbose">ostools.jar=${ostools.jar}</echo>
+ <echo level="verbose">fjbg.jar=${fjbg.jar}</echo>
+ <echo level="verbose">msil.jar=${msil.jar}</echo>
+ <fail message="Required classes for OSC are missing; check the 'oslib.jar', 'ostools.jar', 'fjbg.jar' and 'msil.jar' properties in 'build.properties'.">
+ <condition><not><and>
+ <available classname="scala.List" classpathref="osc.classpath"/>
+ <available classname="scala.runtime.RunTime" classpathref="osc.classpath"/>
+ <available classname="scala.tools.scalac.Main" classpathref="osc.classpath"/>
+ <available classname="scala.tools.scalac.ant.Scalac" classpathref="osc.classpath"/>
+ <available classname="ch.epfl.lamp.fjbg.JField" classpathref="osc.classpath"/>
+ <available classname="ch.epfl.lamp.util.ByteArray" classpathref="osc.classpath"/>
+ <available classname="ch.epfl.lamp.compiler.msil.Module" classpathref="osc.classpath"/>
+ <available classname="ch.epfl.lamp.compiler.msil.Type" classpathref="osc.classpath"/>
+ </and></not></condition>
+ </fail>
+ <taskdef name="osc" classname="scala.tools.scalac.ant.Scalac" classpathref="osc.classpath"/>
+ </target>
+
+ <target name="init.nsc" depends="build.osc.nstools, build.pico.nslib">
+ <taskdef name="nsc" classname="scala.tools.nsc.ant.NSC$class">
+ <classpath>
+ <pathelement location="${build.osc-nstools.dir}"/>
+ <pathelement location="${build.nslib.dir}"/>
+ <pathelement location="${oslib.jar}"/>
+ <pathelement location="${fjbg.jar}"/>
+ <pathelement location="${msil.jar}"/>
+ </classpath>
+ </taskdef>
+ </target>
+
+ <target name="init.pico">
+ <echo level="verbose">jaco.jar=${jaco.jar}</echo>
+ <fail message="Required classes for PiCo are missing; check the 'jaco.jar' property in 'build.properties'.">
+ <condition><not><and>
+ <available classname="jaco.pizza.Main" classpathref="pico.classpath"/>
+ <available classname="jaco.pizza.ant.Pico" classpathref="pico.classpath"/>
+ </and></not></condition>
+ </fail>
+ <taskdef name="pico" classname="jaco.pizza.ant.Pico" classpathref="pico.classpath"/>
+ </target>
+
+ <!--
+ #####################################################################
+ BUILD
+ #####################################################################
+ -->
+
+ <target name="build" depends="build.nsc.nstools" description="Builds new Scala (compiler and library)."/>
+
+ <target name="build.pico.nslib" depends="init.pico" description="Builds the runtime and pico libraries of the new Scala library.">
+ <mkdir dir="${build.nslib.dir}"/>
+ <pico srcdir="${sources.dir}" destdir="${build.nslib.dir}" scalahack="true">
+ <classpath>
+ <pathelement location="${build.osc-nstools.dir}"/>
+ </classpath>
+ <include name="scala/runtime/*.java"/>
+ <include name="scala/runtime/**/*.java"/>
+ <include name="scala/tools/util/*.java"/>
+ <include name="scala/*.java"/>
+ <exclude name="scala/ScalaObject.java"/>
+ <exclude name="scala/Array.java"/>
+ </pico>
+ <delete file="${build.nslib.dir}/scala/ScalaObject.class"/>
+ <delete file="${build.nslib.dir}/scala/Array.class"/>
+ </target>
+
+ <target name="build.osc.nstools" depends="init.osc" description="Builds the new Scala compiler.">
+ <mkdir dir="${build.osc-nstools.dir}"/>
+ <osc srcdir="${sources.dir}" destdir="${build.osc-nstools.dir}" force="changed">
+ <classpath>
+ <pathelement location="${build.osc-nstools.dir}"/>
+ <pathelement location="${oslib.jar}"/>
+ <pathelement location="${ant.jar}"/>
+ </classpath>
+ <include name="scala/tools/nsc/**/*.scala"/>
+ <include name="scala/runtime/*.scala"/>
+ <include name="scala/runtime/**/*.scala"/>
+ </osc>
+ </target>
+
+ <target name="build.nsc.nslib" depends="init.nsc, build.pico.nslib" description="Builds the Scala library with the new Scala compiler.">
+ <mkdir dir="${build.nslib.dir}"/>
+ <nsc srcdir="${sources.dir}" destdir="${build.nslib.dir}" usepredefs="false" stop="${nsc.stop}" skip="${nsc.skip}" check="${nsc.check}" logging="${nsc.logging}">
+ <classpath>
+ <pathelement location="${build.nslib.dir}"/>
+ <pathelement location="${sources.dir}"/>
+ <pathelement location="${newsources.dir}"/>
+ <pathelement location="${fjbg.jar}"/>
+ </classpath>
+ <include name="scala/Predef.scala"/>
+ <include name="scala/runtime/ScalaRunTime.scala"/>
+ </nsc>
+ <nsc srcdir="${sources.dir}" destdir="${build.nslib.dir}" excludesfile="${nsc.nslib.excludes}" stop="${nsc.stop}" skip="${nsc.skip}" check="${nsc.check}" logging="${nsc.logging}">
+ <classpath>
+ <pathelement location="${build.nslib.dir}"/>
+ <pathelement location="${sources.dir}"/>
+ <pathelement location="${newsources.dir}"/>
+ <pathelement location="${build.osc-nstools.dir}"/>
+ <pathelement location="${fjbg.jar}"/>
+ </classpath>
+ <include name="scala/**/*.scala"/>
+ <exclude name="scala/Predef.scala"/>
+ <exclude name="scala/runtime/ScalaRunTime.scala"/>
+ <exclude name="scala/tools/**"/>
+ </nsc>
+ </target>
+
+ <target name="build.nsc.nstools" depends="init.nsc, build.nsc.nslib" description="Builds the Scala tools (NSC and Scalap) with the new Scala compiler.">
+ <mkdir dir="${build.nstools.dir}"/>
+ <nsc srcdir="${sources.dir}" destdir="${build.nstools.dir}" excludesfile="${nsc.nstools.excludes}" stop="${nsc.stop}" skip="${nsc.skip}" check="${nsc.check}" logging="${nsc.logging}">
+ <classpath>
+ <pathelement location="${build.nslib.dir}"/>
+ <pathelement location="${build.nstools.dir}"/>
+ <pathelement location="${fjbg.jar}"/>
+ <pathelement location="${ant.jar}"/>
+ </classpath>
+ <include name="scala/tools/nsc/**/*.scala"/>
+ <exclude name="scala/tools/nsc/ant/*.scala"/>
+ </nsc>
+ </target>
+
+ <target name="build.nsbin" depends="init.nsc, build.nsc.nslib" description="Builds the Scala tools (NSC and Scalap) with the new Scala compiler.">
+ <mkdir dir="${build.nstools.dir}"/>
+ <nsc srcdir="${sources.dir}" destdir="${build.nstools.dir}" excludesfile="${nsc.nstools.excludes}" stop="${nsc.stop}" skip="${nsc.skip}" check="${nsc.check}" logging="${nsc.logging}">
+ <classpath>
+ <pathelement location="${build.nslib.dir}"/>
+ <pathelement location="${build.nstools.dir}"/>
+ <pathelement location="${fjbg.jar}"/>
+ <pathelement location="${ant.jar}"/>
+ </classpath>
+ <include name="scala/tools/nsc/**/*.scala"/>
+ <exclude name="scala/tools/nsc/ant/*.scala"/>
+ </nsc>
+ </target>
+
+ <!--
+ #####################################################################
+ DISTRIB
+ #####################################################################
+ -->
+
+ <condition property="os.unix">
+ <or>
+ <os family="unix"/>
+ <os family="mac"/>
+ </or>
+ </condition>
+
+ <condition property="os.mac">
+ <os family="mac"/>
+ </condition>
+
+ <condition property="os.win">
+ <os family="windows"/>
+ </condition>
+
+ <target name="distrib" description="Creates a (simplified) Scala distribution." depends="distrib.unix, distrib.mac, distrib.win"/>
+
+ <target name="distrib.unix" depends="build" if="os.unix">
+ <tstamp prefix="start"/>
+ <property name="distrib.current.dir" value="${distrib.dir}/${distrib.current.prefix}-${start.DSTAMP}-${start.TSTAMP}"/>
+ <mkdir dir="${distrib.current.dir}/share/scala"/>
+ <mkdir dir="${distrib.current.dir}/share/scala/lib"/>
+ <symlink resource="${distrib.current.dir}/share/scala/lib/" link="${distrib.current.dir}/lib"/>
+ <jar destfile="${distrib.current.dir}/share/scala/lib/${distrib.osc-nstools.jar}" basedir="${build.osc-nstools.dir}">
+ <include name="**"/>
+ <manifest>
+ <attribute name="Built-By" value="${user.name}"/>
+ <attribute name="Main-Class" value="scala.tools.nsc.Main$class"/>
+ </manifest>
+ </jar>
+ <jar destfile="${distrib.current.dir}/share/scala/lib/${distrib.nstools.jar}" basedir="${build.nstools.dir}">
+ <include name="**"/>
+ <manifest>
+ <attribute name="Built-By" value="${user.name}"/>
+ <attribute name="Main-Class" value="scala.tools.nsc.Main$class"/>
+ </manifest>
+ </jar>
+ <jar destfile="${distrib.current.dir}/share/scala/lib/${distrib.nslib.jar}" basedir="${build.nslib.dir}">
+ <include name="**"/>
+ <manifest>
+ <attribute name="Built-By" value="${user.name}"/>
+ </manifest>
+ </jar>
+ <mkdir dir="${distrib.current.dir}/share/scala/bin"/>
+ <symlink resource="${distrib.current.dir}/share/scala/bin/" link="${distrib.current.dir}/bin"/>
+ <!-- Set up bin -->
+ <mkdir dir="${distrib.current.dir}/share/scala/man"/>
+ <!-- Set up man -->
+ <mkdir dir="${distrib.current.dir}/share/scala/doc"/>
+ <!-- Set up doc -->
+ <symlink resource="${distrib.current.dir}/" link="${distrib.dir}/latest"/>
+ </target>
+
+ <target name="distrib.mac" depends="distrib.unix, build" if="os.mac">
+
+ </target>
+
+ <target name="distrib.win" depends="build" if="os.win">
+ <fail>Windows distribution is not supported yet.</fail>
+ </target>
+
+ <!--
+ #####################################################################
+ TEST
+ #####################################################################
+ -->
+
+ <target name="test" description="Runs the Scala test suite.">
+ <fail>'test' is not implemented yet.</fail>
+ </target>
+
+ <!--
+ #####################################################################
+ DOCS
+ #####################################################################
+ -->
+
+ <target name="docs" description="Generates all documentation.">
+ <fail>'docs' is not implemented yet.</fail>
+ </target>
+
+ <!--
+ #####################################################################
+ CLEAN
+ #####################################################################
+ -->
+
+ <target name="clean" description="Deletes all generated files, both build and distribution files." depends="clean.build, clean.distrib"/>
+
+ <target name="clean.build" description="Delete all generated build files.">
+ <delete dir="${build.dir}" includeemptydirs="true" quiet="true" failonerror="false"/>
+ </target>
+
+ <target name="clean.distrib" description="Delete all generated distribution files.">
+ <delete dir="${distrib.dir}" includeemptydirs="true" quiet="true" failonerror="false">
+ <fileset>
+ <include name="${distrib.current.prefix}-*"/>
+ </fileset>
+ </delete>
+ </target>
+
+</project> \ No newline at end of file
diff --git a/config/excludes/nsc.nslib.excludes b/config/excludes/nsc.nslib.excludes
new file mode 100644
index 0000000000..5fb8fc55b6
--- /dev/null
+++ b/config/excludes/nsc.nslib.excludes
@@ -0,0 +1,3 @@
+# A list of files to exclude when compiling the Scala library with NSC.
+# All files can be defined using Ant's fileset wildcard notation;
+# one statement per line. \ No newline at end of file
diff --git a/config/excludes/nsc.nstools.excludes b/config/excludes/nsc.nstools.excludes
new file mode 100644
index 0000000000..7eeaaf3167
--- /dev/null
+++ b/config/excludes/nsc.nstools.excludes
@@ -0,0 +1,3 @@
+# A list of files to exclude when compiling the Scala tools with NSC.
+# All files can be defined using Ant's fileset wildcard notation;
+# one statement per line. \ No newline at end of file