diff options
Diffstat (limited to 'build.xml')
-rwxr-xr-x[-rw-r--r--] | build.xml | 1023 |
1 files changed, 496 insertions, 527 deletions
diff --git a/build.xml b/build.xml index 9c98c34b32..e1c19fd909 100644..100755 --- a/build.xml +++ b/build.xml @@ -1,10 +1,20 @@ <?xml version="1.0" encoding="UTF-8"?> <project name="sabbus" default="build" xmlns:artifact="urn:maven-artifact-ant"> + <include file="test/build-partest.xml" as="partest"/> + <description> SuperSabbus for Scala core, builds the scala library and compiler. It can also package it as a simple distribution, tests it for stable bootstrapping and against the Scala test suite. </description> +<!-- HINTS + + - for faster builds, have a build.properties in the same directory as build.xml that says: + locker.skip=1 + starr.use.released=1 + +--> + <!-- USAGE FROM JENKINS SCRIPTS IS (CURRENTLY) AS FOLLOWS: ant $antArgs $scalacArgs $targets @@ -16,7 +26,20 @@ scalacArgs examples: "-Dscalac.args=\"-Yrangepos\" -Dpartest.scalac_opts=\"-Yrangepos\"" targets exercised: - build-opt nightly test.suite test.continuations.suite test.scaladoc locker.done + locker.done build-opt nightly test.suite test.continuations.suite test.scaladoc +--> + +<!-- To use Zinc with the ant build: + - install zinc and symlink the installed zinc script to ${basedir}/tools/zinc (${basedir} is where build.xml and the rest of your checkout resides) + - make sure to set ZINC_OPTS to match ANT_OPTS! +--> + +<!-- +TODO: + - detect zinc anywhere on PATH + - automatically set ZINC_OPTS + - skip locker (and test.stability) by default to speed up PR validation, still do full build & testing during nightly + - (rework the build to pack locker and build using that when using zinc) --> @@ -44,8 +67,8 @@ targets exercised: <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="distpack-opt" description="Builds an optimised distribution."> <optimized name="distpack"/></target> + <target name="distpack-maven-opt" description="Builds an optimised maven distribution."><optimized name="distpack-maven"/></target> <target name="all.done" depends="dist.done, test.done"/> @@ -57,8 +80,8 @@ targets exercised: <target name="nightly.checkall"> <antcall target="nightly-nopt"> <param name="partest.scalac_opts" value="-Ycheck:all"/></antcall></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="clean" depends="quick.clean" description="Removes binaries of compiler and library. Locker and 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."/> <macrodef name="optimized" > @@ -74,63 +97,68 @@ targets exercised: <property environment="env"/> <!-- Prevents system classpath from being used --> - <property name="build.sysclasspath" value="ignore"/> + <property name="build.sysclasspath" value="ignore"/> <!-- Defines the repository layout --> - <property name="docs.dir" value="${basedir}/docs"/> - <property name="lib.dir" value="${basedir}/lib"/> - <property name="src.dir" value="${basedir}/src"/> - <property name="partest.dir" value="${basedir}/test"/> + <property name="docs.dir" value="${basedir}/docs"/> + <property name="lib.dir" value="${basedir}/lib"/> + <property name="src.dir" value="${basedir}/src"/> + <property name="partest.dir" value="${basedir}/test"/> - <property name="lib-ant.dir" value="${lib.dir}/ant"/> + <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"/> + <property name="lib-extra.dir" value="${lib.dir}/extra"/> <!-- Loads custom properties definitions --> <property file="${basedir}/build.properties"/> + <!-- Generating version number --> <property file="${basedir}/build.number"/> + <!-- read starr.version --> + <property file="${basedir}/starr.number"/> + <!-- Sets location of pre-compiled libraries --> - <property name="library.starr.jar" value="${lib.dir}/scala-library.jar"/> - <property name="reflect.starr.jar" value="${lib.dir}/scala-reflect.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"/> + <property name="library.starr.jar" value="${lib.dir}/scala-library.jar"/> + <property name="reflect.starr.jar" value="${lib.dir}/scala-reflect.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"/> <!-- Sets location of build folders --> - <property name="build.dir" value="${basedir}/build"/> - <property name="build-asm.dir" value="${build.dir}/asm"/> - <property name="build-locker.dir" value="${build.dir}/locker"/> - <property name="build-palo.dir" value="${build.dir}/palo"/> - <property name="build-quick.dir" value="${build.dir}/quick"/> - <property name="build-pack.dir" value="${build.dir}/pack"/> - <property name="build-osgi.dir" value="${build.dir}/osgi"/> - <property name="build-strap.dir" value="${build.dir}/strap"/> - <property name="build-docs.dir" value="${build.dir}/scaladoc"/> - <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"/> - - <property name="copyright.string" value="Copyright 2002-2013, LAMP/EPFL"/> - <property name="partest.version.number" value="0.9.2"/> + <property name="build.dir" value="${basedir}/build"/> + <property name="build-libs.dir" value="${build.dir}/libs"/> + <property name="build-asm.dir" value="${build.dir}/asm"/> + <property name="build-forkjoin.dir" value="${build-libs.dir}"/> + <property name="build-locker.dir" value="${build.dir}/locker"/> + <property name="build-palo.dir" value="${build.dir}/palo"/> + <property name="build-quick.dir" value="${build.dir}/quick"/> + <property name="build-pack.dir" value="${build.dir}/pack"/> + <property name="build-osgi.dir" value="${build.dir}/osgi"/> + <property name="build-strap.dir" value="${build.dir}/strap"/> + <property name="build-docs.dir" value="${build.dir}/scaladoc"/> + <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"/> + + <property name="copyright.string" value="Copyright 2002-2013, LAMP/EPFL"/> + <property name="partest.version.number" value="0.9.3"/> <!-- These are NOT the flags used to run SuperSabbus, but the ones written into the script runners created with scala.tools.ant.ScalaTool --> - <property name="java.flags" value="-Xmx256M -Xms32M"/> - <property name="jvm.opts" value=""/> + <property name="java.flags" value="-Xmx256M -Xms32M"/> + <property name="jvm.opts" value=""/> <!-- if ANT_OPTS is already set by the environment, it will be unaltered, 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="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}"/> <!-- =========================================================================== INITIALIZATION @@ -167,11 +195,15 @@ targets exercised: <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" /> + <!-- Resolve maven dependencies --> + <!-- 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> + <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="extra.tasks.classpath" filesetId="extra.tasks.fileset"> <dependency groupId="biz.aQute" artifactId="bnd" version="1.50.0"/> </artifact:dependencies> @@ -190,25 +222,32 @@ targets exercised: <dependency groupId="org.apache.felix" artifactId="org.apache.felix.framework" version="3.2.2"/> </artifact:dependencies> + <artifact:dependencies pathId="partest.extras.classpath" filesetId="partest.extras.fileset" versionsId="partest.extras.versions"> + <dependency groupId="com.googlecode.java-diff-utils" artifactId="diffutils" version="1.3.0"/> + </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> + <!-- Download STARR via maven if `starr.use.released` is set, + and `starr.version` is specified (see the starr.number properties file). + Want to slow down STARR changes, using only released versions. --> + <if><isset property="starr.use.released"/><then> + <echo message="Using Scala ${starr.version} for STARR."/> <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> + </artifact:dependencies></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> - <property name="maven-deps-done" value="yep!"/> + <property name="maven-deps-done" value="yep!"/> </then></if> @@ -226,30 +265,34 @@ targets exercised: - `version.suffix == maven.version.suffix == ""` --> <if><not><equals arg1="${version.bnum}" arg2="0"/></not><then> - <property name="version.suffix" value="-${version.bnum}"/> + <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}"/> + <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> + <property name="maven.version.suffix" value="${version.suffix}"/> + <property name="osgi.version.suffix" value="${version.suffix}"/></else></if> + + <!-- if a maven version suffix was set (or inferred), assume we're building a release --> + <if><isset property="maven.version.suffix"/><then> + <property name="build.release" value="1"/></then></if> <!-- not building a release and no version.suffix specified --> - <property name="maven.version.suffix" value="-SNAPSHOT"/> + <property name="maven.version.suffix" value="-SNAPSHOT"/> <if><equals arg1="${maven.version.suffix}" arg2="-SNAPSHOT"/><then> - <property name="osgi.version.suffix" value=""/> - <property name="version.suffix" value=""/></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> + <property name="osgi.version.suffix" value="${maven.version.suffix}"/> + <property name="version.suffix" value="${maven.version.suffix}"/></else></if> <exec osfamily="unix" executable="tools/get-scala-commit-sha" outputproperty="git.commit.sha" failifexecutionfails="false" /> @@ -266,8 +309,8 @@ targets exercised: </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"/> + <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" @@ -276,9 +319,9 @@ targets exercised: 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}"/> + <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}"/> + <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"> @@ -304,27 +347,27 @@ targets exercised: </then></if> <!-- Allow this to be overridden simply --> - <property name="sbt.latest.version" value="0.12.2"/> + <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.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.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=""/> + <property name="scalac.args" value=""/> + <property name="javac.args" 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.locker" value="${scalac.args.all}"/> - <property name="scalac.args.quick" value="${scalac.args.all}"/> - <property name="scalac.args.strap" value="${scalac.args.quick}"/> + <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.locker" value="${scalac.args.all}"/> + <property name="scalac.args.quick" value="${scalac.args.all}"/> + <property name="scalac.args.strap" value="${scalac.args.quick}"/> <!-- This is the start time for the distribution --> <tstamp prefix="time"> @@ -333,8 +376,8 @@ targets exercised: </tstamp> <!-- some default in case something went wrong getting the revision --> - <property name="version.number" value="-unknown-"/> - <property name="init.avail" value="yes"/> + <property name="version.number" value="-unknown-"/> + <property name="init.avail" value="yes"/> <!-- Local libs (developer use.) --> <mkdir dir="${lib-extra.dir}"/> @@ -347,7 +390,6 @@ targets exercised: <fileset dir="${lib-extra.dir}"> <include name="**/*.jar"/> </fileset> - <path refid="dependency.classpath"/> </path> <!-- And print-out what we are building --> @@ -387,7 +429,9 @@ targets exercised: <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/"/> + <path id="asm.classpath" path="${build-asm.dir}/classes"/> + <property name="forkjoin-classes" refid="forkjoin.classpath"/> + <property name="asm-classes" refid="asm.classpath"/> <!-- Compilers to use for the various stages. @@ -399,24 +443,10 @@ targets exercised: <path refid="aux.libs"/> </path> - <!-- 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> - - <!-- Skip locker with -Dlocker.skip=YESSIR. Uses STARR instead. --> + <!-- To skip locker, use -Dlocker.skip=1 --> <if><isset property="locker.skip"/><then> - <echo message="Skipping locker! Using STARR instead."/> - <path id="locker.compiler.path"><path refid="starr.compiler.path"/></path> + <echo message="Using STARR to build the quick stage (skipping locker)."/> + <path id="locker.compiler.path" refid="starr.compiler.path"/> <property name="locker.locked" value="locker skipped"/></then> <else> <path id="locker.compiler.path"><path refid="locker.compiler.build.path"/></path></else></if> @@ -440,6 +470,11 @@ targets exercised: <path refid="aux.libs"/> </path> + <path id="locker.actors.build.path"> + <path refid="locker.library.build.path"/> + <pathelement location="${build-locker.dir}/classes/actors"/> + </path> + <path id="locker.reflect.build.path"> <path refid="locker.library.build.path"/> <pathelement location="${build-locker.dir}/classes/reflect"/> @@ -458,7 +493,10 @@ targets exercised: <path refid="aux.libs"/> </path> - <path id="quick.actors.build.path"><path refid="quick.library.build.path"/></path> + <path id="quick.actors.build.path"> + <path refid="quick.library.build.path"/> + <pathelement location="${build-quick.dir}/classes/actors"/> + </path> <path id="quick.reflect.build.path"> <path refid="quick.library.build.path"/> @@ -479,6 +517,7 @@ targets exercised: <path id="quick.swing.build.path"> <path refid="quick.library.build.path"/> + <path refid="quick.actors.build.path"/> <pathelement location="${build-quick.dir}/classes/swing"/> </path> @@ -489,6 +528,7 @@ targets exercised: <path id="quick.scalacheck.build.path"> <pathelement location="${build-quick.dir}/classes/library"/> + <pathelement location="${build-quick.dir}/classes/actors"/> <pathelement location="${build-quick.dir}/classes/scalacheck"/> </path> @@ -500,6 +540,7 @@ targets exercised: <path id="quick.partest.build.path"> <path refid="quick.scalap.build.path"/> + <path refid="partest.extras.classpath"/> <pathelement location="${build-quick.dir}/classes/repl"/> <pathelement location="${scalacheck.jar}"/> </path> @@ -518,11 +559,13 @@ targets exercised: <path id="quick.bin.tool.path"> <path refid="quick.repl.build.path"/> + <path refid="quick.actors.build.path"/> <pathelement location="${build-quick.dir}/classes/scalap"/> <pathelement location="${build-quick.dir}/classes/continuations-library"/> </path> <!-- PACK --> + <!-- also used for docs.* targets TODO: use separate paths for those --> <path id="pack.compiler.path"> <pathelement location="${build-pack.dir}/lib/scala-library.jar"/> <pathelement location="${build-pack.dir}/lib/scala-reflect.jar"/> @@ -531,6 +574,7 @@ targets exercised: <pathelement location="${build-pack.dir}/lib/scalap.jar"/> <pathelement location="${build-pack.dir}/lib/scala-actors.jar"/> <pathelement location="${ant.jar}"/> + <path refid="partest.extras.classpath"/> <path refid="aux.libs"/> </path> @@ -543,6 +587,42 @@ targets exercised: <path refid="aux.libs"/> </path> + <path id="pack.library.files"> + <fileset dir="${build-quick.dir}/classes/library"/> + <fileset dir="${build-quick.dir}/classes/continuations-library"/> + <fileset dir="${forkjoin-classes}"/> + </path> + + <path id="pack.actors.files"> + <fileset dir="${build-quick.dir}/classes/actors"/> + </path> + + <path id="pack.compiler.files"> + <fileset dir="${build-quick.dir}/classes/compiler"/> + <fileset dir="${build-quick.dir}/classes/repl"/> + <fileset dir="${build-quick.dir}/classes/scaladoc"/> + <fileset dir="${build-quick.dir}/classes/interactive"/> + <fileset dir="${asm-classes}"/> + </path> + + <path id="pack.swing.files"> <fileset dir="${build-quick.dir}/classes/swing"/> </path> + <path id="pack.reflect.files"> <fileset dir="${build-quick.dir}/classes/reflect"/> </path> + <path id="pack.plugins.files"> <fileset dir="${build-quick.dir}/classes/continuations-plugin"/> </path> + <path id="pack.scalacheck.files"> <fileset dir="${build-quick.dir}/classes/scalacheck"/> </path> + <path id="pack.scalap.files"> <fileset dir="${build-quick.dir}/classes/scalap"/> + <fileset file="${src.dir}/scalap/decoder.properties"/> </path> + + <path id="pack.partest.files"> + <fileset dir="${build-quick.dir}/classes/partest"> + <exclude name="scala/tools/partest/javaagent/**"/> + </fileset> + </path> + + <path id="pack.partest-javaagent.files"> + <fileset dir="${build-quick.dir}/classes/partest"> + <include name="scala/tools/partest/javaagent/**"/> + </fileset> + </path> <!-- STRAP --> <path id="strap.library.build.path"> @@ -550,7 +630,6 @@ targets exercised: <path refid="forkjoin.classpath"/> <path refid="aux.libs"/> </path> - <path id="strap.actors.build.path"><path refid="strap.library.build.path"/></path> <path id="strap.reflect.build.path"> <path refid="strap.library.build.path"/> @@ -579,9 +658,18 @@ targets exercised: <path id="partest.classpath"> <path refid="pack.compiler.path"/> + <path refid="partest.extras.classpath"/> + </path> + + <!-- obsolete? --> + <!-- TODO - segregate swing tests (there can't be many) --> + <!-- + <path id="partest.build.path"> + <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) --> + <pathelement location="${pack.dir}/lib/scala-swing.jar"/> </path> + --> <path id="test.osgi.compiler.build.path"> <pathelement location="${test.osgi.classes}"/> @@ -660,53 +748,39 @@ targets exercised: <delete dir="${build-@{build}.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/> </sequential> </macrodef> - <!-- =========================================================================== - LOCAL DEPENDENCY (Adapted ASM) + LOCAL DEPENDENCIES ============================================================================ --> - <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> + <macrodef name="simple-javac" > + <attribute name="project"/> <!-- project: asm/forkjoin --> + <attribute name="args" default=""/> + <attribute name="jar" default="yes"/> + <sequential> + <uptodate property="@{project}.available" targetfile="${build-libs.dir}/@{project}.complete"> + <srcfiles dir="${src.dir}/@{project}"/></uptodate> + <if><not><isset property="@{project}.available"/></not><then> + <stopwatch name="@{project}.timer"/> + <mkdir dir="${@{project}-classes}"/> + <javac + srcdir="${src.dir}/@{project}" + destdir="${@{project}-classes}" + classpath="${@{project}-classes}" + includes="**/*.java" + target="1.6" source="1.5" + compiler="javac1.6"> + <compilerarg line="${javac.args} @{args}"/> + </javac> + <if><equals arg1="@{jar}" arg2="yes"/><then> + <jar whenmanifestonly="fail" destfile="${build-libs.dir}/@{project}.jar" basedir="${@{project}-classes}"/></then></if> + <stopwatch name="@{project}.timer" action="total"/> + <mkdir dir="${build-libs.dir}"/> + <touch file="${build-libs.dir}/@{project}.complete" verbose="no"/> + </then></if> + </sequential> + </macrodef> -<!-- =========================================================================== - 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="asm.done" depends="init"> <simple-javac project="asm" jar="no"/> </target> + <target name="forkjoin.done" depends="init"> <simple-javac project="forkjoin" args="-XDignore.symbol.file"/></target> <!-- =========================================================================== STAGED COMPILATION MACROS @@ -731,6 +805,49 @@ targets exercised: </sequential> </macrodef> + <!-- Zinc assumes a one-to-one correspondence of output folder to set of source files. + When compiling different sets of source files in multiple compilations to the same output directory, + Zinc thinks source files that appeared in an earlier compilation but are absent in the current one, + were deleted and thus deletes the corresponding output files. + + Note that zinc also requires each arg to scalac to be prefixed by -S. + --> + <macrodef name="zinc"> + <attribute name="compilerpathref" /> + <attribute name="destdir" /> + <attribute name="srcdir" /> + <attribute name="srcpath" default="NOT SET"/> <!-- needed to compile the library, "NOT SET" is just a convention to denote an optional attribute --> + <attribute name="buildpathref" /> + <attribute name="params" default="" /> + <attribute name="java-excludes" default=""/> + + <sequential> + <local name="sources"/> + <pathconvert pathsep=" " property="sources"> + <fileset dir="@{srcdir}"> + <include name="**/*.java"/> + <include name="**/*.scala"/> + <exclude name="@{java-excludes}"/> + </fileset> + </pathconvert> + <local name="args"/> + <local name="sargs"/> + <if><not><equals arg1="@{srcpath}" arg2="NOT SET"/></not><then> + <property name="args" value="@{params} -sourcepath @{srcpath}"/> + </then></if> + <property name="args" value="@{params}"/> <!-- default --> + + <!-- HACK: prefix scalac args by -S --> + <script language="javascript"> + project.setProperty("sargs", project.getProperty("args").trim().replaceAll(" ", " -S")); + </script> + + <exec osfamily="unix" executable="tools/zinc" failifexecutionfails="true" failonerror="true"> + <arg line="-nailed -compile-order JavaThenScala -scala-path ${ant.refid:@{compilerpathref}} -d @{destdir} -classpath ${toString:@{buildpathref}} ${sargs} ${sources}"/> + </exec> + </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) --> @@ -739,33 +856,46 @@ targets exercised: <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"/> + <attribute name="java-excludes" default=""/> <sequential> + <!-- TODO: detect zinc anywhere on PATH + use zinc for the quick stage if it's available; + would use it for locker but something is iffy in sbt: get a class cast error on global phase --> + <if><and> <available file="tools/zinc"/> + <equals arg1="@{stage}" arg2="quick"/> + <not><equals arg1="@{project}" arg2="plugins"/></not> <!-- doesn't work in zinc because it requires the quick compiler, which isn't jarred up--> + </and><then> + <zinc taskname="Z.@{stage}.@{project}" + compilerpathref="@{with}.compiler.path" + destdir="${build-@{stage}.dir}/classes/@{destproject}" + srcdir="${src.dir}/@{srcdir}" + srcpath="@{srcpath}" + buildpathref="@{stage}.@{project}.build.path" + params="${scalac.args.@{stage}} @{args}" + java-excludes="@{java-excludes}"/></then> + <else> <if><equals arg1="@{srcpath}" arg2="NOT SET"/><then> <scalacfork taskname="@{stage}.@{project}" - destdir="${build-@{stage}.dir}/classes/@{destproject}" + jvmargs="${scalacfork.jvmargs}" compilerpathref="@{with}.compiler.path" - params="${scalac.args.@{stage}} @{args}" + destdir="${build-@{stage}.dir}/classes/@{destproject}" srcdir="${src.dir}/@{srcdir}" - jvmargs="${scalacfork.jvmargs}"> + params="${scalac.args.@{stage}} @{args}"> <include name="**/*.scala"/> - <compilationpath refid="@{stage}.@{project}.build.path"/> - <args/> - </scalacfork></then> + <compilationpath refid="@{stage}.@{project}.build.path"/></scalacfork></then> <else> <scalacfork taskname="@{stage}.@{project}" - destdir="${build-@{stage}.dir}/classes/@{destproject}" + jvmargs="${scalacfork.jvmargs}" compilerpathref="@{with}.compiler.path" - srcpath="@{srcpath}" - params="${scalac.args.@{stage}} @{args}" + destdir="${build-@{stage}.dir}/classes/@{destproject}" srcdir="${src.dir}/@{srcdir}" - jvmargs="${scalacfork.jvmargs}"> + srcpath="@{srcpath}" + params="${scalac.args.@{stage}} @{args}"> <include name="**/*.scala"/> - <compilationpath refid="@{stage}.@{project}.build.path"/> - <args/> - </scalacfork></else> + <compilationpath refid="@{stage}.@{project}.build.path"/></scalacfork></else> </if> + </else></if> </sequential> </macrodef> @@ -793,20 +923,17 @@ targets exercised: <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="java-excludes" default=""/> <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/> + <staged-javac stage="@{stage}" project="@{project}" excludes="@{java-excludes}"/> <!-- always compile with javac for simplicity and regularity; it's cheap --> + <staged-scalac with="@{with}" stage="@{stage}" project="@{project}" srcpath="@{srcpath}" args="@{args}" java-excludes="@{java-excludes}"/> <if><equals arg1="@{version}" arg2=""/><then> <propertyfile file = "${build-@{stage}.dir}/classes/@{project}/@{project}.properties"> <entry key = "version.number" value="${version.number}"/> @@ -871,15 +998,33 @@ targets exercised: <attribute name="project"/> <attribute name="targetdir" default="lib"/> <attribute name="targetjar" default="scala-@{project}.jar"/> - <element name="do" implicit="true"/> + <attribute name="destfile" default="${build-pack.dir}/@{targetdir}/@{targetjar}"/> + <attribute name="manifest" default=""/> + <element name="pre" optional="true"/> + <element name="jar-opts" optional="true"/> <sequential> - <uptodate property="pack.@{project}.available" - targetfile="${build-pack.dir}/@{targetdir}/@{targetjar}" - srcfile="${build-quick.dir}/@{project}.complete"/> + <uptodate property="pack.@{project}.available" targetfile="@{destfile}"> + <srcresources> + <resources refid="pack.@{project}.files"/> + <!-- <path><pathelement location="${build-quick.dir}/@{project}.complete"/></path> --> + </srcresources> + </uptodate> <if><not><isset property="pack.@{project}.available"/></not><then> <mkdir dir="${build-pack.dir}/@{targetdir}"/> - <do/> + <pre/> + + <if><not><equals arg1="@{manifest}" arg2=""/></not><then> + <jar whenmanifestonly="fail" destfile="@{destfile}" manifest="@{manifest}"> <!-- update="true" makes no difference on my machine, so starting from scratch--> + <jar-opts/> + <path refid="pack.@{project}.files"/> + </jar></then> + <else> + <jar whenmanifestonly="fail" destfile="@{destfile}"> + <jar-opts/> + <path refid="pack.@{project}.files"/> + </jar> + </else></if> </then></if> </sequential> </macrodef> @@ -897,7 +1042,8 @@ targets exercised: <do> <stopwatch name="docs.@{project}.timer"/> <mkdir dir="${build-docs.dir}/@{project}"/> - <if><equals arg1="@{classpathref}" arg2="NOT SET"/><then> + <if><equals arg1="@{docroot}" arg2="NOT SET"/><then> + <!-- TODO: introduce docs.@{project}.build.path for classpathref --> <scaladoc destdir="${build-docs.dir}/@{project}" doctitle="@{title}" @@ -940,16 +1086,20 @@ targets exercised: <!-- =========================================================================== LOCAL REFERENCE BUILD (LOCKER) ============================================================================ --> - <target name="locker.start" depends="asm.done, forkjoin.done"> + <target name="locker.start" depends="asm.done, forkjoin.done"> <condition property="locker.locked"><available file="${build-locker.dir}/locker.locked"/></condition></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="locker.lib" depends="locker.start" unless="locker.locked"> + <staged-build with="starr" stage="locker" project="library" srcpath="${src.dir}/library" includes="lib.includes"/></target> + + <target name="locker.actors" depends="locker.lib" unless="locker.locked"> + <staged-build with="starr" stage="locker" project="actors"/> </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="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="locker.done" depends="locker.comp"> <mkdir dir="${build-locker.dir}"/> @@ -961,62 +1111,43 @@ targets exercised: <!-- =========================================================================== QUICK BUILD (QUICK) ============================================================================ --> - <target name="quick.start" depends="locker.done"/> + <target name="quick.start" depends="locker.done"/> - <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.start"> + <staged-build with="locker" stage="quick" project="library" srcpath="${src.dir}/library" includes="lib.rootdoc.includes"/></target> - <target name="quick.reflect" depends="quick.lib"> <staged-build with="locker" stage="quick" project="reflect"/> </target> + <target name="quick.actors" depends="quick.lib"> + <staged-build with="locker" stage="quick" project="actors"/> </target> - <target name="quick.comp" depends="quick.reflect"> - <staged-build with="locker" stage="quick" project="compiler"/> - </target> + <target name="quick.reflect" depends="quick.lib"> + <staged-build with="locker" stage="quick" project="reflect"/> </target> - <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.comp" depends="quick.reflect"> + <staged-build with="locker" stage="quick" project="compiler"/> </target> - <target name="quick.scalacheck" depends="quick.lib"> - <staged-build with="locker" stage="quick" project="scalacheck" args="-nowarn"/> - </target> + <target name="quick.repl" depends="quick.comp"> + <staged-build with="locker" stage="quick" project="repl"/> </target> - <target name="quick.scalap" depends="quick.repl"> - <staged-build with="locker" stage="quick" project="scalap"/> - </target> + <target name="quick.scalacheck" depends="quick.actors, quick.lib"> + <staged-build with="locker" stage="quick" project="scalacheck" args="-nowarn"/> </target> - <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.scalap" depends="quick.repl"> + <staged-build with="locker" stage="quick" project="scalap"/> </target> + + <target name="quick.partest" depends="quick.scalap, quick.repl, asm.done"> + <staged-build with="locker" stage="quick" project="partest" version="partest"/> </target> <target name="quick.scaladoc" depends="quick.comp, quick.partest"> - <staged-build with="locker" stage="quick" project="scaladoc" version="scaladoc"/> - </target> + <staged-build with="locker" stage="quick" project="scaladoc" version="scaladoc"/> </target> <target name="quick.interactive" depends="quick.comp, quick.scaladoc"> - <staged-build with="locker" stage="quick" project="interactive"/> - </target> + <staged-build with="locker" stage="quick" project="interactive"/> </target> - <target name="quick.swing" depends="quick.lib" if="has.java6"> - <staged-build with="locker" stage="quick" project="swing"/> - </target> + <target name="quick.swing" depends="quick.actors, quick.lib" if="has.java6"> + <staged-build with="locker" stage="quick" project="swing"/> </target> - <target name="quick.plugins" depends="quick.comp"> - <staged-uptodate stage="quick" project="plugins"> + <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"/> @@ -1033,158 +1164,99 @@ targets exercised: <!-- 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! --> + <!-- TODO: must build with quick to avoid + [quick.plugins] error: java.lang.NoClassDefFoundError: scala/tools/nsc/transform/patmat/PatternMatching + [quick.plugins] at scala.tools.selectivecps.SelectiveCPSTransform.newTransformer(SelectiveCPSTransform.scala:29) + + WHY OH WHY!? scala/tools/nsc/transform/patmat/PatternMatching should be on locker.compiler.path + --> <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> + args="-Xplugin-require:continuations -P:continuations:enable -Xpluginsdir ${build-quick.dir}/misc/scala-devel/plugins"/> <stopwatch name="quick.plugins.timer" action="total"/> </do> </staged-uptodate> </target> - <target name="quick.bin" depends="init"> + <target name="quick.bin" depends="quick.lib, quick.reflect, quick.comp, quick.repl, quick.scalacheck, quick.scalap, quick.interactive, quick.swing, quick.plugins, quick.partest, quick.scaladoc"> <staged-bin stage="quick" classpathref="quick.bin.tool.path"/> </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.done" depends="quick.bin"/> <target name="quick-opt" description="Optimized version of quick.done."> <optimized name="quick.done"/></target> <!-- =========================================================================== PACKED QUICK BUILD (PACK) ============================================================================ --> - <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"> + <target name="pack.lib" depends="quick.lib, quick.plugins, forkjoin.done"> + <staged-pack project="library"/></target> + + <target name="pack.actors" depends="quick.lib"> <staged-pack project="actors"/> </target> + <target name="pack.swing" if="has.java6" depends="quick.swing"> <staged-pack project="swing"/> </target> + <target name="pack.reflect" depends="quick.reflect"> <staged-pack project="reflect"/> </target> + + <target name="pack.comp" depends="quick.comp, quick.scaladoc, quick.interactive, quick.repl, asm.done"> + <staged-pack project="compiler" manifest="${build-pack.dir}/META-INF/MANIFEST.MF"> + <pre> <!-- TODO the files copied here do not influence actuality of this target (nor does the manifest) --> + <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> + <mkdir dir="${build-pack.dir}/META-INF"/> + <copy file="${basedir}/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> + </pre> + <jar-opts> <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> + </jar-opts> </staged-pack> </target> - <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.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.plugins" depends="quick.plugins"> <staged-pack project="plugins" targetdir="misc/scala-devel/plugins" targetjar="continuations.jar"/> </target> + <target name="pack.scalacheck" depends="quick.scalacheck"> <staged-pack project="scalacheck" targetjar="scalacheck.jar"/> </target> <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> + <staged-pack project="partest"/> + <!-- TODO the manifest should influence actuality of this target --> + <staged-pack project="partest-javaagent" manifest="${src.dir}/partest/scala/tools/partest/javaagent/MANIFEST.MF"/> </target> - <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.scalap" depends="quick.scalap"> <staged-pack project="scalap" targetjar="scalap.jar"/> </target> - <target name="pack.bin" depends="pack.comp, pack.lib, pack.partest, pack.plugins, pack.reflect, pack.scalacheck, pack.scalap, pack.swing"> + <target name="pack.bin" depends="pack.comp, pack.lib, pack.actors, pack.partest, pack.plugins, pack.reflect, pack.scalacheck, pack.scalap, pack.swing"> <staged-bin stage="pack"/> </target> - <target name="pack.done" depends="pack.bin"> + <!-- depend on quick.done so quick.bin is run when pack.done is --> + <target name="pack.done" depends="quick.done, pack.bin"> + <!-- copy dependencies to build/pack/lib, it only takes a second so don't bother with uptodate checks --> + <copy todir="${build-pack.dir}/lib"> + <resources refid="partest.extras.fileset"/> + <mapper classpathref="maven-ant-tasks.classpath" classname="org.apache.maven.artifact.ant.VersionMapper" + from="${partest.extras.versions}" to="flatten"/> + </copy> + <taskdef resource="scala/tools/ant/antlib.xml" classpathref="pack.compiler.path"/> - <taskdef resource="scala/tools/partest/antlib.xml" classpathref="pack.compiler.path"/> + <taskdef resource="scala/tools/partest/antlib.xml" classpathref="partest.classpath"/> </target> <!-- =========================================================================== 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 name="strap.done" depends="pack.done"> + <staged-build with="pack" stage="strap" project="library" srcpath="${src.dir}/library" includes="lib.rootdoc.includes"/> + <staged-build with="pack" stage="strap" project="reflect"/> + <staged-build with="pack" stage="strap" project="compiler"/> </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> @@ -1195,13 +1267,13 @@ targets exercised: <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"/> + <fileset dir="${forkjoin-classes}"/> </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/"/> + <fileset dir="${asm-classes}"/> </jar> <copy file="${jline.jar}" toDir="${build-palo.dir}/lib"/> </target> @@ -1279,7 +1351,7 @@ targets exercised: 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"> + <target name="test.stability" depends="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" /> --> @@ -1361,121 +1433,109 @@ targets exercised: <stopwatch name="quick.sbt-interface.timer" action="total"/> </target> - <property name="partest.srcdir" value="files" /> <!-- TODO: make targets for `pending` and other subdirs --> + <!-- See test/build-partest.xml for the macro(s) being used here. --> - <target name="test.run" depends="pack.done"> - <partest showlog="yes" erroronfailed="yes" javacmd="${java.home}/bin/java" - timeout="1200000" - srcdir="${partest.srcdir}" - scalacopts="${scalac.args.optimise}"> - - <compilationpath refid="partest.classpath"/> - <runtests dir="${partest.dir}/${partest.srcdir}/run" includes="*.scala"/> - <jvmtests dir="${partest.dir}/${partest.srcdir}/jvm" includes="*.scala"/> - </partest> + <target name="test.suite" depends="pack.done"> + <testSuite/> </target> - <target name="test.suite" depends="pack.done"> - <partest showlog="yes" erroronfailed="yes" javacmd="${java.home}/bin/java" - timeout="2400000" - srcdir="${partest.srcdir}" - scalacopts="${scalac.args.optimise}"> - <compilationpath refid="partest.classpath"/> - <postests dir="${partest.dir}/${partest.srcdir}/pos" includes="*.scala"/> - <negtests dir="${partest.dir}/${partest.srcdir}/neg" includes="*.scala"/> - <runtests dir="${partest.dir}/${partest.srcdir}/run" includes="*.scala"/> - <jvmtests dir="${partest.dir}/${partest.srcdir}/jvm" includes="*.scala"/> - <residenttests dir="${partest.dir}/${partest.srcdir}/res" includes="*.res"/> - <scalaptests dir="${partest.dir}/${partest.srcdir}/scalap" includes="**/*.scala"/> - <scalachecktests dir="${partest.dir}/${partest.srcdir}/scalacheck"> - <include name="*.scala"/> - </scalachecktests> - <specializedtests dir="${partest.dir}/${partest.srcdir}/specialized"> - <include name="*.scala"/> - </specializedtests> - <instrumentedtests dir="${partest.dir}/${partest.srcdir}/instrumented"> - <include name="*.scala"/> - </instrumentedtests> - </partest> + <target name="test.suite.color" depends="pack.done"> + <testSuite colors="8"/> + </target> + + <target name="test.run" depends="pack.done"> + <testSuite kinds="run jvm"/> </target> <target name="test.continuations.suite" depends="pack.done"> - <partest showlog="yes" erroronfailed="yes" javacmd="${java.home}/bin/java" - timeout="2400000" - srcdir="${partest.srcdir}" - scalacopts="${scalac.args.optimise} -Xplugin-require:continuations -P:continuations:enable"> - <compilerarg value="-Xpluginsdir"/> - <compilerarg file="${build-quick.dir}/misc/scala-devel/plugins"/> - <compilationpath refid="partest.classpath"/> - <negtests dir="${partest.dir}/${partest.srcdir}/continuations-neg" includes="*.scala"/> - <runtests dir="${partest.dir}/${partest.srcdir}/continuations-run" includes="*.scala"/> - </partest> + <testSuite kinds="continuations-neg continuations-run" + scalacOpts="${scalac.args.optimise} -Xpluginsdir ${build-quick.dir}/misc/scala-devel/plugins -Xplugin-require:continuations -P:continuations:enable" + /> </target> <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" /> - <scalachecktests dir="${partest.dir}/scaladoc/scalacheck" includes="*.scala" /> - </partest> + <testSuite kinds="run scalacheck" srcdir="scaladoc"/> </target> <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"> - <include name="*/*.scala"/> - </presentationtests> - </partest> + <testSuite kinds="presentation"/> </target> -<!-- 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"/> - + <!-- for use in PR validation, where stability is rarely broken, so we're going to use starr for locker, + and skip test.stability (which requires locker == quick) --> + <target name="test.core" depends="test.osgi, test.sbt, test.bc, test.interactive, test.continuations.suite, test.scaladoc, test.suite"/> + <target name="test.done" depends="test.core, test.stability"/> <!-- =========================================================================== BINARY COMPATIBILITY TESTING ============================================================================ --> <target name="bc.init" depends="init" unless="maven-deps-done-mima"> + <property name="bc-reference-version" value="2.11.0"/> + <property name="bc-build.dir" value="${build.dir}/bc"/> <!-- Obtain mima --> <mkdir dir="${bc-build.dir}"/> <!-- Pull down MIMA --> <artifact:dependencies pathId="mima.classpath"> - <dependency groupId="com.typesafe" artifactId="mima-reporter_2.9.2" version="0.1.4"/> + <dependency groupId="com.typesafe" artifactId="mima-reporter_2.9.2" version="0.1.5"/> </artifact:dependencies> <artifact:dependencies pathId="old.bc.classpath"> - <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"/> + <dependency groupId="org.scala-lang" artifactId="scala-swing" version="${bc-reference-version}"/> + <dependency groupId="org.scala-lang" artifactId="scala-library" version="${bc-reference-version}"/> + <dependency groupId="org.scala-lang" artifactId="scala-reflect" version="${bc-reference-version}"/> </artifact:dependencies> <property name="maven-deps-done-mima" value="true"/> </target> - <target name="test.bc" depends="bc.init, pack.lib"> - <java - fork="true" - failonerror="true" - classname="com.typesafe.tools.mima.cli.Main"> - <arg value="--prev"/> - <arg value="${org.scala-lang:scala-library:jar}"/> - <arg value="--curr"/> - <arg value="${build-pack.dir}/lib/scala-library.jar"/> - <classpath> - <path refid="mima.classpath"/> - </classpath> - </java> - <java - fork="true" - failonerror="true" - classname="com.typesafe.tools.mima.cli.Main"> - <arg value="--prev"/> - <arg value="${org.scala-lang:scala-reflect:jar}"/> - <arg value="--curr"/> - <arg value="${build-pack.dir}/lib/scala-reflect.jar"/> - <classpath> - <path refid="mima.classpath"/> - </classpath> - </java> + <macrodef name="bc.run-mima"> + <attribute name="jar-name"/> + <attribute name="prev"/> + <attribute name="curr"/> + <attribute name="direction"/> + <sequential> + <echo message="Checking @{direction} binary compatibility for @{jar-name} (against ${bc-reference-version})"/> + <java taskname="mima" + fork="true" + failonerror="true" + classname="com.typesafe.tools.mima.cli.Main"> + <arg value="--prev"/> + <arg value="@{prev}"/> + <arg value="--curr"/> + <arg value="@{curr}"/> + <arg value="--filters"/> + <arg value="${basedir}/bincompat-@{direction}.whitelist.conf"/> + <arg value="--generate-filters"/> + <classpath> + <path refid="mima.classpath"/> + </classpath> + </java> + </sequential> + </macrodef> + + <macrodef name="bc.check"> + <attribute name="jar-name"/> + <sequential> + <bc.run-mima + jar-name="@{jar-name}" + prev="${org.scala-lang:@{jar-name}:jar}" + curr="${build-pack.dir}/lib/@{jar-name}.jar" + direction="backward"/> + <bc.run-mima + jar-name="@{jar-name}" + prev="${build-pack.dir}/lib/@{jar-name}.jar" + curr="${org.scala-lang:@{jar-name}:jar}" + direction="forward"/> + </sequential> + </macrodef> + + <target name="test.bc-opt" description="Optimized version of test.bc."> <optimized name="test.bc"/></target> + + <!-- Enable after the release of the 2.11.0 or a prior RC that estabilishes the new baseline. --> + <target name="test.bc"></target> + <target name="test.bc.disabled" depends="bc.init, pack.lib, pack.reflect, pack.swing"> + <bc.check jar-name="scala-library"/> + <bc.check jar-name="scala-reflect"/> + <bc.check jar-name="scala-swing"/> </target> <!-- =========================================================================== @@ -1509,6 +1569,7 @@ targets exercised: <include name="swing/**"/> <include name="actors/**"/> <include name="reflect/**"/> + <include name="continuations/library/**"/> </srcfiles></check> <do> <stopwatch name="docs.lib.timer"/> @@ -1656,6 +1717,13 @@ targets exercised: <include name="scalap.jar"/> </fileset> </copy> + + <copy todir="${dist.dir}/lib"> + <resources refid="partest.extras.fileset"/> + <mapper classpathref="maven-ant-tasks.classpath" classname="org.apache.maven.artifact.ant.VersionMapper" + from="${partest.extras.versions}" to="flatten"/> + </copy> + <mkdir dir="${dist.dir}/bin"/> <!-- TODO - Stop being inefficient and don't copy OSGi bundles overtop other jars. --> <copy-bundle name="scala-library"/> @@ -1804,7 +1872,7 @@ targets exercised: </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> + <optimized name="replacestarr"/></target> <!-- Ant on Windows is not able to delete jar files that are referenced in any <path>. See ticket 1290 on trac. --> @@ -1821,13 +1889,13 @@ targets exercised: </target> <target name="replacestarrwin-opt" description="Creates a new Starr on Windows. Manually execute 'ant locker.clean build' first!"> - <optimize name="replacestarrwin"/></target> + <optimized name="replacestarrwin"/></target> <target name="replacelocker" description="Replaces the Locker compiler and library by fresh ones built from current sources." depends="palo.clean, locker.unlock, palo.done"/> <target name="replacelocker-opt" description="Replaces the Locker compiler and library by fresh, optimised ones built from current sources."> - <optimize name="replacelocker"/></target> + <optimized name="replacelocker"/></target> <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 --> @@ -1846,105 +1914,6 @@ targets exercised: <target name="fastlocker" description="Buildlocker without extra fuss" depends="fastlocker.comp"/> - -<!-- =========================================================================== - 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"/> - </antcall> - <antcall target="test.positions.sub" inheritRefs="true"> - <param name="test.srcs" value="${src.dir}/compiler"/> - </antcall> - <antcall target="test.positions.sub" inheritRefs="true"> - <param name="test.srcs" value="${src.dir}/library"/> - </antcall> - <antcall target="test.positions.sub" inheritRefs="true"> - <param name="test.srcs" value="${src.dir}/actors"/> - </antcall> - <antcall target="test.positions.sub" inheritRefs="true"> - <param name="test.srcs" value="${src.dir}/dbc"/> - </antcall> - <antcall target="test.positions.sub" inheritRefs="true"> - <param name="test.srcs" value="${src.dir}/swing"/> - </antcall> - <antcall target="test.positions.sub" inheritRefs="true"> - <param name="test.srcs" value="${src.dir}/partest"/> - </antcall> - <antcall target="test.positions.sub" inheritRefs="true"> - <param name="test.srcs" value="${src.dir}/scalap"/> - </antcall> - <antcall target="test.positions.tests.sub" inheritRefs="true"> - <param name="test.tests.srcs" value="${partest.dir}/files/pos"/> - </antcall> - <antcall target="test.positions.tests.sub" inheritRefs="true"> - <param name="test.tests.srcs" value="${partest.dir}/files/run"/> - </antcall> - <antcall target="test.positions.tests.sub" inheritRefs="true"> - <param name="test.tests.srcs" value="${partest.dir}/files/neg"/> - </antcall> - </target> - - <target name="test.positions.sub"> - <echo message="Validating positions for: ${test.srcs}"/> - <if> - <isfileselected file="${test.srcs}"> - <type type="dir"/> - </isfileselected> - <then> - <property name="srcdir" value="${test.srcs}"/> - <property name="srcs" value="**/*.scala"/> - </then> - <else> - <dirname property="srcdir" file="${test.srcs}"/> - <basename property="srcs" file="${test.srcs}"/> - </else> - </if> - <scalacfork - destdir="" - compilerpathref="locker.compiler.path" - srcpath="${srcdir}" - params="-Xprint-pos -Yide-debug" - srcdir="${srcdir}" - jvmargs="${scalacfork.jvmargs}"> - <include name="${srcs}"/> - <compilationpath refid="test.positions.sub.build.path"/> - </scalacfork> - </target> - - <target name="test.positions.tests.sub"> - <foreach target="test.positions.sub" - inheritAll="true" - inheritRefs="true" - param="test.srcs"> - <path> - <fileset dir="${test.tests.srcs}" includes="*.scala"/> - <dirset dir="${test.tests.srcs}"> - <include name="*"/> - </dirset> - </path> - </foreach> - </target> - <!-- =========================================================================== VISUALIZATION ============================================================================ --> |