diff options
Diffstat (limited to 'build.xml')
-rw-r--r-- | build.xml | 3401 |
1 files changed, 1253 insertions, 2148 deletions
@@ -5,176 +5,71 @@ 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. </description> -<!-- =========================================================================== -END-USER TARGETS -============================================================================ --> - - <target name="build" depends="pack.done" - description="Builds the Scala compiler and library. Executables are in 'build/pack/bin'."/> - - <target name="build-opt" - description="Builds the optimised Scala compiler and library. Executables are in 'build/pack/bin'."> - <antcall target="build"> - <param name="scalac.args.optimise" value="-optimise"/> - </antcall> - </target> - - <target name="clean" depends="quick.clean" - description="Removes binaries of compiler and library. Distributions are untouched."/> - - <target name="test" depends="test.done, osgi.test" - description="Runs test suite and bootstrapping test on Scala compiler and library."/> - - <target name="test-opt" - description="Runs test suite and bootstrapping test, everything is optimised (compiler, library, tests)."> - <antcall target="test"> - <param name="scalac.args.optimise" value="-optimise"/> - </antcall> - </target> - - <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="dist-opt" - description="Makes a new optimised distribution and tests it. Will remove existing binaries and documentation."> - <antcall target="dist"> - <param name="scalac.args.optimise" value="-optimise"/> - </antcall> - </target> - - - <target name="partialdist" depends="dist.partial" - description="Makes a new distribution without documentation, so just for testing."/> - - <target name="partialdist-opt" - description="Makes a new optimised distribution without testing it or removing partially build elements."> - <antcall target="partialdist"> - <param name="scalac.args.optimise" value="-optimise"/> - </antcall> - </target> - +<!-- USAGE FROM JENKINS SCRIPTS IS (CURRENTLY) AS FOLLOWS: +ant $antArgs $scalacArgs $targets - <target name="fastdist" depends="dist.done" - description="Makes a new distribution without testing it or removing partially build elements."/> +antArgs tend to be: + -Darchives.skipxz=true + -Dscalac.args.optimise=-optimise - <target name="fastdist-opt" - description="Makes a new optimised distribution without testing it or removing partially build elements."> - <antcall target="fastdist"> - <param name="scalac.args.optimise" value="-optimise"/> - </antcall> - </target> - - <target name="distclean" depends="dist.clean" - description="Removes all distributions. Binaries and documentation are untouched."/> - - <target name="replacestarr" - description="Replaces the Starr compiler and library by fresh ones built from current sources and tests them."> - <fail message="This target is not available on Windows. Use 'ant replacestarrwin' instead."> - <condition> - <os family="windows"/> - </condition> - </fail> - <antcall target="locker.clean"/> - <antcall target="pack.done"/> - <antcall target="starr.done"/> - <antcall target="locker.clean"/> - <antcall target="test.done"/> - </target> - - <target name="replacestarr-opt" - description="Replaces the Starr compiler and library by fresh, optimised ones built from current sources and tests them."> - <antcall target="replacestarr"> - <param name="scalac.args.optimise" value="-optimise"/> - </antcall> - </target> - - <!-- Ant on Windows is not able to delete jar files that are referenced in any <path>. - See ticket 1290 on trac. --> - <target name="replacestarrwin" - description="Creates a new Starr on Windows. Manually execute 'ant locker.clean build' first!"> - <fail message="This target is only available on Windows. Use 'ant replacestarr' instead."> - <condition> - <not><os family="windows"/></not> - </condition> - </fail> - <echo message="CAUTION: Make sure to execute 'ant locker.clean build' prior to calling 'replacestarrwin'."/> - <antcall target="starr.done"/> - <antcall target="locker.clean"/> - <antcall target="test.done"/> - </target> +scalacArgs examples: + "-Dscalac.args=\"-Yrangepos\" -Dpartest.scalac_opts=\"-Yrangepos\"" - <target name="replacestarrwin-opt" - description="Creates a new Starr on Windows. Manually execute 'ant locker.clean build' first!"> - <antcall target="replacestarrwin"> - <param name="scalac.args.optimise" value="-optimise"/> - </antcall> - </target> - <target name="replacelocker" - description="Replaces the Locker compiler and library by fresh ones built from current sources."> - <antcall target="palo.clean"/> - <antcall target="unlocklocker"/> - </target> +targets exercised: + build-opt nightly test.suite test.continuations.suite test.scaladoc locker.done +--> - <target name="replacelocker-opt" - description="Replaces the Locker compiler and library by fresh, optimised ones built from current sources."> - <antcall target="replacelocker"> - <param name="scalac.args.optimise" value="-optimise"/> - </antcall> - </target> - <target name="unlocklocker" - description="Unlocks Locker, allowing its compiler and library to be rebuilt"> - <antcall target="locker.unlock"/> - <antcall target="palo.done"/> - </target> +<!-- =========================================================================== + END-USER TARGETS +============================================================================ --> + <target name="build" depends="pack.done" description="Builds the Scala compiler and library. Executables are in 'build/pack/bin'."/> + <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="dist" depends="all.clean, all.done" description="Cleans all and builds and tests a new distribution."/> + <target name="partialdist" depends="dist.partial" description="Makes a new distribution without documentation, so just for testing."/> + <target name="fastdist" depends="dist.done" description="Makes a new distribution without testing it or removing partially build elements."/> + + <target name="build-opt" description="Optimized version of build."> <optimized name="build"/></target> + <target name="test-opt" description="Optimized version of test."> <optimized name="test"/></target> + <target name="dist-opt" description="Optimized version of dist."> <optimized name="dist"/></target> + <target name="partialdist-opt" description="Optimized version of partialdist."> <optimized name="partialdist"/></target> + <target name="fastdist-opt" description="Optimized version of fastdist."> <optimized name="fastdist"/></target> + + <!-- packaging --> + <target name="distpack" depends="dist.done, docs.done"> + <ant antfile="${src.dir}/build/pack.xml" target="pack-all.done" inheritall="yes" inheritrefs="yes"/></target> + + <target name="distpack-maven" depends="dist.done, docs.done"> + <ant antfile="${src.dir}/build/pack.xml" target="pack-maven.done" inheritall="yes" inheritrefs="yes"/></target> + + <target name="distpack-opt" description="Builds an optimised distribution."> <optimize name="distpack"/></target> + <target name="distpack-maven-opt" description="Builds an optimised maven distribution."><optimize name="distpack-maven"/></target> - <target name="fastlocker.lib" - description="Buildlocker without extra fuss"> - <property name="fastlocker" value="true"/> - <antcall target="locker.unlock"/> - <antcall target="locker.lib"/> - </target> + <target name="all.done" depends="dist.done, test.done"/> - <target name="fastlocker.reflect" - description="Buildlocker without extra fuss"> - <property name="fastlocker" value="true"/> - <antcall target="locker.unlock"/> - <antcall target="locker.reflect"/> - </target> + <!-- must use depends for all.done, not antcall: need the properties defined in there (dist.dir) --> + <target name="nightly-nopt" depends="all.done, docs.done"> + <ant antfile="${src.dir}/build/pack.xml" target="pack-all.done" inheritall="yes" inheritrefs="yes"/></target> + <target name="nightly"><optimized name="nightly-nopt"/></target> - <target name="fastlocker.comp" - description="Buildlocker without extra fuss"> - <property name="fastlocker" value="true"/> - <antcall target="locker.unlock"/> - <antcall target="locker.comp"/> - </target> + <target name="nightly.checkall"> + <antcall target="nightly-nopt"> <param name="partest.scalac_opts" value="-Ycheck:all"/></antcall></target> - <target name="fastlocker" - description="Buildlocker without extra fuss"> - <antcall target="fastlocker.comp"/> - </target> + <target name="clean" depends="locker.clean" description="Removes binaries of compiler and library. Distributions are untouched."/> + <target name="docsclean" depends="docs.clean" description="Removes generated documentation. Distributions are untouched."/> + <target name="distclean" depends="dist.clean" description="Removes all distributions. Binaries and documentation are untouched."/> - <target name="buildlocker" - description="Does the same for locker as build does for quick"> - <antcall target="locker.unlock"/> - <antcall target="palo.bin"/> - </target> + <macrodef name="optimized" > + <attribute name="name"/> + <sequential> + <antcall target="@{name}"><param name="scalac.args.optimise" value="-optimise"/></antcall> + </sequential> + </macrodef> <!-- =========================================================================== -PROPERTIES + PROPERTIES ============================================================================ --> <property environment="env"/> @@ -184,10 +79,10 @@ 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="partest.dir" value="${basedir}/test"/> + <property name="lib-ant.dir" value="${lib.dir}/ant"/> <!-- For developers: any jars placed in this dir will be added to the classpath of all targets and copied into quick/pack/etc builds. --> <property name="lib-extra.dir" value="${lib.dir}/extra"/> @@ -197,14 +92,10 @@ PROPERTIES <!-- Generating version number --> <property file="${basedir}/build.number"/> - <!-- Additional command line arguments for scalac. They are added to all build targets --> - <property name="scalac.args" value=""/> - <property name="javac.args" value=""/> - <!-- Sets location of pre-compiled libraries --> - <property name="lib.starr.jar" value="${lib.dir}/scala-library.jar"/> + <property name="library.starr.jar" value="${lib.dir}/scala-library.jar"/> <property name="reflect.starr.jar" value="${lib.dir}/scala-reflect.jar"/> - <property name="comp.starr.jar" value="${lib.dir}/scala-compiler.jar"/> + <property name="compiler.starr.jar" value="${lib.dir}/scala-compiler.jar"/> <property name="jline.jar" value="${lib.dir}/jline.jar"/> <property name="ant.jar" value="${ant.home}/lib/ant.jar"/> <property name="scalacheck.jar" value="${lib.dir}/scalacheck.jar"/> @@ -222,6 +113,8 @@ PROPERTIES <property name="build-libs.dir" value="${build.dir}/libs"/> <property name="build-sbt.dir" value="${build.dir}/sbt-interface"/> + <property name="test.osgi.src" value="${partest.dir}/osgi/src"/> + <property name="test.osgi.classes" value="${build-osgi.dir}/classes"/> <property name="dists.dir" value="${basedir}/dists"/> @@ -237,126 +130,127 @@ PROPERTIES but if it is unset it will take this default value. --> <property name="env.ANT_OPTS" value="-Xms1536M -Xmx1536M -Xss1M -XX:MaxPermSize=192M -XX:+UseParallelGC" /> - <property - name="scalacfork.jvmargs" - value="${env.ANT_OPTS} ${jvm.opts}"/> + <property name="scalacfork.jvmargs" value="${env.ANT_OPTS} ${jvm.opts}"/> <!-- =========================================================================== -INITIALISATION + INITIALIZATION ============================================================================ --> + <target name="desired.jars.uptodate"> + <patternset id="desired.jars"> + <include name="lib/**/*.desired.sha1"/> + <include name="test/files/**/*.desired.sha1"/> + <include name="tools/**/*.desired.sha1"/> + </patternset> - <target name="init.jars.check"> <uptodate property="lib.jars.uptodate"> - <srcfiles dir="${basedir}"> - <include name="lib/**/*.desired.sha1"/> - <include name="test/files/**/*.desired.sha1"/> - <include name="tools/**/*.desired.sha1"/> - </srcfiles> + <srcfiles dir="${basedir}"><patternset refid="desired.jars"/></srcfiles> <mapper type="glob" from="*.desired.sha1" to="*"/> </uptodate> </target> - <target name="init.jars" depends="init.jars.check" unless="lib.jars.uptodate"> + <target name="boot" depends="desired.jars.uptodate" unless="lib.jars.uptodate"> <echo level="warn" message="Updating bootstrap libs. (To do this by hand, run ./pull-binary-libs.sh)"/> <exec osfamily="unix" vmlauncher="false" executable="./pull-binary-libs.sh" failifexecutionfails="true" /> <exec osfamily="windows" vmlauncher="false" executable="pull-binary-libs.sh" failifexecutionfails="true" /> <!-- uptodate task needs to know these are what's in the sha. --> <touch> - <fileset dir="${basedir}"> - <include name="lib/**/*.desired.sha1"/> - <include name="test/files/**/*.desired.sha1"/> - <include name="tools/**/*.desired.sha1"/> - </fileset> + <fileset dir="${basedir}"><patternset refid="desired.jars"/></fileset> <mapper type="glob" from="*.desired.sha1" to="*"/> </touch> </target> - <!-- Add our maven ant tasks --> - <target name="init.maven.tasks" depends="init.jars.check" unless="init.maven.tasks.finished"> - <path id="maven-ant-tasks.classpath" path="${lib.dir}/ant/maven-ant-tasks-2.1.1.jar" /> - <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant" classpathref="maven-ant-tasks.classpath" /> + <target name="init" depends="boot"> + <!-- Set up Ant contrib tasks so we can use <if><then><else> instead of the clunky `unless` attribute --> + <taskdef resource="net/sf/antcontrib/antlib.xml" classpath="${lib-ant.dir}/ant-contrib.jar"/> - <property name="init.maven.tasks.finished" value="true" /> - </target> - - <target name="init.extra.tasks" depends="init.maven.tasks" unless="init.extra.tasks.finished"> - <artifact:dependencies pathId="extra.tasks.classpath" filesetId="extra.tasks.fileset"> - <dependency groupId="biz.aQute" artifactId="bnd" version="1.50.0"/> - </artifact:dependencies> - <!-- Pax runner --> - <property name="pax.exam.version" value="2.5.0"/> - <artifact:dependencies pathId="pax.exam.classpath" filesetId="pax.exam.fileset"> - <dependency groupId="org.ops4j.pax.exam" artifactId="pax-exam-container-native" version="${pax.exam.version}"/> - <dependency groupId="org.ops4j.pax.exam" artifactId="pax-exam-junit4" version="${pax.exam.version}"/> - <dependency groupId="org.ops4j.pax.exam" artifactId="pax-exam-link-assembly" version="${pax.exam.version}"/> - <dependency groupId="org.ops4j.pax.url" artifactId="pax-url-aether" version="1.4.0"/> - <dependency groupId="org.ops4j.pax.swissbox" artifactId="pax-swissbox-framework" version="1.5.1"/> - <dependency groupId="ch.qos.logback" artifactId="logback-core" version="0.9.20"/> - <dependency groupId="ch.qos.logback" artifactId="logback-classic" version="0.9.20"/> - <dependency groupId="junit" artifactId="junit" version="4.10"/> - <dependency groupId="org.apache.felix" artifactId="org.apache.felix.framework" version="3.2.2"/> - </artifact:dependencies> - <!-- BND support --> - <typedef resource="aQute/bnd/ant/taskdef.properties" classpathref="extra.tasks.classpath" /> - <property name="init.maven.tasks.finished" value="true" /> - </target> - - <!-- Resolve maven dependencies --> - <target name="init.maven.jars" depends="init.maven.tasks"> - <!-- This target has an issue where if the user directory does not exist, we BOMB. ugh. --> - <mkdir dir="${user.home}/.m2/repository"/> - <artifact:dependencies pathId="dependency.classpath" filesetId="dependency.fileset"> - <!--<dependency groupId="com.typesafe" artifactId="config" version="0.4.0"/>--> - </artifact:dependencies> - </target> + <!-- Add our maven ant tasks --> + <path id="maven-ant-tasks.classpath" path="${lib-ant.dir}/maven-ant-tasks-2.1.1.jar" /> + <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant" classpathref="maven-ant-tasks.classpath" /> - <!-- Determines OSGi string + maven extension. --> - <target name="init.hasbuildnum"> - <condition property="version.hasbuildnum"> - <not><equals arg1="${version.bnum}" arg2="0"/></not> - </condition> - </target> - <target name="init.build.snapshot" unless="build.release"> + <!-- work around http://jira.codehaus.org/browse/MANTTASKS-203: + java.lang.ClassCastException: org.codehaus.plexus.DefaultPlexusContainer cannot be cast to org.codehaus.plexus.PlexusContainer + on repeated use of artifact:dependencies + --> + <if><not><isset property="maven-deps-done"></isset></not><then> + <artifact:dependencies pathId="extra.tasks.classpath" filesetId="extra.tasks.fileset"> + <dependency groupId="biz.aQute" artifactId="bnd" version="1.50.0"/> + </artifact:dependencies> + + <!-- Pax runner --> + <property name="pax.exam.version" value="2.5.0"/> + <artifact:dependencies pathId="pax.exam.classpath" filesetId="pax.exam.fileset"> + <dependency groupId="org.ops4j.pax.exam" artifactId="pax-exam-container-native" version="${pax.exam.version}"/> + <dependency groupId="org.ops4j.pax.exam" artifactId="pax-exam-junit4" version="${pax.exam.version}"/> + <dependency groupId="org.ops4j.pax.exam" artifactId="pax-exam-link-assembly" version="${pax.exam.version}"/> + <dependency groupId="org.ops4j.pax.url" artifactId="pax-url-aether" version="1.4.0"/> + <dependency groupId="org.ops4j.pax.swissbox" artifactId="pax-swissbox-framework" version="1.5.1"/> + <dependency groupId="ch.qos.logback" artifactId="logback-core" version="0.9.20"/> + <dependency groupId="ch.qos.logback" artifactId="logback-classic" version="0.9.20"/> + <dependency groupId="junit" artifactId="junit" version="4.10"/> + <dependency groupId="org.apache.felix" artifactId="org.apache.felix.framework" version="3.2.2"/> + </artifact:dependencies> + + <!-- BND support --> + <typedef resource="aQute/bnd/ant/taskdef.properties" classpathref="extra.tasks.classpath" /> + + <!-- Resolve maven dependencies --> + <mkdir dir="${user.home}/.m2/repository"/> + <!-- This task has an issue where if the user directory does not exist, so we create it above. UGH. --> + <artifact:dependencies pathId="dependency.classpath" filesetId="dependency.fileset"> + <!--<dependency groupId="com.typesafe" artifactId="config" version="0.4.0"/>--> + </artifact:dependencies> + + <if><isset property="starr.version"/><then> + <artifact:dependencies pathId="starr.core.path"> + <dependency groupId="org.scala-lang" artifactId="scala-library" version="${starr.version}"/> + <dependency groupId="org.scala-lang" artifactId="scala-reflect" version="${starr.version}"/> + <dependency groupId="org.scala-lang" artifactId="scala-compiler" version="${starr.version}"/> + </artifact:dependencies> + </then></if> + + <property name="maven-deps-done" value="yep!"/> + </then></if> + + + <!-- NOTE: ant properties are write-once: second writes are silently discarded; the logic below relies on this --> + + <!-- Compute defaults (i.e., if not specified on command-line) for OSGi/maven version suffixes. + Try to establish the invariant (verified below): + `version.suffix == maven.version.suffix == osgi.version.suffix`, + except for: + - snapshot builds, where: + - `maven.suffix == "-SNAPSHOT"` + - `version.suffix == osgi.version.suffix == ""` + - final builds, where: + - `osgi.suffix == "-VFINAL"` + - `version.suffix == maven.version.suffix == ""` + --> + <if><not><equals arg1="${version.bnum}" arg2="0"/></not><then> + <property name="version.suffix" value="-${version.bnum}"/> + </then></if> + + <if><or><not><isset property="version.suffix"/></not><equals arg1="${version.suffix}" arg2=""/></or><then> + <if><isset property="build.release"/><then> + <property name="maven.version.suffix" value=""/> + <property name="version.suffix" value="${maven.version.suffix}"/> + <if><equals arg1="${maven.version.suffix}" arg2=""/><then> + <property name="osgi.version.suffix" value="-VFINAL"/></then> + <else> + <property name="osgi.version.suffix" value="${maven.version.suffix}"/></else></if></then></if></then> + <else> <!-- version.suffix set and not empty --> + <property name="maven.version.suffix" value="${version.suffix}"/> + <property name="osgi.version.suffix" value="${version.suffix}"/></else></if> + + <!-- not building a release and no version.suffix specified --> <property name="maven.version.suffix" value="-SNAPSHOT"/> - </target> - <target name="init.build.release" if="build.release" depends="init.hasbuildnum, init.build.snapshot"> - <property name="maven.version.suffix" value=""/> - </target> - <target name="init.build.nopatch.release" unless="version.hasbuildnum" depends="init.hasbuildnum"> - <property name="version.suffix" value=""/> - </target> - <!-- funny thing, ant is. Can only specify *one* property in if check. Guaranteed that both are true here, - since properties are immutable. --> - <target name="init.build.patch.release" if="version.hasbuildnum" depends="init.build.nopatch.release"> - <property name="version.suffix" value="-${version.bnum}"/> - </target> - - <target name="init.hasmavensuffix" if="build.release" depends="init.build.patch.release, init.build.release"> - <condition property="version.hasmavensuffix"> - <not><equals arg1="${maven.version.suffix}" arg2=""/></not> - </condition> - </target> - - <target name="init.osgi.suffix" if="version.hasmavensuffix" depends="init.hasmavensuffix"> - <property name="osgi.version.suffix" value="${maven.version.suffix}"/> - </target> - - <target name="init.osgi.suffix.final" if="build.release" unless="version.hasmavensuffix" depends="init.hasmavensuffix"> - <property name="osgi.version.suffix" value="-VFINAL"/> - </target> + <if><equals arg1="${maven.version.suffix}" arg2="-SNAPSHOT"/><then> + <property name="osgi.version.suffix" value=""/> + <property name="version.suffix" value=""/></then> + <else> + <property name="osgi.version.suffix" value="${maven.version.suffix}"/> + <property name="version.suffix" value="${maven.version.suffix}"/></else></if> - <target name="init.osgi.suffix.snapshot" unless="build.release" depends="init.hasmavensuffix"> - <property name="osgi.version.suffix" value=""/> - </target> - - <target name="init.build.suffix.done" depends="init.build.release, init.build.patch.release, init.osgi.suffix, init.osgi.suffix.final, init.osgi.suffix.snapshot"/> - - <target name="init.version.git" depends="init.build.suffix.done"> - <!-- Find out whether we are running on Windows --> - <condition property="os.win"> - <os family="windows"/> - </condition> <exec osfamily="unix" executable="tools/get-scala-commit-sha" outputproperty="git.commit.sha" failifexecutionfails="false" /> <exec osfamily="windows" executable="cmd.exe" outputproperty="git.commit.sha" failifexecutionfails="false"> @@ -370,72 +264,68 @@ INITIALISATION <arg value="tools\get-scala-commit-date.bat"/> <arg value="-p"/> </exec> + <!-- some default in case something went wrong getting the revision --> <property name="git.commit.sha" value="unknown"/> <property name="git.commit.date" value="unknown"/> <!-- We use the git describe to determine the OSGi modifier for our build. --> - <property - name="maven.version.number" - value="${version.major}.${version.minor}.${version.patch}${version.suffix}${maven.version.suffix}"/> - <property - name="osgi.version.number" - value="${version.major}.${version.minor}.${version.patch}.v${git.commit.date}${version.suffix}${osgi.version.suffix}-${git.commit.sha}"/> - </target> + <property name="maven.version.number" + value="${version.major}.${version.minor}.${version.patch}${maven.version.suffix}"/> + <property name="osgi.version.number" + value="${version.major}.${version.minor}.${version.patch}.v${git.commit.date}${osgi.version.suffix}-${git.commit.sha}"/> + + <if><isset property="build.release"/><then> + <property name="version.number" value="${maven.version.number}"/> + </then><else> + <property name="version.number" value="${version.major}.${version.minor}.${version.patch}${version.suffix}-${git.commit.date}-${git.commit.sha}"/> + </else></if> + + <condition property="has.java6"> + <equals arg1="${ant.java.version}" arg2="1.6"/> + </condition> + <condition property="has.java7"> + <equals arg1="${ant.java.version}" arg2="1.7"/> + </condition> + <condition property="has.unsupported.jdk"> + <not><or> + <isset property="has.java7" /> + <isset property="has.java6" /> + </or></not> + </condition> - <target name="init.version.snapshot" unless="build.release" depends="init.version.git"> - <property - name="version.number" - value="${version.major}.${version.minor}.${version.patch}${version.suffix}-${git.commit.date}-${git.commit.sha}"/> - </target> + <fail if="has.unsupported.jdk" message="JDK ${ant.java.version} is not supported by this build!"/> - <target name="init.version.release" if="build.release" depends="init.version.git"> - <property - name="version.number" - value="${maven.version.number}"/> - </target> + <if><isset property="has.java7"/><then> + <echo level="warning"> You are using JDK7 for this build. + While this will be able to build most of Scala, it will not build the Swing project. + You will be unable to create a distribution. + </echo> + </then></if> - <target name="init.version.done" depends="init.version.release, init.version.snapshot"/> + <!-- Allow this to be overridden simply --> + <property name="sbt.latest.version" value="0.12.2"/> - <target name="init.testjava6"> - <condition property="has.java6"> - <equals arg1="${ant.java.version}" arg2="1.6"/> - </condition> - <condition property="has.java7"> - <equals arg1="${ant.java.version}" arg2="1.7"/> - </condition> - <condition property="has.unsupported.jdk"> - <not><or> - <isset property="has.java7" /> - <isset property="has.java6" /> - </or></not> - </condition> - </target> + <property name="sbt.src.dir" value="${build-sbt.dir}/${sbt.latest.version}/src"/> + <property name="sbt.lib.dir" value="${build-sbt.dir}/${sbt.latest.version}/lib"/> - <target name="init.fail.bad.jdk" depends="init.testjava6"> - <fail if="has.unsupported.jdk" - message="JDK ${ant.java.version} is not supported by this build!"/> - </target> - <target name="init.warn.jdk7" depends="init.testjava6" if="has.java7"> - <echo level="warning"> You are using JDK7 for this build. While this will be able to build most of Scala, it will - not build the Swing project. You will be unable to create a distribution. - </echo> - </target> + <property name="sbt.interface.jar" value="${sbt.lib.dir}/interface.jar"/> + <property name="sbt.interface.url" value="http://typesafe.artifactoryonline.com/typesafe/ivy-releases/org.scala-sbt/interface/${sbt.latest.version}/jars/interface.jar"/> + <property name="sbt.interface.src.jar" value="${sbt.src.dir}/compiler-interface-src.jar"/> + <property name="sbt.interface.src.url" value="http://typesafe.artifactoryonline.com/typesafe/ivy-releases/org.scala-sbt/compiler-interface/${sbt.latest.version}/jars/compiler-interface-src.jar"/> + + + <!-- Additional command line arguments for scalac. They are added to all build targets --> + <property name="scalac.args" value=""/> + <property name="javac.args" value=""/> - <target name="init" depends="init.jars, init.maven.jars, init.version.done, init.fail.bad.jdk, init.warn.jdk7, init.extra.tasks"> - <property name="scalac.args.always" value="-Yreify-copypaste" /> - <!-- scalac.args.optimise is selectively overridden in certain antcall tasks. --> - <property name="scalac.args.optimise" value=""/> - <!-- scalac.args.quickonly are added to quick.* targets but not others (particularly, locker.) - This is to facilitate testing new command line options which do not yet exist in starr. - Note: These are also used by strap since they may affect JVM target or other and we'd like - to be able to test binary stability of features. --> - <property name="scalac.args.quickonly" value=""/> + <property name="scalac.args.always" value="" /> + <property name="scalac.args.optimise" value=""/> <!-- scalac.args.optimise is selectively overridden in certain antcall tasks. --> <property name="scalac.args.all" value="${scalac.args.always} ${scalac.args} ${scalac.args.optimise}"/> - <property name="scalac.args.quick" value="${scalac.args.all} ${scalac.args.quickonly}"/> + <property name="scalac.args.locker" value="${scalac.args.all}"/> + <property name="scalac.args.quick" value="${scalac.args.all}"/> <property name="scalac.args.strap" value="${scalac.args.quick}"/> - <!-- Setting-up Ant contrib tasks --> - <taskdef resource="net/sf/antcontrib/antlib.xml" classpath="${lib.dir}/ant/ant-contrib.jar"/> + <!-- This is the start time for the distribution --> <tstamp prefix="time"> <format property="human" pattern="d MMMM yyyy, HH:mm:ss" locale="en,US"/> @@ -446,28 +336,17 @@ INITIALISATION <property name="version.number" value="-unknown-"/> <property name="init.avail" value="yes"/> - <!-- Local libs (developer use.) --> <mkdir dir="${lib-extra.dir}"/> - <path id="lib.extra"> + <!-- Auxiliary libs placed on every classpath. --> + <path id="aux.libs"> + <pathelement location="${ant.jar}"/> <!-- needs ant 1.7.1 --> <!-- <fileset dir="${lib-extra.dir}" erroronmissingdir="false"> --> <fileset dir="${lib-extra.dir}"> <include name="**/*.jar"/> </fileset> - </path> - - <!-- Libraries only used for STARR --> - <path id="starr.dep.libs"> - <fileset dir="${lib.dir}"> - <include name="forkjoin.jar"/> - </fileset> - </path> - <!-- Auxiliary libs placed on every classpath. --> - <path id="aux.libs"> - <pathelement location="${ant.jar}"/> - <path refid="lib.extra"/> <path refid="dependency.classpath"/> </path> @@ -484,1196 +363,858 @@ INITIALISATION <echo message=" OSGi version: ${osgi.version.number}" /> <echo message="canonical version: ${version.number}" /> - <!-- Define tasks that can be run with Starr --> - <path id="starr.classpath"> - <pathelement location="${lib.starr.jar}"/> - <pathelement location="${reflect.starr.jar}"/> - <pathelement location="${comp.starr.jar}"/> + <!-- validate version suffixes --> + <if><equals arg1="${maven.version.suffix}" arg2="-SNAPSHOT"/><then> + <condition property="version.suffixes.consistent"><and> + <equals arg1="${osgi.version.suffix}" arg2=""/> + <equals arg1="${version.suffix}" arg2=""/> + </and></condition></then> + <else> + <if><equals arg1="${osgi.version.suffix}" arg2="-VFINAL"/><then> + <condition property="version.suffixes.consistent"><and> + <equals arg1="${maven.version.suffix}" arg2=""/> + <equals arg1="${version.suffix}" arg2=""/> + </and></condition></then> + <else> + <condition property="version.suffixes.consistent"><and> + <equals arg1="${osgi.version.suffix}" arg2="${maven.version.suffix}"/> + <equals arg1="${version.suffix}" arg2="${maven.version.suffix}"/> + </and></condition></else></if></else></if> + + <!-- <echo message=" maven suffix: ${maven.version.suffix}"/> + <echo message=" OSGi suffix: ${osgi.version.suffix}" /> + <echo message="canonical suffix: ${version.suffix}" /> --> + <fail unless="version.suffixes.consistent" message="Version suffixes inconsistent!"/> + + <path id="forkjoin.classpath" path="${build-libs.dir}/classes/forkjoin"/> + <path id="asm.classpath" path="${build-asm.dir}/classes/"/> + + <!-- Compilers to use for the various stages. + + There must be a variable of the shape @{stage}.compiler.path for all @{stage} in starr, locker, quick, strap. + --> + <path id="starr.compiler.path"> + <path refid="starr.core.path"/> + <pathelement location="${lib.dir}/forkjoin.jar"/> <path refid="aux.libs"/> - <path refid="starr.dep.libs"/> - </path> - <!-- What to have on the compilation path when compiling during certain phases --> - <path id="quick.compilation.path"> - <pathelement location="${build-quick.dir}/classes/library"/> - <pathelement location="${build-libs.dir}/classes/forkjoin"/> - <path refid="lib.extra"/> </path> - <path id="strap.compilation.path"> - <pathelement location="${build-strap.dir}/classes/library"/> - <pathelement location="${build-libs.dir}/classes/forkjoin"/> - <path refid="lib.extra"/> - </path> - <taskdef resource="scala/tools/ant/sabbus/antlib.xml" classpathref="starr.classpath"/> - </target> -<!-- =========================================================================== -LOCAL DEPENDENCY (Adapted ASM) -============================================================================ --> + <!-- Download STARR via maven if `starr.version` is specified. + Want to slow down STARR changes, using only released versions. --> + <if><isset property="starr.version"/><then> + <property name="strr" refid="starr.compiler.path"/> + <echo message="Using Scala ${starr.version} for STARR."/> + <!-- <echo message="STARR classpath: ${strr}"/> --> + </then><else> + <path id="starr.core.path"> + <pathelement location="${library.starr.jar}"/> + <pathelement location="${reflect.starr.jar}"/> + <pathelement location="${compiler.starr.jar}"/> + </path> + </else></if> - <target name="asm.start" depends="init"> - <condition property="asm.available"> - <available file="${build-asm.dir}/asm.complete"/> - </condition> - </target> + <!-- Skip locker with -Dlocker.skip=YESSIR. Uses STARR instead. --> + <if><isset property="locker.skip"/><then> + <echo message="Skipping locker! Using STARR instead."/> + <path id="locker.compiler.path"><path refid="starr.compiler.path"/></path> + <property name="locker.locked" value="locker skipped"/></then> + <else> + <path id="locker.compiler.path"><path refid="locker.compiler.build.path"/></path></else></if> + + <!-- compilerpathref for compiling with quick --> + <path id="quick.compiler.path"> <path refid="quick.compiler.build.path"/></path> - <target name="asm.lib" depends="asm.start" unless="asm.available"> - <stopwatch name="asm.lib.timer"/> - <mkdir dir="${build-asm.dir}/classes/"/> - <javac - srcdir="${src.dir}/asm" - destdir="${build-asm.dir}/classes" - classpath="${build-asm.dir}/classes" - includes="**/*.java" - target="1.6" source="1.5"> - <compilerarg line="${javac.args} -XDignore.symbol.file"/> - </javac> - <touch file="${build-asm.dir}/asm.complete" verbose="no"/> - <stopwatch name="asm.lib.timer" action="total"/> - </target> + <!-- What to have on the compilation path when compiling during certain phases. - <target name="asm.done" depends="asm.lib"> - <path id="asm.classpath"> - <pathelement location="${build-asm.dir}/classes/"/> + There must be a variable of the shape @{stage}.@{project}.build.path + for all @{stage} in locker, quick, strap + and all @{project} in library, reflect, compiler + when stage is quick, @{project} also includes: actors, repl, swing, plugins, scalacheck, interactive, scaladoc, partest, scalap + --> + + <!-- LOCKER --> + <path id="locker.library.build.path"> + <pathelement location="${build-locker.dir}/classes/library"/> + <path refid="forkjoin.classpath"/> + <path refid="aux.libs"/> </path> - </target> - <target name="asm.clean" depends="init"> - <delete dir="${build-asm.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/> - </target> + <path id="locker.reflect.build.path"> + <path refid="locker.library.build.path"/> + <pathelement location="${build-locker.dir}/classes/reflect"/> + </path> -<!-- =========================================================================== -LOCAL DEPENDENCY (FORKJOIN) -============================================================================ --> - <target name="forkjoin.start" depends="init"> - <uptodate property="forkjoin.available" targetfile="${build-libs.dir}/forkjoin.complete"> - <srcfiles dir="${src.dir}/forkjoin"> - <include name="**/*.java"/> - <include name="**/*.scala"/> - </srcfiles> - </uptodate> - </target> + <path id="locker.compiler.build.path"> + <path refid="locker.reflect.build.path"/> + <pathelement location="${build-locker.dir}/classes/compiler"/> + <path refid="asm.classpath"/> + </path> - <target name="forkjoin.lib" depends="forkjoin.start" unless="forkjoin.available"> - <stopwatch name="forkjoin.lib.timer"/> - <mkdir dir="${build-libs.dir}/classes/forkjoin"/> - <javac - fork="yes" - compiler="javac1.6" - srcdir="${src.dir}/forkjoin" - destdir="${build-libs.dir}/classes/forkjoin" - classpath="${build-libs.dir}/classes/forkjoin" - includes="**/*.java" - debug="true" - target="1.6" source="1.5"> - <compilerarg line="${javac.args} -XDignore.symbol.file"/> - </javac> - <touch file="${build-libs.dir}/forkjoin.complete" verbose="no"/> - <stopwatch name="forkjoin.lib.timer" action="total"/> - </target> - - <target name="forkjoin.pack" depends="forkjoin.lib"> - <jar destfile="${build-libs.dir}/forkjoin.jar"> - <fileset dir="${build-libs.dir}/classes/forkjoin"/> - </jar> - </target> + <!-- QUICK --> + <path id="quick.library.build.path"> + <pathelement location="${build-quick.dir}/classes/library"/> + <path refid="forkjoin.classpath"/> + <path refid="aux.libs"/> + </path> + + <path id="quick.actors.build.path"><path refid="quick.library.build.path"/></path> - <target name="forkjoin.done" depends="forkjoin.pack"> - <!-- TODO - jar or classfiles? --> - <path id="forkjoin.classpath"> - <pathelement location="${build-libs.dir}/classes/forkjoin"/> + <path id="quick.reflect.build.path"> + <path refid="quick.library.build.path"/> + <pathelement location="${build-quick.dir}/classes/reflect"/> </path> - </target> - <target name="forkjoin.clean" depends="init"> - <delete dir="${build-libs.dir}/classes/forkjoin" includeemptydirs="yes" quiet="yes" failonerror="no"/> - <delete file="${build-libs.dir}/forkjoin.complete" quiet="yes" failonerror="no"/> - </target> + <path id="quick.compiler.build.path"> + <path refid="quick.reflect.build.path"/> + <pathelement location="${build-quick.dir}/classes/compiler"/> + <path refid="asm.classpath"/> + </path> -<!-- =========================================================================== -LOCAL REFERENCE BUILD (LOCKER) -============================================================================ --> + <path id="quick.repl.build.path"> + <path refid="quick.compiler.build.path"/> + <pathelement location="${build-quick.dir}/classes/repl"/> + <pathelement location="${jline.jar}"/> + </path> - <target name="locker.start" depends="asm.done, forkjoin.done"> - <condition property="locker.available"> - <available file="${build-locker.dir}/all.complete"/> - </condition> - </target> + <path id="quick.swing.build.path"> + <path refid="quick.library.build.path"/> + <pathelement location="${build-quick.dir}/classes/swing"/> + </path> - <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> + <path id="quick.plugins.build.path"> + <path refid="quick.compiler.build.path"/> + <pathelement location="${build-quick.dir}/classes/continuations-plugin"/> + </path> - <target name="locker.lib" depends="locker.pre-lib" if="locker.lib.needed"> - <stopwatch name="locker.lib.timer"/> - <mkdir dir="${build-locker.dir}/classes/library"/> - <javac - srcdir="${src.dir}/library" - destdir="${build-locker.dir}/classes/library" - includes="**/*.java" - target="1.6" source="1.5"> - <compilerarg line="${javac.args} -XDignore.symbol.file"/> - <classpath> - <path refid="forkjoin.classpath"/> - <pathelement location="${build-locker.dir}/classes/library"/> - </classpath> - </javac> - <scalacfork - destdir="${build-locker.dir}/classes/library" - compilerpathref="starr.classpath" - srcpath="${src.dir}/library" - params="${scalac.args.all}" - srcdir="${src.dir}/library" - jvmargs="${scalacfork.jvmargs}"> - <include name="**/*.scala"/> - <compilationpath> - <pathelement location="${build-locker.dir}/classes/library"/> - <path refid="forkjoin.classpath"/> - </compilationpath> - </scalacfork> - <propertyfile file="${build-locker.dir}/classes/library/library.properties"> - <entry key="version.number" value="${version.number}"/> - <entry key="maven.version.number" value="${maven.version.number}"/> - <entry key="osgi.version.number" value="${osgi.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> - <touch file="${build-locker.dir}/library.complete" verbose="no"/> - <stopwatch name="locker.lib.timer" action="total"/> - </target> + <path id="quick.scalacheck.build.path"> + <pathelement location="${build-quick.dir}/classes/library"/> + <pathelement location="${build-quick.dir}/classes/scalacheck"/> + </path> + <path id="quick.scalap.build.path"> + <path refid="quick.compiler.build.path"/> + <pathelement location="${build-quick.dir}/classes/scalap"/> + <pathelement location="${build-quick.dir}/classes/partest"/> + </path> - <target name="locker.pre-reflect" depends="locker.lib" unless="locker.available"> - <condition property="locker.reflect.needed"> - <not><available file="${build-locker.dir}/reflect.complete"/></not> - </condition> - </target> + <path id="quick.partest.build.path"> + <path refid="quick.scalap.build.path"/> + <pathelement location="${build-quick.dir}/classes/repl"/> + <pathelement location="${scalacheck.jar}"/> + </path> - <target name="locker.reflect" depends="locker.pre-reflect" if="locker.reflect.needed"> - <stopwatch name="locker.reflect.timer"/> - <mkdir dir="${build-locker.dir}/classes/reflect"/> - <scalacfork - destdir="${build-locker.dir}/classes/reflect" - compilerpathref="starr.classpath" - params="${scalac.args.all}" - srcdir="${src.dir}/reflect" - jvmargs="${scalacfork.jvmargs}"> - <include name="**/*.scala"/> - <compilationpath> - <pathelement location="${build-locker.dir}/classes/library"/> - <pathelement location="${build-locker.dir}/classes/reflect"/> - <path refid="aux.libs"/> - <pathelement location="${jline.jar}"/> - </compilationpath> - </scalacfork> - <!-- TODO - needed? --> - <propertyfile file="${build-locker.dir}/classes/reflect/reflect.properties"> - <entry key="version.number" value="${version.number}"/> - <entry key="maven.version.number" value="${maven.version.number}"/> - <entry key="osgi.version.number" value="${osgi.version.number}"/> - <entry key="copyright.string" value="${copyright.string}"/> - </propertyfile> - <copy todir="${build-locker.dir}/classes/reflect"> - <fileset dir="${src.dir}/reflect"> - <include name="**/*.tmpl"/> - <include name="**/*.xml"/> - <include name="**/*.js"/> - <include name="**/*.html"/> - <include name="**/*.css"/> - <include name="**/*.properties"/> - <include name="**/*.swf"/> - <include name="**/*.png"/> - <include name="**/*.gif"/> - </fileset> - </copy> - <touch file="${build-locker.dir}/reflect.complete" verbose="no"/> - <stopwatch name="locker.reflect.timer" action="total"/> - </target> + <path id="quick.scaladoc.build.path"> + <path refid="quick.compiler.build.path"/> + <pathelement location="${build-quick.dir}/classes/partest"/> + <pathelement location="${build-quick.dir}/classes/scaladoc"/> + </path> - <target name="locker.pre-comp" depends="locker.reflect" unless="locker.available"> - <condition property="locker.comp.needed"> - <not><available file="${build-locker.dir}/compiler.complete"/></not> - </condition> - </target> + <path id="quick.interactive.build.path"> + <path refid="quick.compiler.build.path"/> + <pathelement location="${build-quick.dir}/classes/scaladoc"/> + <pathelement location="${build-quick.dir}/classes/interactive"/> + </path> + <path id="quick.bin.tool.path"> + <path refid="quick.repl.build.path"/> + <pathelement location="${build-quick.dir}/classes/scalap"/> + <pathelement location="${build-quick.dir}/classes/continuations-library"/> + </path> - <target name="locker.comp" depends="locker.pre-comp" if="locker.comp.needed"> - <stopwatch name="locker.comp.timer"/> - <mkdir dir="${build-locker.dir}/classes/compiler"/> - <scalacfork - destdir="${build-locker.dir}/classes/compiler" - compilerpathref="starr.classpath" - params="${scalac.args.all}" - srcdir="${src.dir}/compiler" - jvmargs="${scalacfork.jvmargs}"> - <include name="**/*.scala"/> - <compilationpath> - <pathelement location="${build-locker.dir}/classes/library"/> - <pathelement location="${build-locker.dir}/classes/reflect"/> - <pathelement location="${build-locker.dir}/classes/compiler"/> - <path refid="aux.libs"/> - <path refid="asm.classpath"/> - <pathelement location="${jline.jar}"/> - </compilationpath> - </scalacfork> - <propertyfile file="${build-locker.dir}/classes/compiler/compiler.properties"> - <entry key="version.number" value="${version.number}"/> - <entry key="maven.version.number" value="${maven.version.number}"/> - <entry key="osgi.version.number" value="${osgi.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="**/*.html"/> - <include name="**/*.css"/> - <include name="**/*.properties"/> - <include name="**/*.swf"/> - <include name="**/*.png"/> - <include name="**/*.gif"/> - </fileset> - </copy> - <touch file="${build-locker.dir}/compiler.complete" verbose="no"/> - <stopwatch name="locker.comp.timer" action="total"/> - </target> + <!-- PACK --> + <path id="pack.compiler.path"> + <pathelement location="${build-pack.dir}/lib/scala-library.jar"/> + <pathelement location="${build-pack.dir}/lib/scala-reflect.jar"/> + <pathelement location="${build-pack.dir}/lib/scala-compiler.jar"/> + <pathelement location="${build-pack.dir}/lib/scala-partest.jar"/> + <pathelement location="${build-pack.dir}/lib/scalap.jar"/> + <pathelement location="${build-pack.dir}/lib/scala-actors.jar"/> + <pathelement location="${ant.jar}"/> + <path refid="aux.libs"/> + </path> - <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/reflect"/> - <pathelement location="${build-locker.dir}/classes/compiler"/> - <path refid="forkjoin.classpath"/> - <path refid="asm.classpath"/> + <path id="pack.bin.tool.path"> + <pathelement location="${build-pack.dir}/lib/scala-library.jar"/> + <pathelement location="${build-pack.dir}/lib/scala-reflect.jar"/> + <pathelement location="${build-pack.dir}/lib/scala-compiler.jar"/> + <pathelement location="${build-pack.dir}/lib/scalap.jar"/> + <pathelement location="${build-pack.dir}/lib/jline.jar"/> <path refid="aux.libs"/> </path> - <!-- TODO - Why is this *here* ? --> - <path id="quick.classpath"> - <pathelement location="${build-quick.dir}/classes/library"/> - <pathelement location="${build-quick.dir}/classes/reflect"/> - <pathelement location="${build-quick.dir}/classes/compiler"/> + + + <!-- STRAP --> + <path id="strap.library.build.path"> + <pathelement location="${build-strap.dir}/classes/library"/> <path refid="forkjoin.classpath"/> - <path refid="asm.classpath"/> <path refid="aux.libs"/> </path> - </target> + <path id="strap.actors.build.path"><path refid="strap.library.build.path"/></path> - <target name="locker.clean" depends="palo.clean"> - <delete dir="${build-locker.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/> - </target> + <path id="strap.reflect.build.path"> + <path refid="strap.library.build.path"/> + <pathelement location="${build-strap.dir}/classes/reflect"/> + </path> - <target name="locker.unlock.pre-lib"> - <uptodate property="locker.lib.available" targetfile="${build-locker.dir}/library.complete"> - <srcfiles dir="${src.dir}"> - <include name="library/**"/> - </srcfiles> - </uptodate> - </target> + <path id="strap.compiler.build.path"> + <path refid="strap.reflect.build.path"/> + <pathelement location="${build-strap.dir}/classes/compiler"/> + <path refid="asm.classpath"/> + </path> - <target name="locker.unlock.lib" depends="locker.unlock.pre-lib" unless="locker.lib.available"> - <delete file="${build-locker.dir}/library.complete"/> - </target> + <!-- MISC --> + <path id="sbt.compile.build.path"> + <path refid="quick.compiler.build.path"/> + <pathelement location="${build-quick.dir}/classes/repl"/> + <pathelement location="${build-quick.dir}/classes/scaladoc"/> + <pathelement location="${build-quick.dir}/classes/interactive"/> + <pathelement location="${sbt.interface.jar}"/> + </path> - <target name="locker.unlock.pre-reflect" depends="locker.unlock.lib"> - <uptodate property="locker.reflect.available" targetfile="${build-locker.dir}/reflect.complete"> - <srcfiles dir="${src.dir}"> - <include name="reflect/**"/> - </srcfiles> - </uptodate> - </target> + <path id="manual.classpath"> + <pathelement location="${build-pack.dir}/lib/scala-library.jar"/> + <pathelement location="${build.dir}/manmaker/classes"/> + </path> - <target name="locker.unlock.reflect" depends="locker.unlock.pre-reflect" unless="locker.reflect.available"> - <delete file="${build-locker.dir}/reflect.complete"/> - </target> + <path id="partest.classpath"> + <path refid="pack.compiler.path"/> + <fileset dir="${partest.dir}/files/lib" includes="*.jar" /> + <pathelement location="${pack.dir}/lib/scala-swing.jar"/> <!-- TODO - segregate swing tests (there can't be many) --> + </path> - <target name="locker.unlock.pre-comp" depends="locker.unlock.reflect"> - <uptodate property="locker.comp.available" targetfile="${build-locker.dir}/compiler.complete"> - <srcfiles dir="${src.dir}"> - <include name="compiler/**"/> - </srcfiles> - </uptodate> - </target> + <path id="test.osgi.compiler.build.path"> + <pathelement location="${test.osgi.classes}"/> + <pathelement location="${build-osgi.dir}/org.scala-lang.scala-library.jar"/> + <pathelement location="${build-osgi.dir}/org.scala-lang.scala-reflect.jar"/> + <pathelement location="${build-osgi.dir}/org.scala-lang.scala-compiler.jar"/> + <pathelement location="${build-osgi.dir}/org.scala-lang.scala-actors.jar"/> + <path refid="pax.exam.classpath"/> + <path refid="forkjoin.classpath"/> + </path> - <target name="locker.unlock.comp" depends="locker.unlock.pre-comp" unless="locker.comp.available"> - <delete file="${build-locker.dir}/compiler.complete"/> - </target> + <path id="palo.bin.tool.path"> + <pathelement location="${build-palo.dir}/lib/scala-library.jar"/> + <pathelement location="${build-palo.dir}/lib/scala-reflect.jar"/> + <pathelement location="${build-palo.dir}/lib/scala-compiler.jar"/> + <pathelement location="${build-palo.dir}/lib/jline.jar"/> + </path> - <target name="locker.unlock" depends="locker.unlock.comp"> - <delete file="${build-locker.dir}/all.complete" /> + <path id="test.positions.sub.build.path" path="${build-quick.dir}/classes/library"/> + + <!-- TODO: consolidate *.includes --> + <patternset id="partest.includes"> + <include name="**/*.xml"/> + </patternset> + + <patternset id="lib.includes"> + <include name="**/*.tmpl"/> + <include name="**/*.xml"/> + <include name="**/*.js"/> + <include name="**/*.css"/> + </patternset> + + <patternset id="lib.rootdoc.includes"> + <include name="**/*.tmpl"/> + <include name="**/*.xml"/> + <include name="**/*.js"/> + <include name="**/*.css"/> + <include name="rootdoc.txt"/> + </patternset> + + <patternset id="comp.includes"> + <include name="**/*.tmpl"/> + <include name="**/*.xml"/> + <include name="**/*.js"/> + <include name="**/*.css"/> + <include name="**/*.html"/> + <include name="**/*.properties"/> + <include name="**/*.swf"/> + <include name="**/*.png"/> + <include name="**/*.gif"/> + <include name="**/*.txt"/> + </patternset> + + <taskdef resource="scala/tools/ant/sabbus/antlib.xml" classpathref="starr.compiler.path"/> </target> <!-- =========================================================================== -PACKED LOCKER BUILD (PALO) -============================================================================ --> + CLEANLINESS +=============================================================================--> + <target name="libs.clean"> <clean build="libs"/> <clean build="asm"/> </target> + <target name="quick.clean" depends="libs.clean"> <clean build="quick"/> <clean build="pack"/> <clean build="strap"/> </target> + <target name="palo.clean" depends="quick.clean"> <clean build="palo"/> </target> + <target name="locker.clean" depends="palo.clean"> <clean build="locker"/> </target> - <target name="palo.start" depends="locker.done"/> + <target name="docs.clean"> <clean build="docs"/> <delete dir="${build.dir}/manmaker" includeemptydirs="yes" quiet="yes" failonerror="no"/> </target> + <target name="dist.clean"> <delete dir="${dists.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/> </target> - <target name="palo.pre-lib" depends="palo.start"> - <uptodate - property="palo.lib.available" - targetfile="${build-palo.dir}/lib/scala-library.jar" - srcfile="${build-locker.dir}/library.complete"/> - </target> + <target name="all.clean" depends="locker.clean, docs.clean"> <clean build="sbt"/> <clean build="osgi"/> </target> - <target name="palo.lib" depends="palo.pre-lib" unless="palo.lib.available"> - <mkdir dir="${build-palo.dir}/lib"/> - <jar destfile="${build-palo.dir}/lib/scala-library.jar"> - <fileset dir="${build-locker.dir}/classes/library"/> - <fileset dir="${build-libs.dir}/classes/forkjoin"/> - </jar> - </target> + <!-- Used by the scala-installer script --> + <target name="allallclean" depends="all.clean, dist.clean"/> - <target name="palo.pre-reflect" depends="palo.lib"> - <uptodate - property="palo.reflect.available" - targetfile="${build-palo.dir}/lib/scala-reflect.jar" - srcfile="${build-locker.dir}/reflect.complete"/> - </target> + <macrodef name="clean"> + <attribute name="build"/> + <sequential> + <delete dir="${build-@{build}.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/> + </sequential> + </macrodef> - <target name="palo.reflect" depends="palo.pre-reflect" unless="palo.reflect.available"> - <mkdir dir="${build-palo.dir}/lib"/> - <jar destfile="${build-palo.dir}/lib/scala-reflect.jar" manifest="${basedir}/META-INF/MANIFEST.MF"> - <fileset dir="${build-locker.dir}/classes/reflect"/> - </jar> +<!-- =========================================================================== + LOCAL DEPENDENCY (Adapted ASM) +============================================================================ --> + <target name="asm.done" depends="init"> + <available file="${build-asm.dir}/asm.complete" property="asm.available"/> + <if><not><isset property="asm.available"/></not><then> + <stopwatch name="asm.lib.timer"/> + <mkdir dir="${build-asm.dir}/classes/"/> + <javac + srcdir="${src.dir}/asm" + destdir="${build-asm.dir}/classes" + classpath="${build-asm.dir}/classes" + includes="**/*.java" + target="1.6" source="1.5"> + <compilerarg line="${javac.args} -XDignore.symbol.file"/> + </javac> + <stopwatch name="asm.lib.timer" action="total"/> + <touch file="${build-asm.dir}/asm.complete" verbose="no"/> + </then></if> </target> - <target name="palo.pre-comp" depends="palo.reflect"> - <uptodate - property="palo.comp.available" - targetfile="${build-palo.dir}/lib/scala-compiler.jar" - srcfile="${build-locker.dir}/compiler.complete"/> +<!-- =========================================================================== + LOCAL DEPENDENCY (FORKJOIN) +============================================================================ --> + <target name="forkjoin.done" depends="init"> + <uptodate property="forkjoin.available" targetfile="${build-libs.dir}/forkjoin.complete"> + <srcfiles dir="${src.dir}/forkjoin"/></uptodate> + <if><not><isset property="forkjoin.available"/></not><then> + <stopwatch name="forkjoin.lib.timer"/> + <mkdir dir="${build-libs.dir}/classes/forkjoin"/> + <javac + fork="yes" + compiler="javac1.6" + srcdir="${src.dir}/forkjoin" + destdir="${build-libs.dir}/classes/forkjoin" + classpath="${build-libs.dir}/classes/forkjoin" + includes="**/*.java" + debug="true" + target="1.6" source="1.5"> + <compilerarg line="${javac.args} -XDignore.symbol.file"/> + </javac> + <jar whenmanifestonly="fail" destfile="${build-libs.dir}/forkjoin.jar" basedir="${build-libs.dir}/classes/forkjoin"/> + <stopwatch name="forkjoin.lib.timer" action="total"/> + <touch file="${build-libs.dir}/forkjoin.complete" verbose="no"/> + </then></if> </target> - <target name="palo.comp" depends="palo.pre-comp" unless="palo.comp.available"> - <mkdir dir="${build-palo.dir}/lib"/> - <jar destfile="${build-palo.dir}/lib/scala-compiler.jar" manifest="${basedir}/META-INF/MANIFEST.MF"> - <fileset dir="${build-locker.dir}/classes/compiler"/> - <fileset dir="${build-asm.dir}/classes/"/> - </jar> - <copy file="${jline.jar}" toDir="${build-palo.dir}/lib"/> - </target> +<!-- =========================================================================== + STAGED COMPILATION MACROS +============================================================================ --> + <macrodef name="staged-javac" > + <attribute name="stage"/> <!-- current stage (locker, quick, strap) --> + <attribute name="project"/> <!-- project: library/reflect/compiler/actors --> + <attribute name="destproject" default="@{project}"/> <!-- overrides the output directory; used when building multiple projects into the same directory--> + <attribute name="args" default=""/> + <attribute name="excludes" default=""/> + + <sequential> + <javac + srcdir="${src.dir}/@{project}" + destdir="${build-@{stage}.dir}/classes/@{destproject}" + includes="**/*.java" + excludes="@{excludes}" + target="1.6" source="1.5"> + <compilerarg line="${javac.args} @{args}"/> + <classpath refid="@{stage}.@{destproject}.build.path"/> + </javac> + </sequential> + </macrodef> + + <macrodef name="staged-scalac" > + <attribute name="with"/> <!-- will use path `@{with}.compiler.path` to locate scalac --> + <attribute name="stage"/> <!-- current stage (locker, quick, strap) --> + <attribute name="project"/> <!-- project: library/reflect/compiler/actors --> + <attribute name="srcpath" default="NOT SET"/> <!-- needed to compile the library --> + <attribute name="args" default=""/> <!-- additional args --> + <attribute name="destproject" default="@{project}"/> <!-- overrides the output directory; used when building multiple projects into the same directory--> + <attribute name="srcdir" default="@{project}"/> + <element name="args" implicit="true" optional="true"/> + + <sequential> + <if><equals arg1="@{srcpath}" arg2="NOT SET"/><then> + <scalacfork taskname="@{stage}.@{project}" + destdir="${build-@{stage}.dir}/classes/@{destproject}" + compilerpathref="@{with}.compiler.path" + params="${scalac.args.@{stage}} @{args}" + srcdir="${src.dir}/@{srcdir}" + jvmargs="${scalacfork.jvmargs}"> + <include name="**/*.scala"/> + <compilationpath refid="@{stage}.@{project}.build.path"/> + <args/> + </scalacfork></then> + <else> + <scalacfork taskname="@{stage}.@{project}" + destdir="${build-@{stage}.dir}/classes/@{destproject}" + compilerpathref="@{with}.compiler.path" + srcpath="@{srcpath}" + params="${scalac.args.@{stage}} @{args}" + srcdir="${src.dir}/@{srcdir}" + jvmargs="${scalacfork.jvmargs}"> + <include name="**/*.scala"/> + <compilationpath refid="@{stage}.@{project}.build.path"/> + <args/> + </scalacfork></else> + </if> + </sequential> + </macrodef> + + <macrodef name="staged-uptodate" > + <attribute name="stage"/> + <attribute name="project"/> + <element name="check"/> + <element name="do"/> + + <sequential> + <uptodate property="@{stage}.@{project}.available" targetfile="${build-@{stage}.dir}/@{project}.complete"> + <check/> + </uptodate> + <if><not><isset property="@{stage}.@{project}.available"/></not><then> + <do/> + <touch file="${build-@{stage}.dir}/@{project}.complete" verbose="no"/> + </then></if> + </sequential> + </macrodef> + + <macrodef name="staged-build" > + <attribute name="with"/> <!-- will use path `@{with}.compiler.path` to locate scalac --> + <attribute name="stage"/> <!-- current stage (locker, quick, strap) --> + <attribute name="project"/> <!-- project: library/reflect/compiler/actors --> + <attribute name="srcpath" default="NOT SET"/> <!-- needed to compile the library --> + <attribute name="args" default=""/> <!-- additional args --> + <attribute name="includes" default="comp.includes"/> + <attribute name="version" default=""/> <!-- non-empty for partest and scaladoc: use @{version}.version.number in property file--> + + <element name="pre" optional="true"/> + <element name="post" optional="true"/> + + <sequential> + <staged-uptodate stage="@{stage}" project="@{project}"> + <check><srcfiles dir="${src.dir}/@{project}"/></check> + <do> + <stopwatch name="@{stage}.@{project}.timer"/> + <mkdir dir="${build-@{stage}.dir}/classes/@{project}"/> + <pre/> + <staged-scalac with="@{with}" stage="@{stage}" project="@{project}" srcpath="@{srcpath}" args="@{args}"/> + <post/> + <if><equals arg1="@{version}" arg2=""/><then> + <propertyfile file = "${build-@{stage}.dir}/classes/@{project}/@{project}.properties"> + <entry key = "version.number" value="${version.number}"/> + <entry key = "maven.version.number" value="${maven.version.number}"/> + <entry key = "osgi.version.number" value="${osgi.version.number}"/> + <entry key = "copyright.string" value="${copyright.string}"/> + </propertyfile> + </then><else> + <propertyfile file = "${build-@{stage}.dir}/classes/@{project}/@{project}.properties"> + <entry key = "version.number" value="${@{version}.version.number}"/> + <entry key = "copyright.string" value="${copyright.string}"/> + </propertyfile> + </else></if> + <copy todir="${build-@{stage}.dir}/classes/@{project}"> + <fileset dir="${src.dir}/@{project}"> + <patternset refid="@{includes}"/> + </fileset> + </copy> + <stopwatch name="@{stage}.@{project}.timer" action="total"/> + </do> + </staged-uptodate> + </sequential> + </macrodef> + + <macrodef name="staged-bin"> + <attribute name="stage"/> + <attribute name="classpathref" default="NOT SET"/> + <sequential> + <staged-uptodate stage="@{stage}" project="bin"> + <check> + <srcfiles dir="${src.dir}"> + <include name="compiler/scala/tools/ant/templates/**"/> + </srcfiles> + </check> + <do> + <taskdef name="mk-bin" classname="scala.tools.ant.ScalaTool" classpathref="@{stage}.bin.tool.path"/> + <mkdir dir="${build-@{stage}.dir}/bin"/> + <if><equals arg1="@{classpathref}" arg2="NOT SET"/><then> + <mk-bin file="${build-@{stage}.dir}/bin/scala" class="scala.tools.nsc.MainGenericRunner" javaFlags="${java.flags}"/> + <mk-bin file="${build-@{stage}.dir}/bin/scalac" class="scala.tools.nsc.Main" javaFlags="${java.flags}"/> + <mk-bin file="${build-@{stage}.dir}/bin/scaladoc" class="scala.tools.nsc.ScalaDoc" javaFlags="${java.flags}"/> + <mk-bin file="${build-@{stage}.dir}/bin/fsc" class="scala.tools.nsc.CompileClient" javaFlags="${java.flags}"/> + <mk-bin file="${build-@{stage}.dir}/bin/scalap" class="scala.tools.scalap.Main" javaFlags="${java.flags}"/> + </then><else> + <mk-bin file="${build-@{stage}.dir}/bin/scala" class="scala.tools.nsc.MainGenericRunner" javaFlags="${java.flags}" classpathref="@{classpathref}"/> + <mk-bin file="${build-@{stage}.dir}/bin/scalac" class="scala.tools.nsc.Main" javaFlags="${java.flags}" classpathref="@{classpathref}"/> + <mk-bin file="${build-@{stage}.dir}/bin/scaladoc" class="scala.tools.nsc.ScalaDoc" javaFlags="${java.flags}" classpathref="@{classpathref}"/> + <mk-bin file="${build-@{stage}.dir}/bin/fsc" class="scala.tools.nsc.CompileClient" javaFlags="${java.flags}" classpathref="@{classpathref}"/> + <mk-bin file="${build-@{stage}.dir}/bin/scalap" class="scala.tools.scalap.Main" javaFlags="${java.flags}" classpathref="@{classpathref}"/> + </else></if> + <chmod perm="ugo+rx" file="${build-@{stage}.dir}/bin/scala"/> + <chmod perm="ugo+rx" file="${build-@{stage}.dir}/bin/scalac"/> + <chmod perm="ugo+rx" file="${build-@{stage}.dir}/bin/scaladoc"/> + <chmod perm="ugo+rx" file="${build-@{stage}.dir}/bin/fsc"/> + <chmod perm="ugo+rx" file="${build-@{stage}.dir}/bin/scalap"/> + </do> + </staged-uptodate> + </sequential> + </macrodef> + + <macrodef name="staged-pack"> + <attribute name="project"/> + <attribute name="targetdir" default="lib"/> + <attribute name="targetjar" default="scala-@{project}.jar"/> + <element name="do" implicit="true"/> + + <sequential> + <uptodate property="pack.@{project}.available" + targetfile="${build-pack.dir}/@{targetdir}/@{targetjar}" + srcfile="${build-quick.dir}/@{project}.complete"/> + <if><not><isset property="pack.@{project}.available"/></not><then> + <mkdir dir="${build-pack.dir}/@{targetdir}"/> + <do/> + </then></if> + </sequential> + </macrodef> + + <macrodef name="staged-docs"> + <attribute name="project"/> + <attribute name="dir" default="@{project}"/> + <attribute name="title"/> + <attribute name="docroot" default="NOT SET"/> + <element name="includes" implicit="true"/> + + <sequential> + <staged-uptodate stage="docs" project="@{project}"> + <check><srcfiles dir="${src.dir}/@{dir}"/></check> + <do> + <stopwatch name="docs.@{project}.timer"/> + <mkdir dir="${build-docs.dir}/@{project}"/> + <if><equals arg1="@{classpathref}" arg2="NOT SET"/><then> + <scaladoc + destdir="${build-docs.dir}/@{project}" + doctitle="@{title}" + docversion="${version.number}" + sourcepath="${src.dir}" + classpathref="pack.compiler.path" + srcdir="${src.dir}/@{dir}" + addparams="${scalac.args.all}" + implicits="on" + diagrams="on" + groups="on" + rawOutput="${scaladoc.raw.output}" + noPrefixes="${scaladoc.no.prefixes}"> + <includes/> + </scaladoc> + </then><else> + <scaladoc + destdir="${build-docs.dir}/@{project}" + doctitle="@{title}" + docversion="${version.number}" + sourcepath="${src.dir}" + classpathref="pack.compiler.path" + srcdir="${src.dir}/@{dir}" + docRootContent="${src.dir}/@{project}/@{docroot}" + addparams="${scalac.args.all}" + implicits="on" + diagrams="on" + groups="on" + rawOutput="${scaladoc.raw.output}" + noPrefixes="${scaladoc.no.prefixes}"> + <includes/> + </scaladoc> + </else></if> + <stopwatch name="docs.@{project}.timer" action="total"/> + </do> + </staged-uptodate> + </sequential> + </macrodef> - <target name="palo.done" depends="palo.comp"> - </target> +<!-- =========================================================================== + LOCAL REFERENCE BUILD (LOCKER) +============================================================================ --> + <target name="locker.start" depends="asm.done, forkjoin.done"> + <condition property="locker.locked"><available file="${build-locker.dir}/locker.locked"/></condition></target> - <target name="palo.clean" depends="quick.clean"> - <delete dir="${build-palo.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/> - </target> + <target name="locker.lib" depends="locker.start" unless="locker.locked"> + <staged-build with="starr" stage="locker" project="library" srcpath="${src.dir}/library" includes="lib.includes"> + <pre><staged-javac stage="locker" project="library" args="-XDignore.symbol.file"/></pre></staged-build></target> + <!-- TODO: args="-XDignore.symbol.file" necessary?? --> - <target name="palo.pre-bin" depends="palo.comp"> - <uptodate property="palo.bin.available" targetfile="${build-locker.dir}/bin.complete"> - <srcfiles dir="${src.dir}"> - <include name="compiler/scala/tools/ant/templates/**"/> - </srcfiles> - </uptodate> - </target> + <target name="locker.reflect" depends="locker.lib" unless="locker.locked"> <staged-build with="starr" stage="locker" project="reflect"/></target> + <target name="locker.comp" depends="locker.reflect" unless="locker.locked"> <staged-build with="starr" stage="locker" project="compiler"/></target> - <target name="palo.bin" depends="palo.pre-bin" unless="palo.bin.available"> - <taskdef name="palo-bin" classname="scala.tools.ant.ScalaTool"> - <classpath> - <pathelement location="${build-palo.dir}/lib/scala-library.jar"/> - <pathelement location="${build-palo.dir}/lib/scala-reflect.jar"/> - <pathelement location="${build-palo.dir}/lib/scala-compiler.jar"/> - <pathelement location="${build-palo.dir}/lib/jline.jar"/> - </classpath> - </taskdef> - <mkdir dir="${build-palo.dir}/bin"/> - <palo-bin - file="${build-palo.dir}/bin/scala" - class="scala.tools.nsc.MainGenericRunner" - javaFlags="${java.flags}"/> - <palo-bin - file="${build-palo.dir}/bin/scalac" - class="scala.tools.nsc.Main" - javaFlags="${java.flags}"/> - <palo-bin - file="${build-palo.dir}/bin/scaladoc" - class="scala.tools.nsc.ScalaDoc" - javaFlags="${java.flags}"/> - <palo-bin - file="${build-palo.dir}/bin/fsc" - class="scala.tools.nsc.CompileClient" - javaFlags="${java.flags}"/> - <palo-bin - file="${build-palo.dir}/bin/scalap" - class="scala.tools.scalap.Main" - javaFlags="${java.flags}"/> - <chmod perm="ugo+rx" file="${build-palo.dir}/bin/scala"/> - <chmod perm="ugo+rx" file="${build-palo.dir}/bin/scalac"/> - <chmod perm="ugo+rx" file="${build-palo.dir}/bin/scaladoc"/> - <chmod perm="ugo+rx" file="${build-palo.dir}/bin/fsc"/> - <chmod perm="ugo+rx" file="${build-palo.dir}/bin/scalap"/> - <touch file="${build-locker.dir}/bin.complete" verbose="no"/> + <target name="locker.done" depends="locker.comp"> + <mkdir dir="${build-locker.dir}"/> + <touch file="${build-locker.dir}/locker.locked" verbose="no"/> </target> + <target name="locker.unlock"> <delete file="${build-locker.dir}/locker.locked"/> + <delete file="${build-locker.dir}/*.complete"/></target> <!-- =========================================================================== -QUICK BUILD (QUICK) + 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="swing/**"/> - <include name="actors/**"/> - </srcfiles> - </uptodate> + <target name="quick.lib" depends="quick.start"> + <staged-build with="locker" stage="quick" project="library" srcpath="${src.dir}/library" includes="lib.rootdoc.includes"> + <pre> + <staged-javac stage="quick" project="library" args="-XDignore.symbol.file"/> <!-- TODO: args="-XDignore.symbol.file" necessary?? --> + <staged-javac stage="quick" project="actors" destproject="library"/> + </pre> + <post> + <staged-scalac with="locker" stage="quick" project="actors" destproject="library"/> + </post> + </staged-build> </target> - <target name="quick.lib" depends="quick.pre-lib" unless="quick.lib.available"> - <stopwatch name="quick.lib.timer"/> - <mkdir dir="${build-quick.dir}/classes/library"/> - <javac - srcdir="${src.dir}/library" - destdir="${build-quick.dir}/classes/library" - includes="**/*.java" - target="1.6" source="1.5"> - <compilerarg line="${javac.args} -XDignore.symbol.file"/> - <classpath> - <path refid="forkjoin.classpath"/> - <pathelement location="${build-quick.dir}/classes/library"/> - </classpath> - </javac> - <javac - srcdir="${src.dir}/actors" - destdir="${build-quick.dir}/classes/library" - includes="**/*.java" - target="1.6" source="1.5"> - <compilerarg line="${javac.args}"/> - <classpath> - <path refid="forkjoin.classpath"/> - <pathelement location="${build-quick.dir}/classes/library"/> - </classpath> - </javac> - <scalacfork - destdir="${build-quick.dir}/classes/library" - compilerpathref="locker.classpath" - srcpath="${src.dir}/library" - params="${scalac.args.quick}" - srcdir="${src.dir}/library" - jvmargs="${scalacfork.jvmargs}"> - <include name="**/*.scala"/> - <compilationpath refid="quick.compilation.path"/> - </scalacfork> - <scalacfork - destdir="${build-quick.dir}/classes/library" - compilerpathref="locker.classpath" - params="${scalac.args.quick}" - srcdir="${src.dir}/actors" - jvmargs="${scalacfork.jvmargs}"> - <include name="**/*.scala"/> - <compilationpath refid="quick.compilation.path"/> - </scalacfork> - <propertyfile file="${build-quick.dir}/classes/library/library.properties"> - <entry key="version.number" value="${version.number}"/> - <entry key="maven.version.number" value="${maven.version.number}"/> - <entry key="osgi.version.number" value="${osgi.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"/> - <include name="rootdoc.txt"/> - </fileset> - </copy> - <touch file="${build-quick.dir}/library.complete" verbose="no"/> - <stopwatch name="quick.lib.timer" action="total"/> - </target> + <target name="quick.reflect" depends="quick.lib"> <staged-build with="locker" stage="quick" project="reflect"/> </target> - <target name="quick.pre-reflect" depends="quick.lib"> - <uptodate property="quick.reflect.available" targetfile="${build-quick.dir}/reflect.complete"> - <srcfiles dir="${src.dir}"> - <include name="reflect/**"/> - </srcfiles> - </uptodate> + <target name="quick.comp" depends="quick.reflect"> + <staged-build with="locker" stage="quick" project="compiler"/> </target> - <target name="quick.reflect" depends="quick.pre-reflect" unless="quick.reflect.available"> - <stopwatch name="quick.reflect.timer"/> - <mkdir dir="${build-quick.dir}/classes/reflect"/> - <scalacfork - destdir="${build-quick.dir}/classes/reflect" - compilerpathref="locker.classpath" - params="${scalac.args.all}" - srcdir="${src.dir}/reflect" - jvmargs="${scalacfork.jvmargs}"> - <include name="**/*.scala"/> - <compilationpath> - <pathelement location="${build-quick.dir}/classes/library"/> - <pathelement location="${build-quick.dir}/classes/reflect"/> - <path refid="forkjoin.classpath"/> - <path refid="aux.libs"/> - <pathelement location="${jline.jar}"/> - </compilationpath> - </scalacfork> - <propertyfile file="${build-quick.dir}/classes/reflect/reflect.properties"> - <entry key="version.number" value="${version.number}"/> - <entry key="maven.version.number" value="${maven.version.number}"/> - <entry key="osgi.version.number" value="${osgi.version.number}"/> - <entry key="copyright.string" value="${copyright.string}"/> - </propertyfile> - <copy todir="${build-quick.dir}/classes/reflect"> - <fileset dir="${src.dir}/reflect"> - <include name="**/*.tmpl"/> - <include name="**/*.xml"/> - <include name="**/*.js"/> - <include name="**/*.html"/> - <include name="**/*.css"/> - <include name="**/*.properties"/> - <include name="**/*.swf"/> - <include name="**/*.png"/> - <include name="**/*.gif"/> - </fileset> - </copy> - <touch file="${build-quick.dir}/reflect.complete" verbose="no"/> - <stopwatch name="quick.reflect.timer" action="total"/> + <target name="quick.repl" depends="quick.comp"> + <staged-build with="locker" stage="quick" project="repl"> + <pre> + <staged-javac stage="quick" project="repl"/> + </pre> + </staged-build> </target> - <target name="quick.pre-comp" depends="quick.reflect"> - <uptodate property="quick.comp.available" targetfile="${build-quick.dir}/compiler.complete"> - <srcfiles dir="${src.dir}/compiler"/> - </uptodate> + <target name="quick.scalacheck" depends="quick.lib"> + <staged-build with="locker" stage="quick" project="scalacheck" args="-nowarn"/> </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"/> - <scalacfork - destdir="${build-quick.dir}/classes/compiler" - compilerpathref="locker.classpath" - params="${scalac.args.quick}" - srcdir="${src.dir}/compiler" - jvmargs="${scalacfork.jvmargs}"> - <include name="**/*.scala"/> - <compilationpath> - <pathelement location="${build-quick.dir}/classes/library"/> - <pathelement location="${build-quick.dir}/classes/reflect"/> - <pathelement location="${build-quick.dir}/classes/compiler"/> - <path refid="aux.libs"/> - <path refid="forkjoin.classpath"/> - <path refid="asm.classpath"/> - <pathelement location="${jline.jar}"/> - </compilationpath> - </scalacfork> - <propertyfile file="${build-quick.dir}/classes/compiler/compiler.properties"> - <entry key="version.number" value="${version.number}"/> - <entry key="maven.version.number" value="${maven.version.number}"/> - <entry key="osgi.version.number" value="${osgi.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"/> - <include name="**/*.html"/> - <include name="**/*.properties"/> - <include name="**/*.swf"/> - <include name="**/*.png"/> - <include name="**/*.gif"/> - <include name="**/*.txt"/> - </fileset> - </copy> - <touch file="${build-quick.dir}/compiler.complete" verbose="no"/> - <stopwatch name="quick.comp.timer" action="total"/> + <target name="quick.scalap" depends="quick.repl"> + <staged-build with="locker" stage="quick" project="scalap"/> </target> - <target name="quick.pre-repl" depends="quick.comp"> - <uptodate property="quick.repl.available" targetfile="${build-quick.dir}/repl.complete"> - <srcfiles dir="${src.dir}/repl" /> - </uptodate> + <target name="quick.partest" depends="quick.scalap, quick.repl, asm.done"> + <staged-build with="locker" stage="quick" project="partest" version="partest"> + <pre><staged-javac stage="quick" project="partest"/></pre> + </staged-build> </target> - <target name="quick.repl" depends="quick.pre-repl" unless="quick.repl.available"> - <mkdir dir="${build-quick.dir}/classes/repl"/> - <javac - srcdir="${src.dir}/repl" - destdir="${build-quick.dir}/classes/repl" - includes="**/*.java" - target="1.6" source="1.5"> - <compilerarg line="${javac.args} -XDignore.symbol.file"/> - </javac> - <scalacfork - destdir="${build-quick.dir}/classes/repl" - compilerpathref="quick.classpath" - params="${scalac.args.quick}" - srcdir="${src.dir}/repl" - jvmargs="${scalacfork.jvmargs}"> - <include name="**/*.scala"/> - <compilationpath> - <pathelement location="${build-quick.dir}/classes/library"/> - <pathelement location="${build-quick.dir}/classes/reflect"/> - <pathelement location="${build-quick.dir}/classes/compiler"/> - <pathelement location="${build-quick.dir}/classes/repl"/> - <pathelement location="${jline.jar}"/> - </compilationpath> - </scalacfork> - <touch file="${build-quick.dir}/repl.complete" verbose="no"/> + <target name="quick.scaladoc" depends="quick.comp, quick.partest"> + <staged-build with="locker" stage="quick" project="scaladoc" version="scaladoc"/> </target> - <target name="quick.swing" depends="quick.comp" if="has.java6" unless="quick.comp.available"> - <scalacfork - destdir="${build-quick.dir}/classes/library" - compilerpathref="locker.classpath" - params="${scalac.args.quick}" - srcdir="${src.dir}/swing" - jvmargs="${scalacfork.jvmargs}"> - <include name="**/*.scala"/> - <compilationpath refid="quick.compilation.path"/> - </scalacfork> + <target name="quick.interactive" depends="quick.comp, quick.scaladoc"> + <staged-build with="locker" stage="quick" project="interactive"/> </target> - <target name="quick.pre-plugins" depends="quick.repl" unless="quick.repl.available"> - <uptodate property="quick.plugins.available" targetfile="${build-quick.dir}/plugins.complete"> - <srcfiles dir="${src.dir}/continuations"/> - </uptodate> + <target name="quick.swing" depends="quick.lib" if="has.java6"> + <staged-build with="locker" stage="quick" project="swing"/> </target> - <target name="quick.plugins" depends="quick.pre-plugins" unless="quick.plugins.available"> - <stopwatch name="quick.plugins.timer"/> - <mkdir dir="${build-quick.dir}/classes/continuations-plugin"/> - <mkdir dir="${build-quick.dir}/classes/continuations-library"/> - <scalacfork - destdir="${build-quick.dir}/classes/continuations-plugin" - compilerpathref="quick.classpath" - params="${scalac.args.quick}" - srcdir="${src.dir}/continuations/plugin" - jvmargs="${scalacfork.jvmargs}"> - <include name="**/*.scala"/> - <compilationpath> - <pathelement location="${build-quick.dir}/classes/library"/> - <pathelement location="${build-quick.dir}/classes/reflect"/> - <pathelement location="${build-quick.dir}/classes/compiler"/> - <pathelement location="${build-quick.dir}/classes/continuations-plugin"/> - <path refid="forkjoin.classpath"/> - <path refid="aux.libs"/> - </compilationpath> - </scalacfork> - <copy - file="${src.dir}/continuations/plugin/scalac-plugin.xml" - todir="${build-quick.dir}/classes/continuations-plugin"/> - <!-- not very nice to create jar here but needed to load plugin --> - <mkdir dir="${build-quick.dir}/misc/scala-devel/plugins"/> - <jar destfile="${build-quick.dir}/misc/scala-devel/plugins/continuations.jar"> - <fileset dir="${build-quick.dir}/classes/continuations-plugin"/> - </jar> - <!-- might split off library part into its own ant target --> - <scalacfork - destdir="${build-quick.dir}/classes/continuations-library" - compilerpathref="quick.classpath" - params="${scalac.args.quick} -Xplugin-require:continuations -P:continuations:enable" - srcdir="${src.dir}/continuations/library" - jvmargs="${scalacfork.jvmargs}"> - <include name="**/*.scala"/> - <compilationpath refid="quick.compilation.path"/> - <compilerarg value="-Xpluginsdir"/> - <compilerarg file="${build-quick.dir}/misc/scala-devel/plugins"/> - </scalacfork> - <touch file="${build-quick.dir}/plugins.complete" verbose="no"/> - <stopwatch name="quick.plugins.timer" action="total"/> - </target> + <target name="quick.plugins" depends="quick.comp"> + <staged-uptodate stage="quick" project="plugins"> + <check><srcfiles dir="${src.dir}/continuations"/></check> + <do> + <stopwatch name="quick.plugins.timer"/> - <target name="quick.pre-scalacheck" depends="quick.plugins"> - <uptodate property="quick.scalacheck.available" targetfile="${build-quick.dir}/scalacheck.complete"> - <srcfiles dir="${src.dir}/scalacheck"/> - </uptodate> - </target> + <mkdir dir="${build-quick.dir}/classes/continuations-plugin"/> + <staged-scalac with="locker" stage="quick" project="plugins" srcdir="continuations/plugin" destproject="continuations-plugin"/> + <copy + file="${src.dir}/continuations/plugin/scalac-plugin.xml" + todir="${build-quick.dir}/classes/continuations-plugin"/> - <target name="quick.scalacheck" depends="quick.pre-scalacheck" unless="quick.scalacheck.available"> - <stopwatch name="quick.scalacheck.timer"/> - <mkdir dir="${build-quick.dir}/classes/scalacheck"/> - <scalacfork - destdir="${build-quick.dir}/classes/scalacheck" - compilerpathref="quick.classpath" - params="${scalac.args.quick} -nowarn" - srcdir="${src.dir}/scalacheck" - jvmargs="${scalacfork.jvmargs}"> - <include name="**/*.scala"/> - <compilationpath> - <pathelement location="${build-quick.dir}/classes/library"/> - <pathelement location="${build-quick.dir}/classes/scalacheck"/> - </compilationpath> - </scalacfork> - <touch file="${build-quick.dir}/scalacheck.complete" verbose="no"/> - <stopwatch name="quick.scalacheck.timer" action="total"/> - </target> + <!-- not very nice to create jar here but needed to load plugin --> + <mkdir dir="${build-quick.dir}/misc/scala-devel/plugins"/> + <jar whenmanifestonly="fail" destfile="${build-quick.dir}/misc/scala-devel/plugins/continuations.jar" basedir="${build-quick.dir}/classes/continuations-plugin"/> - <target name="quick.pre-scalap" depends="quick.scalacheck"> - <uptodate property="quick.scalap.available" targetfile="${build-quick.dir}/scalap.complete"> - <srcfiles dir="${src.dir}/scalap"/> - </uptodate> - </target> + <!-- might split off library part into its own ant target --> + <mkdir dir="${build-quick.dir}/classes/continuations-library"/> + <!-- have to compile with quick compiler here! --> + <staged-scalac with="quick" stage="quick" project="plugins" + srcdir="continuations/library" destproject="continuations-library" + args="-Xplugin-require:continuations -P:continuations:enable"> + <compilerarg value="-Xpluginsdir"/> + <compilerarg file="${build-quick.dir}/misc/scala-devel/plugins"/> + </staged-scalac> - <target name="quick.scalap" depends="quick.pre-scalap" unless="quick.scalap.available"> - <stopwatch name="quick.scalap.timer"/> - <mkdir dir="${build-quick.dir}/classes/scalap"/> - <scalacfork - destdir="${build-quick.dir}/classes/scalap" - compilerpathref="quick.classpath" - params="${scalac.args.quick}" - srcdir="${src.dir}/scalap" - jvmargs="${scalacfork.jvmargs}"> - <include name="**/*.scala"/> - <compilationpath> - <pathelement location="${build-quick.dir}/classes/library"/> - <pathelement location="${build-quick.dir}/classes/reflect"/> - <pathelement location="${build-quick.dir}/classes/compiler"/> - <pathelement location="${build-quick.dir}/classes/scalap"/> - <pathelement location="${build-quick.dir}/classes/partest"/> - <pathelement location="${ant.jar}"/> - <path refid="forkjoin.classpath"/> - </compilationpath> - </scalacfork> - <touch file="${build-quick.dir}/scalap.complete" verbose="no"/> - <stopwatch name="quick.scalap.timer" action="total"/> + <stopwatch name="quick.plugins.timer" action="total"/> + </do> + </staged-uptodate> </target> - <target name="quick.pre-partest" depends="quick.scalap, asm.done"> - <uptodate property="quick.partest.available" targetfile="${build-quick.dir}/partest.complete"> - <srcfiles dir="${src.dir}/partest"/> - </uptodate> + <target name="quick.bin" depends="init"> + <staged-bin stage="quick" classpathref="quick.bin.tool.path"/> </target> - <target name="quick.partest" depends="quick.pre-partest" unless="quick.partest.available"> - <stopwatch name="quick.partest.timer"/> - <mkdir dir="${build-quick.dir}/classes/partest"/> - <javac - srcdir="${src.dir}/partest" - destdir="${build-quick.dir}/classes/partest" - target="1.6" source="1.5"> - <classpath> - <pathelement location="${build-quick.dir}/classes/library"/> - <pathelement location="${build-quick.dir}/classes/reflect"/> - <pathelement location="${build-quick.dir}/classes/compiler"/> - <pathelement location="${build-quick.dir}/classes/repl"/> - <pathelement location="${build-quick.dir}/classes/scalap"/> - <pathelement location="${build-quick.dir}/classes/partest"/> - <path refid="asm.classpath"/> - </classpath> - <include name="**/*.java"/> - <compilerarg line="${javac.args}"/> - </javac> - <scalacfork - destdir="${build-quick.dir}/classes/partest" - compilerpathref="quick.classpath" - params="${scalac.args.quick}" - srcdir="${src.dir}/partest" - jvmargs="${scalacfork.jvmargs}"> - <include name="**/*.scala"/> - <compilationpath> - <pathelement location="${build-quick.dir}/classes/library"/> - <pathelement location="${build-quick.dir}/classes/reflect"/> - <pathelement location="${build-quick.dir}/classes/compiler"/> - <pathelement location="${build-quick.dir}/classes/repl"/> - <pathelement location="${build-quick.dir}/classes/scalap"/> - <pathelement location="${build-quick.dir}/classes/partest"/> - <pathelement location="${ant.jar}"/> - <path refid="forkjoin.classpath"/> - <path refid="asm.classpath"/> - <pathelement location="${scalacheck.jar}"/> - </compilationpath> - </scalacfork> - <propertyfile file="${build-quick.dir}/classes/partest/partest.properties"> - <entry key="version.number" value="${partest.version.number}"/> - <entry key="copyright.string" value="${copyright.string}"/> - </propertyfile> - <copy todir="${build-quick.dir}/classes/partest"> - <fileset dir="${src.dir}/partest"> - <include name="**/*.xml"/> - </fileset> - </copy> - <touch file="${build-quick.dir}/partest.complete" verbose="no"/> - <stopwatch name="quick.partest.timer" action="total"/> - </target> + <target name="quick.done" depends="quick.lib, quick.reflect, quick.comp, quick.repl, quick.scalacheck, quick.scalap, quick.interactive, quick.swing, quick.plugins, quick.partest, quick.scaladoc, quick.bin"/> + <target name="quick-opt" description="Optimized version of quick.done."> <optimized name="quick.done"/></target> - <target name="quick.pre-scaladoc" depends="quick.partest"> - <uptodate property="quick.scaladoc.available" targetfile="${build-quick.dir}/scaladoc.complete"> - <srcfiles dir="${src.dir}/scaladoc" /> - </uptodate> - </target> - - <target name="quick.scaladoc" depends="quick.pre-scaladoc" unless="quick.scaladoc.available"> - <mkdir dir="${build-quick.dir}/classes/scaladoc"/> - <scalacfork - destdir="${build-quick.dir}/classes/scaladoc" - compilerpathref="quick.classpath" - params="${scalac.args.quick}" - srcdir="${src.dir}/scaladoc" - jvmargs="${scalacfork.jvmargs}"> - <include name="**/*.scala"/> - <compilationpath> - <pathelement location="${build-quick.dir}/classes/library"/> - <pathelement location="${build-quick.dir}/classes/reflect"/> - <pathelement location="${build-quick.dir}/classes/compiler"/> - <pathelement location="${build-quick.dir}/classes/scalap"/> - <pathelement location="${build-quick.dir}/classes/partest"/> - <pathelement location="${build-quick.dir}/classes/scaladoc"/> - <pathelement location="${ant.jar}"/> - <path refid="forkjoin.classpath"/> - <pathelement location="${scalacheck.jar}"/> - </compilationpath> - </scalacfork> - <propertyfile file="${build-quick.dir}/classes/scaladoc/scaladoc.properties"> - <entry key="version.number" value="${scaladoc.version.number}"/> - <entry key="copyright.string" value="${copyright.string}"/> - </propertyfile> - <copy todir="${build-quick.dir}/classes/scaladoc"> - <fileset dir="${src.dir}/scaladoc"> - <include name="**/*.tmpl"/> - <include name="**/*.xml"/> - <include name="**/*.js"/> - <include name="**/*.css"/> - <include name="**/*.html"/> - <include name="**/*.properties"/> - <include name="**/*.swf"/> - <include name="**/*.png"/> - <include name="**/*.gif"/> - <include name="**/*.txt"/> - </fileset> - </copy> - <touch file="${build-quick.dir}/scaladoc.complete" verbose="no"/> - </target> - - <target name="quick.pre-interactive" depends="quick.scaladoc"> - <uptodate property="quick.interactive.available" targetfile="${build-quick.dir}/interactive.complete"> - <srcfiles dir="${src.dir}/interactive" /> - </uptodate> - </target> - - <target name="quick.interactive" depends="quick.pre-interactive" unless="quick.interactive.available"> - <mkdir dir="${build-quick.dir}/classes/interactive"/> - <scalacfork - destdir="${build-quick.dir}/classes/interactive" - compilerpathref="quick.classpath" - params="${scalac.args.quick}" - srcdir="${src.dir}/interactive" - jvmargs="${scalacfork.jvmargs}"> - <include name="**/*.scala"/> - <compilationpath> - <pathelement location="${build-quick.dir}/classes/library"/> - <pathelement location="${build-quick.dir}/classes/reflect"/> - <pathelement location="${build-quick.dir}/classes/compiler"/> - <pathelement location="${build-quick.dir}/classes/scalap"/> - <pathelement location="${build-quick.dir}/classes/partest"/> - <pathelement location="${build-quick.dir}/classes/scaladoc"/> - <pathelement location="${build-quick.dir}/classes/interactive"/> - <pathelement location="${ant.jar}"/> - <path refid="forkjoin.classpath"/> - <pathelement location="${scalacheck.jar}"/> - </compilationpath> - </scalacfork> - <touch file="${build-quick.dir}/interactive.complete" verbose="no"/> - </target> - - <target name="quick.pre-bin" depends="quick.interactive"> - <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/reflect"/> - <pathelement location="${build-quick.dir}/classes/compiler"/> - <pathelement location="${build-quick.dir}/classes/repl"/> - <pathelement location="${build-quick.dir}/classes/scalap"/> - <pathelement location="${build-quick.dir}/classes/continuations-library"/> - <pathelement location="${jline.jar}"/> - <path refid="asm.classpath"/> - <path refid="forkjoin.classpath"/> - <path refid="aux.libs"/> - </path> - <taskdef name="quick-bin" classname="scala.tools.ant.ScalaTool" classpathref="quick.bin.classpath"/> - <mkdir dir="${build-quick.dir}/bin"/> - <quick-bin - file="${build-quick.dir}/bin/scala" - class="scala.tools.nsc.MainGenericRunner" - javaFlags="${java.flags}" - classpathref="quick.bin.classpath"/> - <quick-bin - file="${build-quick.dir}/bin/scalac" - class="scala.tools.nsc.Main" - javaFlags="${java.flags}" - classpathref="quick.bin.classpath"/> - <quick-bin - file="${build-quick.dir}/bin/scaladoc" - class="scala.tools.nsc.ScalaDoc" - javaFlags="${java.flags}" - classpathref="quick.bin.classpath"/> - <quick-bin - file="${build-quick.dir}/bin/fsc" - class="scala.tools.nsc.CompileClient" - javaFlags="${java.flags}" - classpathref="quick.bin.classpath"/> - <quick-bin - file="${build-quick.dir}/bin/scalap" - class="scala.tools.scalap.Main" - 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"/> - <chmod perm="ugo+rx" file="${build-quick.dir}/bin/scalap"/> - <touch file="${build-quick.dir}/bin.complete" verbose="no"/> - </target> - - <target name="quick.done" depends="quick.bin"> - <path id="quick.classpath"> - <pathelement location="${build-quick.dir}/classes/library"/> - <pathelement location="${build-quick.dir}/classes/reflect"/> - <pathelement location="${build-quick.dir}/classes/compiler"/> - <path refid="asm.classpath"/> - <path refid="aux.libs"/> - </path> - </target> - - <target name="quick.clean" depends="libs.clean"> - <delete dir="${build-quick.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/> - </target> <!-- =========================================================================== -PACKED QUICK BUILD (PACK) + PACKED QUICK BUILD (PACK) ============================================================================ --> - - <target name="pack.start" depends="quick.done"/> - - <target name="pack.pre-lib" depends="pack.start"> - <uptodate - property="pack.lib.available" - targetfile="${build-pack.dir}/lib/scala-library.jar" - srcfile="${build-quick.dir}/library.complete"/> - </target> - - <target name="pack.lib" depends="pack.pre-lib" unless="pack.lib.available"> - <mkdir dir="${build-pack.dir}/lib"/> - <!-- First copy maven dependencies --> - <copy todir="${build-pack.dir}/lib"> - <fileset refid="dependency.fileset" /> - <mapper type="flatten" /> - </copy> - <jar destfile="${build-pack.dir}/lib/scala-library.jar"> - <fileset dir="${build-quick.dir}/classes/library"> - <exclude name="scala/swing/**"/> - <exclude name="scala/actors/**"/> - </fileset> - <fileset dir="${build-quick.dir}/classes/continuations-library"/> - <fileset dir="${build-libs.dir}/classes/forkjoin"/> - </jar> - <jar destfile="${build-pack.dir}/lib/scala-actors.jar"> - <fileset dir="${build-quick.dir}/classes/library"> - <include name="scala/actors/**"/> - </fileset> - </jar> + <target name="pack.lib" depends="quick.lib, quick.plugins, forkjoin.done"> + <staged-pack project="library"> + <!-- First copy maven dependencies --> + <copy todir="${build-pack.dir}/lib"> + <fileset refid="dependency.fileset" /> + <mapper type="flatten" /> + </copy> + <jar whenmanifestonly="fail" destfile="${build-pack.dir}/lib/scala-library.jar"> + <fileset dir="${build-quick.dir}/classes/library"> + <exclude name="scala/swing/**"/> + <exclude name="scala/actors/**"/> + </fileset> + <fileset dir="${build-quick.dir}/classes/continuations-library"/> + <fileset dir="${build-libs.dir}/classes/forkjoin"/> + </jar> + <jar whenmanifestonly="fail" destfile="${build-pack.dir}/lib/scala-actors.jar"> + <fileset dir="${build-quick.dir}/classes/library"> + <include name="scala/actors/**"/> + </fileset> + </jar> + </staged-pack> + </target> + + <target name="pack.swing" depends="quick.swing" if="has.java6"> + <staged-pack project="swing’"> + <jar whenmanifestonly="fail" destfile="${build-pack.dir}/lib/scala-swing.jar" basedir="${build-quick.dir}/classes/swing"/> + </staged-pack> + </target> + + <target name="pack.reflect" depends="quick.reflect"> + <staged-pack project="reflect’"> + <jar whenmanifestonly="fail" destfile="${build-pack.dir}/lib/scala-reflect.jar" basedir="${build-quick.dir}/classes/reflect"/> + </staged-pack> + </target> + + <target name="pack.comp" depends="quick.comp, quick.scaladoc, quick.interactive, quick.repl, asm.done"> + <staged-pack project="compiler"> + <mkdir dir="${build-pack.dir}/META-INF"/> + <copy file="META-INF/MANIFEST.MF" toDir="${build-pack.dir}/META-INF"/> + <manifest file="${build-pack.dir}/META-INF/MANIFEST.MF" mode="update"> + <attribute name="Bundle-Version" value="${version.number}"/> + <attribute name="Class-Path" value="scala-reflect.jar scala-library.jar"/> + </manifest> + <jar whenmanifestonly="fail" destfile="${build-pack.dir}/lib/scala-compiler.jar" manifest="${build-pack.dir}/META-INF/MANIFEST.MF"> + <service type="javax.script.ScriptEngineFactory" provider="scala.tools.nsc.interpreter.IMain$Factory"/> + <fileset dir="${build-quick.dir}/classes/compiler"/> + <fileset dir="${build-quick.dir}/classes/scaladoc"/> + <fileset dir="${build-quick.dir}/classes/interactive"/> + <fileset dir="${build-quick.dir}/classes/repl"/> + <fileset dir="${build-asm.dir}/classes"/> + </jar> + <copy file="${jline.jar}" toDir="${build-pack.dir}/lib"/> + <copy todir="${build-pack.dir}/lib"> + <fileset dir="${lib-extra.dir}"> + <include name="**/*.jar"/> + </fileset> + </copy> + </staged-pack> </target> - <target name="pack.swing" depends="pack.lib" if="has.java6"> - <jar destfile="${build-pack.dir}/lib/scala-swing.jar"> - <fileset dir="${build-quick.dir}/classes/library"> - <include name="scala/swing/**"/> - </fileset> - </jar> + <target name="pack.plugins" depends="quick.plugins"> + <staged-pack project="plugins" targetdir="misc/scala-devel/plugins" targetjar="continuations.jar"> + <jar whenmanifestonly="fail" destfile="${build-pack.dir}/misc/scala-devel/plugins/continuations.jar" basedir="${build-quick.dir}/classes/continuations-plugin"/> + </staged-pack> </target> - <target name="pack.pre-reflect" depends="pack.lib, pack.swing"> - <uptodate - property="pack.reflect.available" - targetfile="${build-pack.dir}/lib/scala-reflect.jar" - srcfile="${build-quick.dir}/reflect.complete"/> + <target name="pack.scalacheck" depends="quick.scalacheck"> + <uptodate property="pack.scalacheck.available" + targetfile="${build-pack.dir}/lib/scalacheck.jar"> + <srcfiles dir="${build-quick.dir}/classes/scalacheck"/></uptodate> + <if><not><isset property="pack.scalacheck.available"/></not><then> + <jar whenmanifestonly="fail" destfile="${build-pack.dir}/lib/scalacheck.jar" basedir="${build-quick.dir}/classes/scalacheck"/> + </then></if> </target> - <target name="pack.reflect" depends="pack.pre-reflect" unless="pack.reflect.available"> - <mkdir dir="${build-pack.dir}/lib"/> - <jar destfile="${build-pack.dir}/lib/scala-reflect.jar"> - <fileset dir="${build-quick.dir}/classes/reflect" /> - </jar> + <target name="pack.partest" depends="quick.partest"> + <staged-pack project="partest"> + <jar whenmanifestonly="fail" destfile="${build-pack.dir}/lib/scala-partest.jar"> + <fileset dir="${build-quick.dir}/classes/partest"> + <exclude name="scala/tools/partest/javaagent/**"/> + </fileset> + </jar> + <jar whenmanifestonly="fail" destfile = "${build-pack.dir}/lib/scala-partest-javaagent.jar" + manifest = "${src.dir}/partest/scala/tools/partest/javaagent/MANIFEST.MF"> + <fileset dir = "${build-quick.dir}/classes/partest"> + <include name = "scala/tools/partest/javaagent/**"/> + </fileset> + </jar> + </staged-pack> </target> - <target name="pack.pre-comp" depends="pack.reflect"> - <uptodate - property="pack.comp.available" - targetfile="${build-pack.dir}/lib/scala-compiler.jar" - srcfile="${build-quick.dir}/compiler.complete"/> - </target> - - <target name="pack.comp" depends="pack.pre-comp" unless="pack.comp.available"> - <mkdir dir="${build-pack.dir}/META-INF"/> - <copy file="META-INF/MANIFEST.MF" toDir="${build-pack.dir}/META-INF"/> - <manifest file="${build-pack.dir}/META-INF/MANIFEST.MF" mode="update"> - <attribute name="Bundle-Version" value="${version.number}"/> - <attribute name="Class-Path" value="scala-reflect.jar scala-library.jar"/> - </manifest> - <mkdir dir="${build-pack.dir}/lib"/> - <jar destfile="${build-pack.dir}/lib/scala-compiler.jar" manifest="${build-pack.dir}/META-INF/MANIFEST.MF"> - <service type="javax.script.ScriptEngineFactory" provider="scala.tools.nsc.interpreter.IMain$Factory"/> - <fileset dir="${build-quick.dir}/classes/compiler"/> - <fileset dir="${build-quick.dir}/classes/scaladoc"/> - <fileset dir="${build-quick.dir}/classes/interactive"/> - <fileset dir="${build-quick.dir}/classes/repl"/> - <fileset dir="${build-asm.dir}/classes"/> - </jar> - <copy file="${jline.jar}" toDir="${build-pack.dir}/lib"/> - <copy todir="${build-pack.dir}/lib"> - <fileset dir="${lib-extra.dir}"> - <include name="**/*.jar"/> - </fileset> - </copy> + <target name="pack.scalap" depends="quick.scalap"> + <staged-pack project="plugins" targetjar="scalap.jar"> + <jar whenmanifestonly="fail" destfile="${build-pack.dir}/lib/scalap.jar"> + <fileset dir="${build-quick.dir}/classes/scalap"/> + <fileset file="${src.dir}/scalap/decoder.properties"/> + </jar> + </staged-pack> </target> - <target name="pack.pre-plugins" depends="pack.comp"> - <uptodate - property="pack.plugins.available" - targetfile="${build-pack.dir}/misc/scala-devel/plugins/continuations.jar" - srcfile="${build-quick.dir}/plugins.complete"/> + <target name="pack.bin" depends="pack.comp, pack.lib, pack.partest, pack.plugins, pack.reflect, pack.scalacheck, pack.scalap, pack.swing"> + <staged-bin stage="pack"/> </target> - <target name="pack.plugins" depends="pack.pre-plugins" unless="pack.plugins.available"> - <mkdir dir="${build-pack.dir}/misc/scala-devel/plugins"/> - <jar destfile="${build-pack.dir}/misc/scala-devel/plugins/continuations.jar"> - <fileset dir="${build-quick.dir}/classes/continuations-plugin"/> - </jar> + <target name="pack.done" depends="pack.bin"> + <taskdef resource="scala/tools/ant/antlib.xml" classpathref="pack.compiler.path"/> + <taskdef resource="scala/tools/partest/antlib.xml" classpathref="pack.compiler.path"/> </target> - <target name="pack.scalacheck" depends="pack.plugins"> - <jar destfile="${build-pack.dir}/lib/scalacheck.jar"> - <fileset dir="${build-quick.dir}/classes/scalacheck"/> - </jar> - </target> - <target name="pack.pre-partest" depends="pack.scalacheck"> - <uptodate - property="pack.partest.available" - targetfile="${build-pack.dir}/lib/scala-partest.jar" - srcfile="${build-quick.dir}/partest.complete"/> +<!-- =========================================================================== + BOOTSTRAPPING BUILD (STRAP) +============================================================================ --> + <target name="strap.lib" depends="quick.done"> + <staged-build with="quick" stage="strap" project="library" srcpath="${src.dir}/library" includes="lib.rootdoc.includes"> + <pre> + <staged-javac stage="strap" project="library" args="-XDignore.symbol.file"/> <!-- TODO: args="-XDignore.symbol.file" necessary?? --> + <staged-javac stage="strap" project="actors" destproject="library"/> + </pre> + <post> + <staged-scalac with="quick" stage="strap" project="actors" destproject="library"/> + </post> + </staged-build> </target> - <target name="pack.partest" depends="pack.pre-partest" unless="pack.partest.available"> - <mkdir dir="${build-pack.dir}/lib"/> - <jar destfile="${build-pack.dir}/lib/scala-partest.jar"> - <fileset dir="${build-quick.dir}/classes/partest"> - <exclude name="scala/tools/partest/javaagent/**"/> - </fileset> - </jar> - <jar destfile="${build-pack.dir}/lib/scala-partest-javaagent.jar" manifest="${src.dir}/partest/scala/tools/partest/javaagent/MANIFEST.MF"> - <fileset dir="${build-quick.dir}/classes/partest"> - <include name="scala/tools/partest/javaagent/**"/> - </fileset> - </jar> - </target> + <target name="strap.reflect" depends="strap.lib"> <staged-build with="pack" stage="strap" project="reflect"/> </target> + <target name="strap.comp" depends="strap.reflect"> <staged-build with="pack" stage="strap" project="compiler"/> </target> + <target name="strap.done" depends="strap.comp"/> + <target name="strap-opt" description="Optimized version of strap.done."> <optimized name="strap.done"/></target> - <target name="pack.pre-scalap" depends="pack.partest"> - <uptodate - property="pack.scalap.available" - targetfile="${build-pack.dir}/lib/scalap.jar" - srcfile="${build-quick.dir}/scalap.complete"/> - </target> - <target name="pack.scalap" depends="pack.pre-scalap" unless="pack.scalap.available"> - <mkdir dir="${build-pack.dir}/lib"/> - <jar destfile="${build-pack.dir}/lib/scalap.jar"> - <fileset dir="${build-quick.dir}/classes/scalap"/> - <fileset file="${src.dir}/scalap/decoder.properties"/> +<!-- =========================================================================== + PACKED LOCKER BUILD (PALO) +============================================================================ --> + <target name="palo.done" depends="locker.done"> + <mkdir dir="${build-palo.dir}/lib"/> + <jar whenmanifestonly="fail" destfile="${build-palo.dir}/lib/scala-library.jar"> + <fileset dir="${build-locker.dir}/classes/library"/> + <fileset dir="${build-libs.dir}/classes/forkjoin"/> </jar> + <jar whenmanifestonly="fail" destfile="${build-palo.dir}/lib/scala-reflect.jar" manifest="${basedir}/META-INF/MANIFEST.MF" + basedir="${build-locker.dir}/classes/reflect"/> + <jar whenmanifestonly="fail" destfile="${build-palo.dir}/lib/scala-compiler.jar" manifest="${basedir}/META-INF/MANIFEST.MF"> + <fileset dir="${build-locker.dir}/classes/compiler"/> + <fileset dir="${build-asm.dir}/classes/"/> + </jar> + <copy file="${jline.jar}" toDir="${build-palo.dir}/lib"/> </target> - <target name="pack.pre-bin" depends="pack.scalap"> - <uptodate - property="pack.bin.available" - srcfile="${build-pack.dir}/lib/scala-compiler.jar" - targetfile="${build-pack.dir}/bin.complete"/> - </target> - - <target name="pack.bin" depends="pack.pre-bin" unless="pack.bin.available"> - <taskdef name="pack-bin" classname="scala.tools.ant.ScalaTool"> - <classpath> - <pathelement location="${build-pack.dir}/lib/scala-library.jar"/> - <pathelement location="${build-pack.dir}/lib/scala-reflect.jar"/> - <pathelement location="${build-pack.dir}/lib/scala-compiler.jar"/> - <pathelement location="${build-pack.dir}/lib/jline.jar"/> - </classpath> - </taskdef> - <mkdir dir="${build-pack.dir}/bin"/> - <pack-bin - file="${build-pack.dir}/bin/scala" - class="scala.tools.nsc.MainGenericRunner" - javaFlags="${java.flags}"/> - <pack-bin - file="${build-pack.dir}/bin/scalac" - class="scala.tools.nsc.Main" - javaFlags="${java.flags}"/> - <pack-bin - file="${build-pack.dir}/bin/scaladoc" - class="scala.tools.nsc.ScalaDoc" - javaFlags="${java.flags}"/> - <pack-bin - file="${build-pack.dir}/bin/fsc" - class="scala.tools.nsc.CompileClient" - javaFlags="${java.flags}"/> - <pack-bin - file="${build-pack.dir}/bin/scalap" - class="scala.tools.scalap.Main" - javaFlags="${java.flags}"/> - <chmod perm="ugo+rx" file="${build-pack.dir}/bin/scala"/> - <chmod perm="ugo+rx" file="${build-pack.dir}/bin/scalac"/> - <chmod perm="ugo+rx" file="${build-pack.dir}/bin/scaladoc"/> - <chmod perm="ugo+rx" file="${build-pack.dir}/bin/fsc"/> - <chmod perm="ugo+rx" file="${build-pack.dir}/bin/scalap"/> - <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-reflect.jar"/> - <pathelement location="${build-pack.dir}/lib/scala-compiler.jar"/> - <pathelement location="${build-pack.dir}/lib/scala-partest.jar"/> - <pathelement location="${build-pack.dir}/lib/scalap.jar"/> - <pathelement location="${build-pack.dir}/lib/scala-actors.jar"/> - <pathelement location="${ant.jar}"/> - <pathelement location="${jline.jar}"/> - <path refid="lib.extra"/> - </path> - <path id="partest.classpath"> - <path refid="pack.classpath"/> - <fileset dir="${partest.dir}/files/lib" includes="*.jar" /> - <pathelement location="${pack.dir}/lib/scala-swing.jar"/> <!-- TODO - segregate swing tests (there can't be many) --> - </path> - <taskdef resource="scala/tools/ant/antlib.xml" classpathref="pack.classpath"/> - <taskdef resource="scala/tools/partest/antlib.xml" classpathref="pack.classpath"/> - </target> + <target name="palo.bin" depends="palo.done"> <staged-bin stage="palo"/></target> - <target name="pack.clean" depends="strap.clean"> - <delete dir="${build-pack.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/> - </target> <!-- =========================================================================== -OSGi Artifacts + OSGi Artifacts ============================================================================ --> - - <target name="osgi.init" depends="pack.done"> + <target name="osgi.done" depends="pack.done"> <mkdir dir="${build-osgi.dir}"/> - <property name="osgi.test.src" value="${partest.dir}/osgi/src"/> - <property name="osgi.test.classes" value="${build-osgi.dir}/classes"/> - <!-- simplify fixing pom versions --> <macrodef name="make-bundle"> <attribute name="name" /> @@ -1709,664 +1250,120 @@ OSGi Artifacts output="${build-osgi.dir}"/> </sequential> </macrodef> + <uptodate property="osgi.bundles.available" targetfile="${build-osgi.dir}/bundles.complete"> <srcfiles dir="${basedir}"> <include name="build.xml"/> <include name="src/build/bnd/*.bnd"/> </srcfiles> </uptodate> - </target> - <target name="osgi.bundles" depends="osgi.init" unless="osgi.bundles.available"> - <stopwatch name="osgi.bundle.timer"/> - <make-bundle name="scala-library" version="${osgi.version.number}" /> - <make-bundle name="scala-actors" version="${osgi.version.number}" /> - <make-bundle name="scala-reflect" version="${osgi.version.number}" /> - <make-bundle name="scala-compiler" version="${osgi.version.number}" /> - <make-plugin-bundle name="continuations" version="${osgi.version.number}" /> - <touch file="${build-osgi.dir}/bundles.complete" verbose="no"/> - <stopwatch name="osgi.bundle.timer" action="total"/> + <if><not><isset property="osgi.bundles.available"/></not><then> + <stopwatch name="osgi.bundle.timer"/> + <make-bundle name="scala-library" version="${osgi.version.number}" /> + <make-bundle name="scala-actors" version="${osgi.version.number}" /> + <make-bundle name="scala-reflect" version="${osgi.version.number}" /> + <make-bundle name="scala-compiler" version="${osgi.version.number}" /> + <make-plugin-bundle name="continuations" version="${osgi.version.number}" /> + <touch file="${build-osgi.dir}/bundles.complete" verbose="no"/> + + <if><isset property="has.java6"/><then> + <make-bundle name="scala-swing" version="${osgi.version.number}"/></then> + </if> + <stopwatch name="osgi.bundle.timer" action="total"/></then> + </if> </target> - <target name="osgi.bundles.swing" depends="osgi.init" if="has.java6" unless="osgi.bundles.available"> - <!-- TODO - only if JDK6 --> - <make-bundle name="scala-swing" version="${osgi.version.number}"/> - </target> - <target name="osgi.done" depends="osgi.bundles, osgi.bundles.swing"/> +<!-- =========================================================================== + TEST SUITE +============================================================================ --> + <!-- bootstrapping stability: compare {quick,strap}/(lib|reflect|comp) --> + <target name="test.stability" depends="quick.lib, quick.reflect, quick.comp, strap.lib, strap.reflect, strap.comp"> + <exec osfamily="unix" vmlauncher="false" executable="${basedir}/tools/stability-test.sh" failonerror="true" /> + <!-- I think doing it this way means it will auto-pass on windows... that's the idea. If not, something like this. --> + <!-- <exec osfamily="windows" executable="foo" failonerror="false" failifexecutionfails="false" /> --> + </target> - <target name="osgi.test.init" depends="osgi.done"> - <path id="osgi.bundle.classpath"> - <pathelement location="${build-osgi.dir}/org.scala-lang.scala-library.jar"/> - <pathelement location="${build-osgi.dir}/org.scala-lang.scala-reflect.jar"/> - <pathelement location="${build-osgi.dir}/org.scala-lang.scala-compiler.jar"/> - <pathelement location="${build-osgi.dir}/org.scala-lang.scala-actors.jar"/> - </path> + <target name="test.stability-opt" description="Optimized version of test.stability."> <optimized name="test.stability"/></target> - <uptodate property="osgi.test.available" targetfile="${build-osgi.dir}/test-compile.complete"> - <srcfiles dir="${osgi.test.src}"> + <target name="test.osgi.init" depends="osgi.done"> + <uptodate property="test.osgi.available" targetfile="${build-osgi.dir}/test-compile.complete"> + <srcfiles dir="${test.osgi.src}"> <include name="**/*.scala"/> </srcfiles> </uptodate> </target> - <target name="osgi.test.comp" depends="osgi.test.init, quick.done" unless="osgi.test.available"> - <stopwatch name="osgi.test.comp.timer"/> - <mkdir dir="${osgi.test.classes}"/> + <target name="test.osgi.comp" depends="test.osgi.init, quick.done" unless="test.osgi.available"> + <stopwatch name="test.osgi.compiler.timer"/> + <mkdir dir="${test.osgi.classes}"/> <scalacfork - destdir="${osgi.test.classes}" - compilerpathref="quick.classpath" + destdir="${test.osgi.classes}" + compilerpathref="quick.compiler.path" params="${scalac.args.quick}" - srcdir="${osgi.test.src}" + srcdir="${test.osgi.src}" jvmargs="${scalacfork.jvmargs}"> <include name="**/*.scala"/> - <compilationpath> - <pathelement location="${osgi.test.classes}"/> - <path refid="osgi.bundle.classpath"/> - <path refid="pax.exam.classpath"/> - <path refid="forkjoin.classpath"/> - </compilationpath> + <compilationpath refid="test.osgi.compiler.build.path"/> </scalacfork> <touch file="${build-osgi.dir}/test-compile.complete" verbose="no"/> - <stopwatch name="osgi.test.comp.timer" action="total"/> + <stopwatch name="test.osgi.compiler.timer" action="total"/> </target> - <target name="osgi.test" depends="osgi.test.comp"> - <stopwatch name="osgi.test.timer"/> - <mkdir dir="${osgi.test.classes}"/> + <target name="test.osgi" depends="test.osgi.comp"> + <stopwatch name="test.osgi.timer"/> + <mkdir dir="${test.osgi.classes}"/> <junit fork="yes" haltonfailure="yes"> - <classpath> - <pathelement location="${osgi.test.classes}"/> - <path refid="osgi.bundle.classpath"/> - <path refid="pax.exam.classpath"/> - <path refid="forkjoin.classpath"/> - </classpath> + <classpath refid="test.osgi.compiler.build.path"/> <batchtest fork="yes" todir="${build-osgi.dir}"> - <fileset dir="${osgi.test.classes}"> + <fileset dir="${test.osgi.classes}"> <include name="**/*Test.class"/> </fileset> </batchtest> - <formatter type="brief" usefile="false" /> + <formatter type="brief" /> <!-- silenced by having it use a file; I tried for an hour to use other formatters but classpath issues drove me to this usefile="false" --> </junit> - <stopwatch name="osgi.test.timer" action="total"/> - </target> - - <target name="osgi.clean"> - <delete dir="${build-osgi.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/> - </target> - -<!-- =========================================================================== -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="swing/**"/> - <include name="actors/**"/> - </srcfiles> - </uptodate> - </target> - - <target name="strap.lib" depends="strap.pre-lib" unless="strap.lib.available"> - <stopwatch name="strap.lib.timer"/> - <mkdir dir="${build-strap.dir}/classes/library"/> - <javac - srcdir="${src.dir}/library" - destdir="${build-strap.dir}/classes/library" - includes="**/*.java" - target="1.6" source="1.5"> - <compilerarg line="${javac.args} -XDignore.symbol.file"/> - <classpath> - <path refid="forkjoin.classpath"/> - <pathelement location="${build-strap.dir}/classes/library"/> - </classpath> - </javac> - <javac - srcdir="${src.dir}/actors" - destdir="${build-strap.dir}/classes/library" - includes="**/*.java" - target="1.6" source="1.5"> - <compilerarg line="${javac.args}"/> - <classpath> - <path refid="forkjoin.classpath"/> - <pathelement location="${build-strap.dir}/classes/library"/> - </classpath> - </javac> - <scalacfork - destdir="${build-strap.dir}/classes/library" - compilerpathref="pack.classpath" - srcpath="${src.dir}/library" - params="${scalac.args.strap}" - srcdir="${src.dir}/library" - jvmargs="${scalacfork.jvmargs}"> - <include name="**/*.scala"/> - <compilationpath refid="strap.compilation.path"/> - </scalacfork> - <scalacfork - destdir="${build-strap.dir}/classes/library" - compilerpathref="pack.classpath" - params="${scalac.args.strap}" - srcdir="${src.dir}/actors" - jvmargs="${scalacfork.jvmargs}"> - <include name="**/*.scala"/> - <compilationpath refid="strap.compilation.path"/> - </scalacfork> - <propertyfile file="${build-strap.dir}/classes/library/library.properties"> - <entry key="version.number" value="${version.number}"/> - <entry key="maven.version.number" value="${maven.version.number}"/> - <entry key="osgi.version.number" value="${osgi.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-reflect" depends="strap.lib"> - <uptodate property="strap.reflect.available" targetfile="${build-strap.dir}/reflect.complete"> - <srcfiles dir="${src.dir}"> - <include name="reflect/**"/> - </srcfiles> - </uptodate> - </target> - - <target name="strap.reflect" depends="strap.pre-reflect" unless="strap.reflect.available"> - <stopwatch name="strap.reflect.timer"/> - <mkdir dir="${build-strap.dir}/classes/reflect"/> - <scalacfork - destdir="${build-strap.dir}/classes/reflect" - compilerpathref="pack.classpath" - params="${scalac.args.all}" - srcdir="${src.dir}/reflect" - jvmargs="${scalacfork.jvmargs}"> - <include name="**/*.scala"/> - <compilationpath> - <pathelement location="${build-strap.dir}/classes/library"/> - <pathelement location="${build-strap.dir}/classes/reflect"/> - <path refid="forkjoin.classpath"/> - <path refid="aux.libs"/> - <pathelement location="${jline.jar}"/> - </compilationpath> - </scalacfork> - <propertyfile file="${build-strap.dir}/classes/reflect/reflect.properties"> - <entry key="version.number" value="${version.number}"/> - <entry key="maven.version.number" value="${maven.version.number}"/> - <entry key="osgi.version.number" value="${osgi.version.number}"/> - <entry key="copyright.string" value="${copyright.string}"/> - </propertyfile> - <copy todir="${build-strap.dir}/classes/reflect"> - <fileset dir="${src.dir}/reflect"> - <include name="**/*.tmpl"/> - <include name="**/*.xml"/> - <include name="**/*.js"/> - <include name="**/*.css"/> - <include name="**/*.html"/> - <include name="**/*.properties"/> - <include name="**/*.swf"/> - <include name="**/*.png"/> - <include name="**/*.gif"/> - <include name="**/*.txt"/> - </fileset> - </copy> - <touch file="${build-strap.dir}/reflect.complete" verbose="no"/> - <stopwatch name="strap.reflect.timer" action="total"/> - </target> - - <target name="strap.pre-comp" depends="strap.reflect"> - <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"/> - <scalacfork - destdir="${build-strap.dir}/classes/compiler" - compilerpathref="pack.classpath" - params="${scalac.args.strap}" - srcdir="${src.dir}/compiler" - jvmargs="${scalacfork.jvmargs}"> - <include name="**/*.scala"/> - <compilationpath> - <pathelement location="${build-strap.dir}/classes/library"/> - <pathelement location="${build-strap.dir}/classes/reflect"/> - <pathelement location="${build-strap.dir}/classes/compiler"/> - <path refid="aux.libs"/> - <path refid="forkjoin.classpath"/> - <path refid="asm.classpath"/> - <pathelement location="${jline.jar}"/> - </compilationpath> - </scalacfork> - <propertyfile file="${build-strap.dir}/classes/compiler/compiler.properties"> - <entry key="version.number" value="${version.number}"/> - <entry key="maven.version.number" value="${maven.version.number}"/> - <entry key="osgi.version.number" value="${osgi.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"/> - <include name="**/*.html"/> - <include name="**/*.properties"/> - <include name="**/*.swf"/> - <include name="**/*.png"/> - <include name="**/*.gif"/> - <include name="**/*.txt"/> - </fileset> - </copy> - <touch file="${build-strap.dir}/compiler.complete" verbose="no"/> - <stopwatch name="strap.comp.timer" action="total"/> + <stopwatch name="test.osgi.timer" action="total"/> </target> - <target name="strap.done" depends="strap.comp"/> - - <target name="strap.clean"> - <delete dir="${build-strap.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/> - </target> <!-- =========================================================================== -LIBRARIES (Forkjoin, ASM) + SBT Compiler Interface ============================================================================ --> - - - <target name="libs.clean" depends="pack.clean, asm.clean"> - <delete dir="${build-libs.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/> - </target> - -<!-- =========================================================================== -SBT Compiler Interface -============================================================================ --> - - <target name="sbt.start" depends="init"> - <!-- TODO - Put this in init? Allow this to be overriden simply --> - <property name="sbt.latest.version" value="0.12.2"/> - - - <property name="sbt.src.dir" value="${build-sbt.dir}/${sbt.latest.version}/src"/> - <property name="sbt.lib.dir" value="${build-sbt.dir}/${sbt.latest.version}/lib"/> - - - - <property name="sbt.interface.jar" value="${sbt.lib.dir}/interface.jar"/> - <property name="sbt.interface.url" value="http://typesafe.artifactoryonline.com/typesafe/ivy-releases/org.scala-sbt/interface/${sbt.latest.version}/jars/interface.jar"/> - <property name="sbt.interface.src.jar" value="${sbt.src.dir}/compiler-interface-src.jar"/> - <property name="sbt.interface.src.url" value="http://typesafe.artifactoryonline.com/typesafe/ivy-releases/org.scala-sbt/compiler-interface/${sbt.latest.version}/jars/compiler-interface-src.jar"/> - - <!-- Ensure directories exist --> - <mkdir dir="${sbt.src.dir}"/> - <mkdir dir="${sbt.lib.dir}"/> - - <condition property="sbt.available"> - <and> + <target name="test.sbt" depends="quick.done"> + <if><not><and> <available file="${sbt.interface.jar}"/> - <available file="${sbt.interface.src.jar}"/> - </and> - </condition> + <available file="${sbt.interface.src.jar}"/></and></not> + <then> + <!-- Ensure directories exist --> + <mkdir dir="${sbt.src.dir}"/> + <mkdir dir="${sbt.lib.dir}"/> - </target> + <get src="${sbt.interface.url}" dest="${sbt.interface.jar}"/> + <get src="${sbt.interface.src.url}" dest="${sbt.interface.src.jar}"/> - <target name="sbt.libs" depends="sbt.start" unless="sbt.available"> - <get src="${sbt.interface.url}" dest="${sbt.interface.jar}"/> - <get src="${sbt.interface.src.url}" dest="${sbt.interface.src.jar}"/> - <!-- Explode sources --> - <unzip src="${sbt.interface.src.jar}" dest="${sbt.src.dir}"/> - </target> + <!-- Explode sources --> + <unzip src="${sbt.interface.src.jar}" dest="${sbt.src.dir}"/> + </then></if> - <target name="sbt.compile" depends="sbt.libs,quick.done"> <stopwatch name="quick.sbt-interface.timer"/> <mkdir dir="${build-sbt.dir}/classes"/> <scalacfork destdir="${build-sbt.dir}/classes" - compilerpathref="quick.classpath" + compilerpathref="quick.compiler.path" params="${scalac.args.quick}" srcdir="${sbt.src.dir}" jvmargs="${scalacfork.jvmargs}"> <include name="**/*.scala"/> - <compilationpath> - <pathelement location="${build-quick.dir}/classes/library"/> - <pathelement location="${build-quick.dir}/classes/reflect"/> - <pathelement location="${build-quick.dir}/classes/compiler"/> - <pathelement location="${build-quick.dir}/classes/scaladoc"/> - <pathelement location="${build-quick.dir}/classes/interactive"/> - <pathelement location="${build-quick.dir}/classes/repl"/> - <pathelement location="${sbt.interface.jar}"/> - <path refid="forkjoin.classpath"/> - </compilationpath> + <compilationpath refid="sbt.compile.build.path"/> </scalacfork> <touch file="${build-sbt.dir}/sbt-interface.complete" verbose="no"/> <stopwatch name="quick.sbt-interface.timer" action="total"/> </target> - <target name="sbt.done" depends="sbt.compile"> - </target> + <property name="partest.srcdir" value="files" /> <!-- TODO: make targets for `pending` and other subdirs --> - <target name="sbt.clean" depends="init"> - <delete dir="${build-sbt.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/> - </target> - -<!-- =========================================================================== -DOCUMENTATION -============================================================================ --> - - <target name="docs.start" depends="pack.done"> - <macrodef name="doc-uptodate-check"> - <attribute name="name" /> - <attribute name="srcdir" /> - <element name="source-includes" optional="yes" /> - <sequential> - <uptodate property="docs.@{name}.available" targetfile="${build-docs.dir}/@{name}.complete"> - <srcfiles dir="@{srcdir}"> - <source-includes/> - </srcfiles> - </uptodate> - </sequential> - </macrodef> - - <!-- Set the github commit scaladoc sources point to --> - <!-- For releases, look for the tag with the same name as the maven version --> - <condition property="scaladoc.git.commit" value="v${maven.version.number}"> - <isset property="build.release"/> - </condition> - <!-- For snapshots, if we know the commit, point scaladoc to that particular commit instead of master --> - <condition property="scaladoc.git.commit" value="${git.commit.sha}"> - <not><equals arg1="${git.commit.sha}" arg2="unknown"/></not> - </condition> - <!-- Fallback: point scaladoc to master --> - <property name="scaladoc.git.commit" value="master"/> - <!-- Compute the URL and show it --> - <property name="scaladoc.url" value="https://github.com/scala/scala/tree/${scaladoc.git.commit}/src"/> - <echo message="Scaladoc will point to ${scaladoc.url} for source files."/> - - <!-- Unless set with -Dscaladoc.<...>, these won't be activated --> - <property name="scaladoc.raw.output" value="no"/> - <property name="scaladoc.no.prefixes" value="no"/> - </target> - - <target name="docs.pre-lib" depends="docs.start"> - <doc-uptodate-check name="library" srcdir="${src.dir}"> - <source-includes> - <include name="library/**"/> - <include name="swing/**"/> - <include name="actors/**"/> - <include name="reflect/**"/> - </source-includes> - </doc-uptodate-check> - </target> - - <target name="docs.lib" depends="docs.pre-lib" unless="docs.library.available"> - <stopwatch name="docs.lib.timer"/> - <mkdir dir="${build-docs.dir}/library"/> - <scaladoc - destdir="${build-docs.dir}/library" - doctitle="Scala Standard Library API (Scaladoc)" - docversion="${version.number}" - docfooter="epfl" - docsourceurl="${scaladoc.url}€{FILE_PATH}.scala#L1" - docUncompilable="${src.dir}/library-aux" - skipPackages="scala.reflect.macros.internal:scala.reflect.internal:scala.reflect.io:scala.concurrent.impl" - sourcepath="${src.dir}" - classpathref="pack.classpath" - addparams="${scalac.args.all}" - docRootContent="${src.dir}/library/rootdoc.txt" - implicits="on" - diagrams="on" - groups="on" - rawOutput="${scaladoc.raw.output}" - noPrefixes="${scaladoc.no.prefixes}"> - <src> - <files includes="${src.dir}/actors"/> - <files includes="${src.dir}/library"/> - <files includes="${src.dir}/reflect"/> - <files includes="${src.dir}/swing"/> - <files includes="${src.dir}/continuations/library"/> - </src> - <include name="**/*.scala"/> - <exclude name="reflect/Code.scala"/> - <exclude name="reflect/Print.scala"/> - <exclude name="reflect/Symbol.scala"/> - <exclude name="reflect/Tree.scala"/> - <exclude name="reflect/Type.scala"/> - <exclude name="runtime/*$.scala"/> - <exclude name="runtime/ScalaRunTime.scala"/> - <exclude name="runtime/StringAdd.scala"/> - </scaladoc> - <touch file="${build-docs.dir}/library.complete" verbose="no"/> - <stopwatch name="docs.lib.timer" action="total"/> - </target> - - <target name="docs.pre-man" depends="docs.lib"> - <doc-uptodate-check name="manual" srcdir="${src.dir}/manual"/> - </target> - - <target name="docs.manmaker" depends="docs.pre-man" unless="docs.manual.available"> - <mkdir dir="${build.dir}/manmaker/classes"/> - <scalac - destdir="${build.dir}/manmaker/classes" - classpathref="pack.classpath" - srcdir="${src.dir}/manual" - includes="**/*.scala" - addparams="${scalac.args.all}"/> - <path id="manual.classpath"> - <pathelement location="${build-pack.dir}/lib/scala-library.jar"/> - <pathelement location="${build.dir}/manmaker/classes"/> - </path> - </target> - - <target name="docs.man" depends="docs.manmaker" unless="docs.manual.available"> - <mkdir dir="${build-docs.dir}/manual/man/man1"/> - <mkdir dir="${build-docs.dir}/manual/html"/> - <mkdir dir="${build-docs.dir}/manual/genman/man1"/> - <taskdef name="genman" - classname="scala.tools.docutil.ManMaker" - classpathref="manual.classpath"/> - <genman command="fsc, scala, scalac, scaladoc, scalap" - htmlout="${build-docs.dir}/manual/html" - manout="${build-docs.dir}/manual/genman"/> - <!-- On Windows source and target files can't be the same ! --> - <fixcrlf - srcdir="${build-docs.dir}/manual/genman" - destdir="${build-docs.dir}/manual/man" - eol="unix" includes="**/*.1"/> - <copy todir="${build-docs.dir}/manual/html"> - <fileset dir="${src.dir}/manual/scala/tools/docutil/resources"> - <include name="**/*.html"/> - <include name="**/*.css"/> - <include name="**/*.gif"/> - <include name="**/*.png"/> - </fileset> - </copy> - <touch file="${build-docs.dir}/manual.complete" verbose="no"/> - </target> - - <target name="docs.pre-comp" depends="docs.man"> - <doc-uptodate-check name="compiler" srcdir="${src.dir}/compiler"/> - </target> - - <target name="docs.comp" depends="docs.pre-comp" unless="docs.compiler.available"> - <stopwatch name="docs.comp.timer"/> - <mkdir dir="${build-docs.dir}/compiler"/> - <scaladoc - destdir="${build-docs.dir}/compiler" - doctitle="Scala Compiler" - docversion="${version.number}" - docsourceurl="${scaladoc.url}€{FILE_PATH}.scala#L1" - sourcepath="${src.dir}" - classpathref="pack.classpath" - srcdir="${src.dir}/compiler" - docRootContent="${src.dir}/compiler/rootdoc.txt" - addparams="${scalac.args.all}" - implicits="on" - diagrams="on" - groups="on" - rawOutput="${scaladoc.raw.output}" - noPrefixes="${scaladoc.no.prefixes}"> - <include name="**/*.scala"/> - </scaladoc> - <touch file="${build-docs.dir}/compiler.complete" verbose="no"/> - <stopwatch name="docs.comp.timer" action="total"/> - </target> - - <target name="docs.pre-jline" depends="docs.start"> - <doc-uptodate-check name="jline" srcdir="${src.dir}/jline/src/main/java" /> - </target> - - <target name="docs.jline" depends="docs.pre-jline" unless="docs.jline.available"> - <stopwatch name="docs.jline.timer"/> - <mkdir dir="${build-docs.dir}/jline"/> - <scaladoc - destdir="${build-docs.dir}/jline" - doctitle="Scala JLine" - docversion="${version.number}" - sourcepath="${src.dir}" - classpathref="pack.classpath" - srcdir="${src.dir}/jline/src/main/java" - addparams="${scalac.args.all}" - implicits="on" - diagrams="on" - groups="on" - rawOutput="${scaladoc.raw.output}" - noPrefixes="${scaladoc.no.prefixes}"> - <include name="**/*.scala"/> - <include name="**/*.java"/> - </scaladoc> - <touch file="${build-docs.dir}/jline.complete" verbose="no"/> - <stopwatch name="docs.jline.timer" action="total"/> - </target> - - <target name="docs.pre-scalap" depends="docs.start"> - <doc-uptodate-check name="scalap" srcdir="${src.dir}/scalap" /> - </target> - - <target name="docs.scalap" depends="docs.pre-scalap" unless="docs.scalap.available"> - <stopwatch name="docs.scalap.timer"/> - <mkdir dir="${build-docs.dir}/scalap"/> - <scaladoc - destdir="${build-docs.dir}/scalap" - doctitle="Scalap" - docversion="${version.number}" - docsourceurl="${scaladoc.url}€{FILE_PATH}.scala#L1" - sourcepath="${src.dir}" - classpathref="pack.classpath" - srcdir="${src.dir}/scalap" - addparams="${scalac.args.all}" - implicits="on" - diagrams="on" - groups="on" - rawOutput="${scaladoc.raw.output}" - noPrefixes="${scaladoc.no.prefixes}"> - <include name="**/*.scala"/> - </scaladoc> - <touch file="${build-docs.dir}/scalap.complete" verbose="no"/> - <stopwatch name="docs.scalap.timer" action="total"/> - </target> - - <target name="docs.pre-partest" depends="docs.start"> - <doc-uptodate-check name="partest" srcdir="${src.dir}/partest" /> - </target> - - <target name="docs.partest" depends="docs.pre-partest" unless="docs.partest.available"> - <stopwatch name="docs.partest.timer"/> - <mkdir dir="${build-docs.dir}/scala-partest"/> - <scaladoc - destdir="${build-docs.dir}/scala-partest" - doctitle="Scala Parallel Testing Framework" - docversion="${version.number}" - sourcepath="${src.dir}" - classpathref="pack.classpath" - srcdir="${src.dir}/partest" - addparams="${scalac.args.all}" - implicits="on" - diagrams="on" - groups="on" - rawOutput="${scaladoc.raw.output}" - noPrefixes="${scaladoc.no.prefixes}"> - <include name="**/*.scala"/> - </scaladoc> - <touch file="${build-docs.dir}/partest.complete" verbose="no"/> - <stopwatch name="docs.partest.timer" action="total"/> - </target> - - <target name="docs.pre-continuations-plugin" depends="docs.start"> - <doc-uptodate-check name="continuations-plugin" srcdir="${src.dir}/continuations/plugin" /> - </target> - - <target name="docs.continuations-plugin" depends="docs.pre-continuations-plugin" unless="docs.continuations-plugin.available"> - <stopwatch name="docs.continuations-plugin.timer"/> - <mkdir dir="${build-docs.dir}/continuations-plugin"/> - <scaladoc - destdir="${build-docs.dir}/continuations-plugin" - doctitle="Delimited Continuations Compiler Plugin" - docversion="${version.number}" - sourcepath="${src.dir}" - classpathref="pack.classpath" - srcdir="${src.dir}/continuations/plugin" - addparams="${scalac.args.all}" - implicits="on" - diagrams="on" - groups="on" - rawOutput="${scaladoc.raw.output}" - noPrefixes="${scaladoc.no.prefixes}"> - <include name="**/*.scala"/> - </scaladoc> - <touch file="${build-docs.dir}/continuations-plugin.complete" verbose="no"/> - <stopwatch name="docs.continuations-plugin.timer" action="total"/> - </target> - - <target name="docs.done" depends="docs.man"/> - - <target name="docs.all" depends="docs.jline, docs.comp, docs.man, docs.lib, docs.scalap, docs.partest, docs.continuations-plugin"/> - - <target name="docs.clean"> - <delete dir="${build-docs.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/> - <delete dir="${build.dir}/manmaker" includeemptydirs="yes" quiet="yes" failonerror="no"/> - </target> - -<!-- =========================================================================== -BOOTRAPING TEST AND TEST SUITE -============================================================================ --> - - <target name="test.stability" depends="pack.done, strap.done"> - <exec osfamily="unix" vmlauncher="false" executable="${basedir}/tools/stability-test.sh" failonerror="true" /> - <!-- I think doing it this way means it will auto-pass on windows... that's the idea. If not, something like this. --> - <!-- <exec osfamily="windows" executable="foo" failonerror="false" failifexecutionfails="false" /> --> - </target> - - <target name="test.classload" depends="pack.done"> - <!-- TODO - Add actors + reflect to this --> - <classloadVerify classpath="${build-pack.dir}/lib/scala-library.jar" /> - </target> - - <!-- this target will run only those tests found in test/debug --> - <target name="test.sbt" depends="sbt.done"> - </target> - - <!-- this target will run only those tests found in test/debug --> - <target name="test.debug"> - <antcall target="test.suite"> - <param name="partest.srcdir" value="debug" /> - </antcall> - </target> - - <target name="test.pre-run" depends="pack.done"> - <property name="partest.srcdir" value="files" /> - </target> - - <target name="test.run" depends="test.pre-run"> + <target name="test.run" depends="pack.done"> <partest showlog="yes" erroronfailed="yes" javacmd="${java.home}/bin/java" timeout="1200000" srcdir="${partest.srcdir}" @@ -2378,18 +1375,7 @@ BOOTRAPING TEST AND TEST SUITE </partest> </target> - <target name="test.ant" depends="test.pre-run"> - <property name="partest.srcdir" value="files" /> - <partest showlog="yes" erroronfailed="yes" javacmd="${java.home}/bin/java" - srcdir="${partest.srcdir}" - scalacopts="${scalac.args.optimise}"> - <compilationpath refid="partest.classpath"/> - <anttests dir="${partest.dir}/${partest.srcdir}/ant" includes="*build.xml"/> - </partest> - </target> - - <target name="test.suite" depends="test.pre-run"> - <property name="partest.srcdir" value="files" /> + <target name="test.suite" depends="pack.done"> <partest showlog="yes" erroronfailed="yes" javacmd="${java.home}/bin/java" timeout="2400000" srcdir="${partest.srcdir}" @@ -2413,8 +1399,7 @@ BOOTRAPING TEST AND TEST SUITE </partest> </target> - <target name="test.continuations.suite" depends="test.pre-run"> - <property name="partest.srcdir" value="files" /> + <target name="test.continuations.suite" depends="pack.done"> <partest showlog="yes" erroronfailed="yes" javacmd="${java.home}/bin/java" timeout="2400000" srcdir="${partest.srcdir}" @@ -2427,7 +1412,7 @@ BOOTRAPING TEST AND TEST SUITE </partest> </target> - <target name="test.scaladoc" depends="test.pre-run"> + <target name="test.scaladoc" depends="pack.done"> <partest erroronfailed="yes" scalacopts="${scalac.args.optimise}" showlog="yes"> <compilationpath refid="partest.classpath"/> <runtests dir="${partest.dir}/scaladoc/run" includes="*.scala" /> @@ -2435,7 +1420,7 @@ BOOTRAPING TEST AND TEST SUITE </partest> </target> - <target name="test.interactive" depends="test.pre-run"> + <target name="test.interactive" depends="pack.done"> <partest erroronfailed="yes" scalacopts="${scalac.args.optimise}" showlog="yes"> <compilationpath refid="partest.classpath"/> <presentationtests dir="${partest.dir}/${partest.srcdir}/presentation"> @@ -2444,14 +1429,14 @@ BOOTRAPING TEST AND TEST SUITE </partest> </target> - <target name="test.done" depends="test.suite, test.continuations.suite, test.scaladoc, test.interactive, test.stability, test.sbt"/> +<!-- currently disabled: test.ant, test.bc, test.positions, test.classload --> + <target name="test.done" depends="test.osgi, test.sbt, test.interactive, test.continuations.suite, test.suite, test.scaladoc, test.stability"/> <!-- =========================================================================== -Binary compatibility testing + BINARY COMPATIBILITY TESTING ============================================================================ --> - - <target name="bc.init" depends="init"> + <target name="bc.init" depends="init" unless="maven-deps-done-mima"> <property name="bc-build.dir" value="${build.dir}/bc"/> <!-- Obtain mima --> <mkdir dir="${bc-build.dir}"/> @@ -2463,9 +1448,10 @@ Binary compatibility testing <dependency groupId="org.scala-lang" artifactId="scala-library" version="2.10.0-RC2"/> <dependency groupId="org.scala-lang" artifactId="scala-reflect" version="2.10.0-RC2"/> </artifact:dependencies> + <property name="maven-deps-done-mima" value="true"/> </target> - <target name="bc.run" depends="bc.init, pack.lib"> + <target name="test.bc" depends="bc.init, pack.lib"> <java fork="true" failonerror="true" @@ -2492,12 +1478,156 @@ Binary compatibility testing </java> </target> - <!-- =========================================================================== -DISTRIBUTION + DOCUMENTATION ============================================================================ --> + <target name="docs.start" depends="pack.done"> + <!-- Set the github commit scaladoc sources point to --> + <!-- For releases, look for the tag with the same name as the maven version --> + <condition property="scaladoc.git.commit" value="v${maven.version.number}"> + <isset property="build.release"/> + </condition> + <!-- For snapshots, if we know the commit, point scaladoc to that particular commit instead of master --> + <condition property="scaladoc.git.commit" value="${git.commit.sha}"> + <not><equals arg1="${git.commit.sha}" arg2="unknown"/></not> + </condition> + <!-- Fallback: point scaladoc to master --> + <property name="scaladoc.git.commit" value="master"/> + <!-- Compute the URL and show it --> + <property name="scaladoc.url" value="https://github.com/scala/scala/tree/${scaladoc.git.commit}/src"/> + <echo message="Scaladoc will point to ${scaladoc.url} for source files."/> + + <!-- Unless set with -Dscaladoc.<...>, these won't be activated --> + <property name="scaladoc.raw.output" value="no"/> + <property name="scaladoc.no.prefixes" value="no"/> + </target> + + <target name="docs.lib" depends="docs.start"> + <staged-uptodate stage="docs" project="library"> + <check><srcfiles dir="${src.dir}"> + <include name="library/**"/> + <include name="swing/**"/> + <include name="actors/**"/> + <include name="reflect/**"/> + </srcfiles></check> + <do> + <stopwatch name="docs.lib.timer"/> + <mkdir dir="${build-docs.dir}/library"/> + <!-- last three attributes not supported by staged-docs: --> + <scaladoc + destdir="${build-docs.dir}/library" + doctitle="Scala Standard Library API (Scaladoc)" + docversion="${version.number}" + docsourceurl="${scaladoc.url}€{FILE_PATH}.scala#L1" + sourcepath="${src.dir}" + classpathref="pack.compiler.path" + addparams="${scalac.args.all}" + docRootContent="${src.dir}/library/rootdoc.txt" + implicits="on" + diagrams="on" + groups="on" + rawOutput="${scaladoc.raw.output}" + noPrefixes="${scaladoc.no.prefixes}" + docfooter="epfl" + docUncompilable="${src.dir}/library-aux" + skipPackages="scala.reflect.macros.internal:scala.reflect.internal:scala.reflect.io:scala.concurrent.impl"> + <src> + <files includes="${src.dir}/actors"/> + <files includes="${src.dir}/library"/> + <files includes="${src.dir}/reflect"/> + <files includes="${src.dir}/swing"/> + <files includes="${src.dir}/continuations/library"/> + </src> + <include name="**/*.scala"/> + <exclude name="reflect/Code.scala"/> + <exclude name="reflect/Print.scala"/> + <exclude name="reflect/Symbol.scala"/> + <exclude name="reflect/Tree.scala"/> + <exclude name="reflect/Type.scala"/> + <exclude name="runtime/*$.scala"/> + <exclude name="runtime/ScalaRunTime.scala"/> + <exclude name="runtime/StringAdd.scala"/> + </scaladoc> + <stopwatch name="docs.lib.timer" action="total"/> + </do> + </staged-uptodate> + </target> + + <target name="docs.comp" depends="docs.start"> + <staged-docs project="compiler" title="Scala Compiler" docroot="rootdoc.txt"> + <include name="**/*.scala"/> + </staged-docs> + </target> - <target name="dist.start" depends="pack.done, osgi.done"> + <target name="docs.jline" depends="docs.start"> + <staged-docs project="jline" dir="jline/src/main/java" title="Scala JLine"> + <include name="**/*.scala"/> + <include name="**/*.java"/> + </staged-docs> + </target> + + <target name="docs.scalap" depends="docs.start"> + <staged-docs project="scalap" title="Scalap"> + <include name="**/*.scala"/> + </staged-docs> + </target> + + <target name="docs.partest" depends="docs.start"> + <staged-docs project="partest" title="Scala Parallel Testing Framework"> + <include name="**/*.scala"/> + </staged-docs> + </target> + + <target name="docs.continuations-plugin" depends="docs.start"> + <staged-docs project="continuations-plugin" dir="continuations/plugin" title="Delimited Continuations Compiler Plugin"> + <include name="**/*.scala"/> + </staged-docs> + </target> + + <target name="docs.man" depends="docs.start"> + <staged-uptodate stage="docs" project="manual"> + <check><srcfiles dir="${src.dir}/manual"/></check> + <do> + <mkdir dir="${build.dir}/manmaker/classes"/> + <scalac + destdir="${build.dir}/manmaker/classes" + classpathref="pack.compiler.path" + srcdir="${src.dir}/manual" + includes="**/*.scala" + addparams="${scalac.args.all}"/> + <mkdir dir="${build-docs.dir}/manual/man/man1"/> + <mkdir dir="${build-docs.dir}/manual/html"/> + <mkdir dir="${build-docs.dir}/manual/genman/man1"/> + <taskdef name="genman" + classname="scala.tools.docutil.ManMaker" + classpathref="manual.classpath"/> + <genman command="fsc, scala, scalac, scaladoc, scalap" + htmlout="${build-docs.dir}/manual/html" + manout="${build-docs.dir}/manual/genman"/> + <!-- On Windows source and target files can't be the same ! --> + <fixcrlf + srcdir="${build-docs.dir}/manual/genman" + destdir="${build-docs.dir}/manual/man" + eol="unix" includes="**/*.1"/> + <copy todir="${build-docs.dir}/manual/html"> + <fileset dir="${src.dir}/manual/scala/tools/docutil/resources"> + <include name="**/*.html"/> + <include name="**/*.css"/> + <include name="**/*.gif"/> + <include name="**/*.png"/> + </fileset> + </copy> + </do> + </staged-uptodate> + </target> + + <target name="docs.done" depends="docs.jline, docs.comp, docs.man, docs.lib, docs.scalap, docs.partest, docs.continuations-plugin"/> + + +<!-- =========================================================================== + DISTRIBUTION +============================================================================ --> + <target name="dist.base" depends="pack.done, osgi.done"> <property name="dist.name" value="scala-${version.number}"/> <property name="dist.dir" value="${dists.dir}/${dist.name}"/> @@ -2516,9 +1646,7 @@ DISTRIBUTION overwrite="yes"/> </sequential> </macrodef> - </target> - <target name="dist.base" depends="dist.start"> <mkdir dir="${dist.dir}/lib"/> <copy toDir="${dist.dir}/lib"> <fileset dir="${build-pack.dir}/lib"> @@ -2569,70 +1697,40 @@ DISTRIBUTION toFile="${dist.dir}/doc/scala-devel-docs/README.scala-swing"/> </target> - <target name="dist.man" depends="dist.doc"> + <target name="dist.man" depends="dist.base"> <mkdir dir="${dist.dir}/man"/> <copy toDir="${dist.dir}/man"> <fileset dir="${build-docs.dir}/manual/man"/> </copy> </target> - <target name="dist.src" depends="dist.man"> + <target name="dist.src" depends="dist.base"> <mkdir dir="${dist.dir}/src"/> - <jar destfile="${dist.dir}/src/scala-library-src.jar"> + <jar whenmanifestonly="fail" destfile="${dist.dir}/src/scala-library-src.jar"> <fileset dir="${src.dir}/library"/> <fileset dir="${src.dir}/continuations/library"/> </jar> - <jar destfile="${dist.dir}/src/scala-reflect-src.jar"> - <fileset dir="${src.dir}/reflect"/> - </jar> - <jar destfile="${dist.dir}/src/scala-swing-src.jar"> - <fileset dir="${src.dir}/swing"/> - </jar> - <jar destfile="${dist.dir}/src/scala-compiler-src.jar"> - <fileset dir="${src.dir}/compiler"/> - </jar> - <jar destfile="${dist.dir}/src/scala-actors-src.jar"> - <fileset dir="${src.dir}/actors"/> - </jar> - <jar destfile="${dist.dir}/src/scalap-src.jar"> - <fileset dir="${src.dir}/scalap"/> - </jar> - <!-- Needed for Maven distribution --> - <jar destfile="${dist.dir}/src/scala-partest-src.jar"> - <fileset dir="${src.dir}/partest"/> - </jar> + <jar whenmanifestonly="fail" destfile="${dist.dir}/src/scala-reflect-src.jar" basedir="${src.dir}/reflect"/> + <jar whenmanifestonly="fail" destfile="${dist.dir}/src/scala-swing-src.jar" basedir="${src.dir}/swing"/> + <jar whenmanifestonly="fail" destfile="${dist.dir}/src/scala-compiler-src.jar" basedir="${src.dir}/compiler"/> + <jar whenmanifestonly="fail" destfile="${dist.dir}/src/scala-actors-src.jar" basedir="${src.dir}/actors"/> + <jar whenmanifestonly="fail" destfile="${dist.dir}/src/scalap-src.jar" basedir="${src.dir}/scalap"/> + <jar whenmanifestonly="fail" destfile="${dist.dir}/src/scala-partest-src.jar" basedir="${src.dir}/partest"/> </target> - <target name="dist.latest.unix" depends="dist.base" unless="os.win"> - <symlink link="${dists.dir}/latest" resource="${dist.name}" overwrite="yes"/> + <target name="dist.partial" depends="dist.base"> + <if><not><os family="windows"/></not><then> + <symlink link="${dists.dir}/latest" resource="${dist.name}" overwrite="yes"/> + </then><else> <!-- XXX THIS PROBABLY DOES NOT WORK: copying must happen last during dist.done! is this guaranteed? --> + <copydir dest="${dists.dir}/latest" src="${dist.dir}"/> + </else></if> </target> - <target name="dist.latest.win" depends="dist.base" if="os.win"> - <copy todir="${dists.dir}/latest"> - <fileset dir="${dist.dir}"/> - </copy> - </target> - - <target name="dist.latest" depends="dist.latest.unix,dist.latest.win"/> - - <target name="dist.partial" depends="dist.base, dist.latest"/> - - <target name="dist.done" depends="dist.latest, dist.src"/> - - <target name="dist.clean"> - <delete dir="${dists.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/> - </target> - -<!-- =========================================================================== -TEST AND DISTRIBUTION BUNDLE (ALL) -============================================================================ --> - - <target name="all.done" depends="dist.done, test.done"/> + <target name="dist.done" depends="dist.doc, dist.man, dist.src, dist.partial"/> - <target name="all.clean" depends="locker.clean, docs.clean, dist.clean, sbt.clean, osgi.clean"/> <!-- =========================================================================== -STABLE REFERENCE (STARR) + STABLE REFERENCE (STARR) ============================================================================ --> <!-- Does not use any properties other than ${basedir}, so that it can run without 'init' (when using 'replacestarrwin') --> @@ -2640,28 +1738,19 @@ STABLE REFERENCE (STARR) <target name="starr.start"> <fail message="Library in build/pack not available"> <condition><not><and> - <available file="${basedir}/build/pack/lib/scala-library.jar"/> + <available file="${build-pack.dir}/lib/scala-library.jar"/> </and></not></condition> </fail> <fail message="Compiler in build/quick not available"> <condition><not><and> - <available file="${basedir}/build/quick/classes/compiler"/> - <available file="${basedir}/build/quick/compiler.complete"/> + <available file="${build-quick.dir}/classes/compiler"/> + <available file="${build-quick.dir}/compiler.complete"/> </and></not></condition> </fail> </target> - <target name="starr.clean" depends="starr.start"> - <delete file="${basedir}/lib/scala-library.jar"/> - <delete file="${basedir}/lib/scala-reflect.jar"/> - <delete file="${basedir}/lib/scala-compiler.jar"/> - <delete file="${basedir}/lib/scala-library-src.jar"/> - <delete file="${basedir}/lib/scala-reflect-src.jar"/> - <delete file="${basedir}/lib/scala-compiler-src.jar"/> - </target> - <target name="starr.jars" depends="starr.start"> - <copy toDir="${basedir}/lib/" overwrite="yes"> + <copy toDir="${lib.dir}" overwrite="yes"> <fileset dir="${build-pack.dir}/lib"> <include name="scala-library.jar"/> <include name="scala-reflect.jar"/> @@ -2671,18 +1760,16 @@ STABLE REFERENCE (STARR) </target> <target name="starr.src" depends="starr.jars"> - <jar destfile="${basedir}/lib/scala-library-src.jar"> - <fileset dir="${basedir}/src/library"/> - <fileset dir="${basedir}/src/swing"/> - <fileset dir="${basedir}/src/actors"/> - <fileset dir="${basedir}/src/forkjoin"/> - </jar> - <jar destfile="${basedir}/lib/scala-reflect-src.jar"> - <fileset dir="${basedir}/src/reflect"/> + <jar whenmanifestonly="fail" destfile="${lib.dir}/scala-library-src.jar"> + <fileset dir="${src.dir}/library"/> + <fileset dir="${src.dir}/swing"/> + <fileset dir="${src.dir}/actors"/> + <fileset dir="${src.dir}/forkjoin"/> </jar> - <jar destfile="${basedir}/lib/scala-compiler-src.jar"> - <fileset dir="${basedir}/src/compiler"/> - <fileset dir="${basedir}/src/asm"/> + <jar whenmanifestonly="fail" destfile="${lib.dir}/scala-reflect-src.jar" basedir="${src.dir}/reflect"/> + <jar whenmanifestonly="fail" destfile="${lib.dir}/scala-compiler-src.jar"> + <fileset dir="${src.dir}/compiler"/> + <fileset dir="${src.dir}/asm"/> </jar> </target> @@ -2702,60 +1789,85 @@ STABLE REFERENCE (STARR) <target name="starr.done" depends="starr.jars, starr.removesha1"/> -<!-- =========================================================================== -FORWARDED TARGETS FOR PACKAGING -============================================================================ --> - - <target name="distpack" depends="dist.done, docs.all"> - <ant antfile="${src.dir}/build/pack.xml" target="pack-all.done" inheritall="yes" inheritrefs="yes"/> + <target name="replacestarr" description="Replaces the Starr compiler and library by fresh ones built from current sources and tests them."> + <fail message="This target is not available on Windows. Use 'ant replacestarrwin' instead."> + <condition> + <os family="windows"/> + </condition> + </fail> + <!-- needs antcall to enforce ordering --> + <antcall target="locker.clean"/> + <antcall target="pack.done"/> + <antcall target="starr.done"/> + <antcall target="locker.clean"/> + <antcall target="test.done"/> </target> - <target name="distpack-maven" depends="dist.done, docs.all"> - <ant antfile="${src.dir}/build/pack.xml" target="pack-maven.done" inheritall="yes" inheritrefs="yes"/> - </target> + <target name="replacestarr-opt" description="Replaces the Starr compiler and library by fresh, optimised ones built from current sources and tests them."> + <optimize name="replacestarr"/></target> - <target name="distpack-opt" - description="Builds an optimised distribution."> - <antcall target="distpack"> - <param name="scalac.args.optimise" value="-optimise"/> - </antcall> + <!-- Ant on Windows is not able to delete jar files that are referenced in any <path>. + See ticket 1290 on trac. --> + <target name="replacestarrwin" description="Creates a new Starr on Windows. Manually execute 'ant locker.clean build' first!"> + <fail message="This target is only available on Windows. Use 'ant replacestarr' instead."> + <condition> + <not><os family="windows"/></not> + </condition> + </fail> + <echo message="CAUTION: Make sure to execute 'ant locker.clean build' prior to calling 'replacestarrwin'."/> + <antcall target="starr.done"/> + <antcall target="locker.clean"/> + <antcall target="test.done"/> </target> - <target name="distpack-maven-opt" - description="Builds an optimised maven distribution."> - <antcall target="distpack-maven"> - <param name="scalac.args.optimise" value="-optimise"/> - </antcall> - </target> + <target name="replacestarrwin-opt" description="Creates a new Starr on Windows. Manually execute 'ant locker.clean build' first!"> + <optimize name="replacestarrwin"/></target> - <!-- Used by the scala-installer script --> - <target name="allallclean" depends="all.clean"/> + <target name="replacelocker" description="Replaces the Locker compiler and library by fresh ones built from current sources." + depends="palo.clean, locker.unlock, palo.done"/> -<!-- =========================================================================== -FORWARDED TARGETS FOR NIGHTLY BUILDS -============================================================================ --> + <target name="replacelocker-opt" description="Replaces the Locker compiler and library by fresh, optimised ones built from current sources."> + <optimize name="replacelocker"/></target> - <target name="nightly"> - <antcall target="nightly-nopt"> - <param name="scalac.args.optimise" value="-optimise"/> - </antcall> + <target name="buildlocker" description="Does the same for locker as build does for quick." depends="locker.unlock, palo.bin"/> + <target name="unlocklocker" description="Same as buildlocker." depends="buildlocker"/> <!-- REMOVE --> + + <target name="fastlocker.lib" description="Buildlocker without extra fuss" depends="locker.unlock, locker.lib"> + <property name="fastlocker" value="true"/> </target> - <target name="nightly-nopt" depends="all.done, docs.all"> - <!-- cannot antcall all.done, the properties defined in there (dist.dir) are not returned. need depends. --> - <ant antfile="${src.dir}/build/pack.xml" target="pack-all.done" inheritall="yes" inheritrefs="yes"/> + <target name="fastlocker.reflect" description="Buildlocker without extra fuss" depends="locker.unlock, locker.reflect"> + <property name="fastlocker" value="true"/> </target> - <target name="nightly.checkall"> - <antcall target="nightly-nopt"> - <param name="partest.scalacopts" value="-Ycheck:all"/> - </antcall> + <target name="fastlocker.comp" description="Buildlocker without extra fuss" depends="locker.unlock, locker.comp"> + <property name="fastlocker" value="true"/> </target> + <target name="fastlocker" description="Buildlocker without extra fuss" depends="fastlocker.comp"/> + + <!-- =========================================================================== -POSITIONS + TODO: FIX OR REMOVE ============================================================================ --> + <!-- not called by test target --> + <target name="test.classload" depends="pack.done"> + <!-- TODO - Add actors + reflect to this --> + <classloadVerify classpath="${build-pack.dir}/lib/scala-library.jar" /> + </target> + + <!-- not called by test target --> + <target name="test.ant" depends="pack.done"> + <partest showlog="yes" erroronfailed="yes" javacmd="${java.home}/bin/java" + srcdir="${partest.srcdir}" + scalacopts="${scalac.args.optimise}"> + <compilationpath refid="partest.classpath"/> + <anttests dir="${partest.dir}/${partest.srcdir}/ant" includes="*build.xml"/> + </partest> + </target> + + <!-- not called by test target --> <target name="test.positions" depends="quick.comp"> <antcall target="test.positions.tests.sub" inheritRefs="true"> <param name="test.tests.srcs" value="${partest.dir}/files/positions"/> @@ -2809,15 +1921,13 @@ POSITIONS </if> <scalacfork destdir="" - compilerpathref="locker.classpath" + compilerpathref="locker.compiler.path" srcpath="${srcdir}" params="-Xprint-pos -Yide-debug" srcdir="${srcdir}" jvmargs="${scalacfork.jvmargs}"> <include name="${srcs}"/> - <compilationpath> - <pathelement location="${build-quick.dir}/classes/library"/> - </compilationpath> + <compilationpath refid="test.positions.sub.build.path"/> </scalacfork> </target> @@ -2836,18 +1946,13 @@ POSITIONS </target> <!-- =========================================================================== -MISCELLANEOUS + VISUALIZATION ============================================================================ --> - <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> |