diff options
-rw-r--r-- | build.xml | 30 | ||||
-rw-r--r-- | src/build/five.xml | 519 |
2 files changed, 549 insertions, 0 deletions
@@ -1520,6 +1520,36 @@ STABLE REFERENCE (STARR) <target name="starr.done" depends="starr.libs"/> <!-- =========================================================================== +FORWARDED TARGETS FOR JVM 1.5 BUILD +============================================================================ --> + + <target name="five" depends="pack.done"> + <ant antfile="${src.dir}/build/five.xml" target="five.done" inheritall="yes" inheritrefs="yes"/> + </target> + + <target name="fivepack" depends="pack.done"> + <ant antfile="${src.dir}/build/five.xml" target="five-pack.done" inheritall="yes" inheritrefs="yes"/> + </target> + + <target name="fiveclean" depends="pack.done"> + <ant antfile="${src.dir}/build/five.xml" target="five.clean" inheritall="yes" inheritrefs="yes"/> + </target> + + <target name="fivetest" depends="pack.done"> + <ant antfile="${src.dir}/build/five.xml" target="five-test.done" inheritall="yes" inheritrefs="yes"/> + </target> + + <target name="fivedist" depends="pack.done"> + <ant antfile="${src.dir}/build/five.xml" target="five-all.done" inheritall="yes" inheritrefs="yes"/> + </target> + +<!-- + <target name="fourclean"> + <ant antfile="${src.dir}/build/four.xml" target="four-all.clean" inheritall="yes" inheritrefs="yes"/> + </target> +--> + +<!-- =========================================================================== FORWARDED TARGETS FOR MSIL BUILD ============================================================================ --> diff --git a/src/build/five.xml b/src/build/five.xml new file mode 100644 index 0000000000..5c8bf2c180 --- /dev/null +++ b/src/build/five.xml @@ -0,0 +1,519 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<project name="sabbus-onesix"> + + <description> + SuperSabbus extension for the Scala library and compiler targeted for the JVM 1.5. THIS FILE IS NOT STAND-ALONE AND SHOULD ONLY BE USED THROUGH ENTRY POINTS IN SUPERSABBUS. + </description> + + <!-- TODO: Use a 1.5 Java standard library to compile against, instead of that of the JVM running the script. --> + <!-- TODO: Use a 1.5 Java standard library to run partests. Add a bootclasspath option to partest to allow that. --> + +<!-- =========================================================================== +PROPERTIES +============================================================================ --> + + <property name="build-five.dir" value="${build.dir}/five"/> + <property name="build-five-src.dir" value="${build.dir}/five-src"/> + <property name="build-five-pack.dir" value="${build.dir}/five-pack"/> + <property name="build-five-docs.dir" value="${build.dir}/five-docs"/> + +<!-- =========================================================================== +JAVA 1.5 LIBRARY AND COMPILER BUILD (FIVE) +============================================================================ --> + + <target name="five.start"/> + + <target name="five.src" depends="five.start"> + <!-- simple sync & copy overwrite is not very nice, because overwritten files + will then have a new timestamp, and be recompiled --> + <mkdir dir="${build-five-src.dir}"/> + <copy todir="${build-five-src.dir}" overwrite="true"> + <fileset dir="${src.dir}/library"> + <and> + <present present="srconly" targetdir="${src.dir}/jvm15-library"/> + <different targetdir="${build-five-src.dir}" ignoreFileTimes="true"/> + </and> + </fileset> + <fileset dir="${src.dir}/jvm15-library"> + <different targetdir="${build-five-src.dir}" ignoreFileTimes="true"/> + </fileset> + </copy> + <delete verbose="true"> + <difference> + <fileset dir="${build-five-src.dir}"/> + <union> + <fileset dir="${build-five-src.dir}"> + <present targetdir="${src.dir}/jvm15-library"/> + </fileset> + <fileset dir="${build-five-src.dir}"> + <present targetdir="${src.dir}/library"/> + </fileset> + </union> + </difference> + </delete> + <mkdir dir="${build-five-src.dir}-actors"/> + <copy todir="${build-five-src.dir}-actors" overwrite="true"> + <fileset dir="${src.dir}/actors"> + <and> + <present present="srconly" targetdir="${src.dir}/jvm15-actors"/> + <different targetdir="${build-five-src.dir}-actors" ignoreFileTimes="true"/> + </and> + </fileset> + <fileset dir="${src.dir}/jvm15-actors"> + <different targetdir="${build-five-src.dir}-actors" ignoreFileTimes="true"/> + </fileset> + </copy> + <delete verbose="true"> + <difference> + <fileset dir="${build-five-src.dir}-actors"/> + <union> + <fileset dir="${build-five-src.dir}-actors"> + <present targetdir="${src.dir}/jvm15-actors"/> + </fileset> + <fileset dir="${build-five-src.dir}-actors"> + <present targetdir="${src.dir}/actors"/> + </fileset> + </union> + </difference> + </delete> + </target> + + <target name="five.lib" depends="five.src"> + <stopwatch name="five.lib.timer"/> + <mkdir dir="${build-five.dir}/classes/library"/> + <javac + srcdir="${build-five-src.dir}" + destdir="${build-five.dir}/classes/library" + classpath="${build-five.dir}/classes/library" + includes="**/*.java" + target="1.5" source="1.5"/> + <javac + srcdir="${build-five-src.dir}-actors" + destdir="${build-five.dir}/classes/library" + classpath="${build-five.dir}/classes/library" + includes="**/*.java" + target="1.5" source="1.5"/> + <scalac + srcdir="${build-five-src.dir}" + destdir="${build-five.dir}/classes/library" + classpath="${build-five.dir}/classes/library" + sourcepath="${build-five-src.dir}"> + <include name="scala/Predef.scala"/> + <include name="scala/LowPriorityImplicits.scala"/> + </scalac> + <scalac + srcdir="${build-five-src.dir}" + destdir="${build-five.dir}/classes/library" + classpath="${build-five.dir}/classes/library"> + <include name="**/*.scala"/> + <exclude name="scala/Predef.scala"/> + </scalac> + <scalac + srcdir="${build-five-src.dir}-actors" + destdir="${build-five.dir}/classes/library" + classpath="${build-five.dir}/classes/library"> + <include name="**/*.scala"/> + </scalac> + <scalac + srcdir="${src.dir}/dbc" + destdir="${build-five.dir}/classes/library" + classpath="${build-five.dir}/classes/library"> + <include name="**/*.scala"/> + </scalac> + <scalac + srcdir="${src.dir}/swing" + destdir="${build-five.dir}/classes/library" + classpath="${build-five.dir}/classes/library"> + <include name="**/*.scala"/> + </scalac> + <propertyfile file="${build-five.dir}/classes/library/library.properties"> + <entry key="version.number" value="${version.number}"/> + <entry key="copyright.string" value="${copyright.string}"/> + </propertyfile> + <copy todir="${build-five.dir}/classes/library"> + <fileset dir="${build-five-src.dir}"> + <include name="**/*.tmpl"/> + <include name="**/*.xml"/> + <include name="**/*.js"/> + <include name="**/*.css"/> + </fileset> + </copy> + <touch file="${build-five.dir}/library.complete" verbose="no"/> + <stopwatch name="five.lib.timer" action="total"/> + </target> + + <target name="five.pre-comp" depends="five.lib"> + <uptodate property="five.comp.available" targetfile="${build-five.dir}/compiler.complete"> + <srcfiles dir="${src.dir}/compiler"/> + </uptodate> + </target> + + <target name="five.comp" depends="five.pre-comp" unless="five.comp.available"> + <stopwatch name="five.comp.timer"/> + <mkdir dir="${build-five.dir}/classes/compiler"/> + <scalac + srcdir="${src.dir}/compiler" + destdir="${build-five.dir}/classes/compiler"> + <include name="**/*.scala"/> + <classpath> + <pathelement location="${build-five.dir}/classes/library"/> + <pathelement location="${build-five.dir}/classes/compiler"/> + <pathelement location="${fjbg.jar}"/> + <pathelement location="${msil.jar}"/> + <pathelement location="${jline.jar}"/> + <pathelement location="${ant.jar}"/> + </classpath> + </scalac> + <propertyfile file="${build-five.dir}/classes/compiler/compiler.properties"> + <entry key="version.number" value="${version.number}"/> + <entry key="copyright.string" value="${copyright.string}"/> + </propertyfile> + <copy todir="${build-five.dir}/classes/compiler"> + <fileset dir="${src.dir}/compiler"> + <include name="**/*.tmpl"/> + <include name="**/*.xml"/> + <include name="**/*.js"/> + <include name="**/*.css"/> + </fileset> + </copy> + <touch file="${build-five.dir}/compiler.complete" verbose="no"/> + <stopwatch name="five.comp.timer" action="total"/> + </target> + + <target name="five.pre-scalap" depends="five.comp"> + <uptodate property="five.scalap.available" targetfile="${build-five.dir}/scalap.complete"> + <srcfiles dir="${src.dir}/scalap"/> + </uptodate> + </target> + + <target name="five.scalap" depends="five.pre-scalap" unless="five.scalap.available"> + <stopwatch name="five.scalap.timer"/> + <mkdir dir="${build-five.dir}/classes/scalap"/> + <scalacfork + destdir="${build-five.dir}/classes/scalap" + compilerpathref="locker.classpath" + srcpath="${src.dir}/scalap" + params="${scalac.args}" + srcdir="${src.dir}/scalap" + jvmargs="${scalacfork.jvmargs}"> + <include name="**/*.scala"/> + <compilationpath> + <pathelement location="${build-five.dir}/classes/library"/> + <pathelement location="${build-five.dir}/classes/compiler"/> + <pathelement location="${build-five.dir}/classes/partest"/> + <pathelement location="${build-five.dir}/classes/scalap"/> + <pathelement location="${ant.jar}"/> + </compilationpath> + </scalacfork> + <touch file="${build-five.dir}/scalap.complete" verbose="no"/> + <stopwatch name="five.scalap.timer" action="total"/> + </target> + + <target name="five.partest" depends="five.scalap"> + <stopwatch name="five.partest.timer"/> + <mkdir dir="${build-five.dir}/classes/partest"/> + <javac + srcdir="${src.dir}/partest" + destdir="${build-five.dir}/classes/partest"> + <classpath> + <pathelement location="${build-five.dir}/classes/library"/> + <pathelement location="${build-five.dir}/classes/compiler"/> + <pathelement location="${build-five.dir}/classes/scalap"/> + <pathelement location="${build-five.dir}/classes/partest"/> + </classpath> + <include name="**/*.java"/> + <compilerarg line="${javac.args}"/> + </javac> + <scalac + srcdir="${src.dir}/partest" + destdir="${build-five.dir}/classes/partest"> + <include name="**/*.scala"/> + <classpath> + <pathelement location="${build-five.dir}/classes/library"/> + <pathelement location="${build-five.dir}/classes/compiler"/> + <pathelement location="${build-five.dir}/classes/scalap"/> + <pathelement location="${build-five.dir}/classes/partest"/> + <pathelement location="${ant.jar}"/> + </classpath> + </scalac> + <propertyfile file="${build-five.dir}/classes/partest/partest.properties"> + <entry key="version.number" value="${partest.version.number}"/> + <entry key="copyright.string" value="${copyright.string}"/> + </propertyfile> + <copy todir="${build-five.dir}/classes/partest"> + <fileset dir="${src.dir}/partest"> + <include name="**/*.xml"/> + </fileset> + </copy> + <touch file="${build-five.dir}/partest.complete" verbose="no"/> + <stopwatch name="five.partest.timer" action="total"/> + </target> + + <target name="five.done" depends="five.partest"/> + + <target name="five.clean" depends="five-pack.clean"> + <delete dir="${build-five.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/> + <delete dir="${build-five-src.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/> + </target> + +<!-- =========================================================================== +PACKED FIVE BUILD (PACK) +============================================================================ --> + + <target name="five-pack.start" depends="five.done"/> + + <target name="five-pack.pre-lib" depends="five-pack.start"> + <uptodate + property="five-pack.lib.available" + targetfile="${build-five-pack.dir}/lib/scala-library.jar" + srcfile="${build-five.dir}/library.complete"/> + </target> + + <target name="five-pack.lib" depends="five-pack.pre-lib" unless="five-pack.lib.available"> + <mkdir dir="${build-five-pack.dir}/lib"/> + <jar destfile="${build-five-pack.dir}/lib/scala-library.jar"> + <fileset dir="${build-five.dir}/classes/library"> + <exclude name="scala/dbc/**"/> + <exclude name="scala/swing/**"/> + </fileset> + </jar> + <jar destfile="${build-five-pack.dir}/lib/scala-dbc.jar"> + <fileset dir="${build-five.dir}/classes/library"> + <include name="scala/dbc/**"/> + </fileset> + </jar> + <jar destfile="${build-five-pack.dir}/lib/scala-swing.jar"> + <fileset dir="${build-five.dir}/classes/library"> + <include name="scala/swing/**"/> + </fileset> + <fileset dir="${src.dir}/swing"> + <include name="scala/swing/test/images/**"/> + </fileset> + </jar> + </target> + + <target name="five-pack.pre-comp" depends="five-pack.lib"> + <uptodate + property="five-pack.comp.available" + targetfile="${build-five-pack.dir}/lib/scala-compiler.jar" + srcfile="${build-five.dir}/compiler.complete"/> + </target> + + <target name="five-pack.comp" depends="five-pack.pre-comp" unless="five-pack.comp.available"> + <mkdir dir="${build-five-pack.dir}/META-INF"/> + <copy file="META-INF/MANIFEST.MF" toDir="${build-five-pack.dir}/META-INF"/> + <manifest file="${build-five-pack.dir}/META-INF/MANIFEST.MF" mode="update"> + <attribute name="Bundle-Version" value="${version.number}"/> + </manifest> + <mkdir dir="${build-five-pack.dir}/lib"/> + <jar destfile="${build-five-pack.dir}/lib/scala-compiler.jar" manifest="${build-five-pack.dir}/META-INF/MANIFEST.MF"> + <fileset dir="${build-five.dir}/classes/compiler"/> + <!-- filemode / dirmode: see trac ticket #1294 --> + <zipfileset dirmode="755" filemode="644" src="${fjbg.jar}"/> + <zipfileset dirmode="755" filemode="644" src="${msil.jar}"/> + </jar> + <copy file="${jline.jar}" toDir="${build-five-pack.dir}/lib"/> + </target> + + <target name="five-pack.pre-partest" depends="five-pack.comp"> + <uptodate + property="five-pack.partest.available" + targetfile="${build-five-pack.dir}/lib/scala-partest.jar" + srcfile="${build-five.dir}/partest.complete"/> + </target> + + <target name="five-pack.partest" depends="five-pack.pre-partest" unless="five-pack.partest.available"> + <mkdir dir="${build-five-pack.dir}/lib"/> + <jar destfile="${build-five-pack.dir}/lib/scala-partest.jar"> + <fileset dir="${build-five.dir}/classes/partest"/> + </jar> + </target> + + <target name="five-pack.pre-scalap" depends="five-pack.partest"> + <uptodate + property="five-pack.scalap.available" + targetfile="${build-five-pack.dir}/lib/scalap.jar" + srcfile="${build-five.dir}/scalap.complete"/> + </target> + + <target name="five-pack.scalap" depends="five-pack.pre-scalap" unless="five-pack.scalap.available"> + <mkdir dir="${build-five-pack.dir}/lib"/> + <jar destfile="${build-five-pack.dir}/lib/scalap.jar"> + <fileset dir="${build-five.dir}/classes/scalap"/> + <fileset file="${src.dir}/scalap/decoder.properties"/> + </jar> + </target> + + <target name="five-pack.pre-bin" depends="five-pack.scalap"> + <uptodate + property="five-pack.bin.available" + srcfile="${build-five-pack.dir}/lib/scala-compiler.jar" + targetfile="${build-five-pack.dir}/bin.complete"/> + </target> + + <target name="five-pack.bin" depends="five-pack.pre-bin" unless="five-pack.bin.available"> + <taskdef name="five-pack-bin" classname="scala.tools.ant.ScalaTool"> + <classpath> + <pathelement location="${build-five-pack.dir}/lib/scala-library.jar"/> + <pathelement location="${build-five-pack.dir}/lib/scala-compiler.jar"/> + <pathelement location="${build-five-pack.dir}/lib/jline.jar"/> + </classpath> + </taskdef> + <mkdir dir="${build-five-pack.dir}/bin"/> + <five-pack-bin + file="${build-five-pack.dir}/bin/scala" + class="scala.tools.nsc.MainGenericRunner" + javaFlags="${java.flags}"/> + <five-pack-bin + file="${build-five-pack.dir}/bin/scalac" + class="scala.tools.nsc.Main" + javaFlags="${java.flags}"/> + <five-pack-bin + file="${build-five-pack.dir}/bin/scaladoc" + class="scala.tools.nsc.ScalaDoc" + javaFlags="${java.flags}"/> + <five-pack-bin + file="${build-five-pack.dir}/bin/fsc" + class="scala.tools.nsc.CompileClient" + javaFlags="${java.flags}"/> + <five-pack-bin + file="${build-five-pack.dir}/bin/scalap" + class="scala.tools.scalap.Main" + javaFlags="${java.flags}"/> + <chmod perm="ugo+rx" file="${build-five-pack.dir}/bin/scala"/> + <chmod perm="ugo+rx" file="${build-five-pack.dir}/bin/scalac"/> + <chmod perm="ugo+rx" file="${build-five-pack.dir}/bin/scaladoc"/> + <chmod perm="ugo+rx" file="${build-five-pack.dir}/bin/fsc"/> + <chmod perm="ugo+rx" file="${build-five-pack.dir}/bin/scalap"/> + <touch file="${build-five-pack.dir}/bin.complete" verbose="no"/> + </target> + + <target name="five-pack.done" depends="five-pack.bin"> + <path id="five-pack.classpath"> + <pathelement location="${build-five-pack.dir}/lib/scala-library.jar"/> + <pathelement location="${build-five-pack.dir}/lib/scala-compiler.jar"/> + <pathelement location="${build-five-pack.dir}/lib/scala-partest.jar"/> + <pathelement location="${build-five-pack.dir}/lib/scalap.jar"/> + <pathelement location="${ant.jar}"/> + </path> + <taskdef resource="scala/tools/ant/antlib.xml" classpathref="five-pack.classpath"/> + <taskdef resource="scala/tools/partest/antlib.xml" classpathref="five-pack.classpath"/> + </target> + + <target name="five-pack.clean"> + <delete dir="${build-five-pack.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/> + </target> + +<!-- =========================================================================== +DOCUMENTATION +============================================================================ --> + + <target name="five-docs.start" depends="five-pack.done"/> + + <target name="five-docs.lib" depends="five-docs.start"> + <stopwatch name="five-docs.lib.timer"/> + <mkdir dir="${build-five-docs.dir}/library"/> + <scaladoc + destdir="${build-five-docs.dir}/library" + windowtitle="Scala Library for JDK 1.5" + doctitle="Scala ${version.number} API" + classpathref="pack.classpath"> + <src> + <files includes="${src.dir}/dbc"/> + <files includes="${src.dir}/swing"/> + <files includes="${build-five-src.dir}-actors"/> + <files includes="${build-five-src.dir}"/> + </src> + <include name="**/*.scala"/> + </scaladoc> + <stopwatch name="five-docs.lib.timer" action="total"/> + </target> + + <target name="five-docs.done" depends="five-docs.lib"/> + + <target name="five-docs.clean"> + <delete dir="${build-five-docs.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/> + </target> + +<!-- =========================================================================== +TEST SUITE WHEN RUN ON JVM 1.6 +================================================================================ +This tests how a compiler, library and tests that where targeted for JVM 1.5 +work on a JVM 1.6. +============================================================================ --> + + <target name="five-test.suite" depends="five-pack.done"> + <partest showlog="yes" erroronfailed="yes" scalacopts="-target:jvm-1.4" + javacmd="${java.home}/bin/java -Xmx1024M" javaccmd="${javac.cmd}"> + <classpath> + <pathelement location="${build-five-pack.dir}/lib/scala-library.jar"/> + <pathelement location="${build-five-pack.dir}/lib/scala-compiler.jar"/> + <fileset dir="${test.dir}/files/lib" includes="*.jar"/> + </classpath> + <postests dir="${test.dir}/files/pos" includes="*.scala"/> + <negtests dir="${test.dir}/files/neg" includes="*.scala"/> + <runtests dir="${test.dir}/files"> + <include name="run/**/*.scala"/> + </runtests> + <jvmtests dir="${test.dir}/files/jvm" includes="*.scala"/> + <residenttests dir="${test.dir}/files/res" includes="*.res"/> + </partest> + </target> + + <target name="five-test.done" depends="five-test.suite"/> + +<!-- =========================================================================== +DISTRIBUTION +============================================================================ --> + + <target name="five-dist.start" depends="five-pack.done, five-docs.done"> + <property name="five-dist.dir" value="${dists.dir}/scala-jvm5-${version.number}"/> + </target> + + <target name="five-dist.base" depends="five-dist.start"> + <mkdir dir="${five-dist.dir}/lib"/> + <copy toDir="${five-dist.dir}/lib"> + <fileset dir="${build-five-pack.dir}/lib"/> + </copy> + <mkdir dir="${five-dist.dir}/bin"/> + <copy toDir="${five-dist.dir}/bin"> + <fileset dir="${build-five-pack.dir}/bin"/> + </copy> + <chmod perm="ugo+rx" file="${five-dist.dir}/bin/scala"/> + <chmod perm="ugo+rx" file="${five-dist.dir}/bin/scalac"/> + <chmod perm="ugo+rx" file="${five-dist.dir}/bin/scaladoc"/> + <chmod perm="ugo+rx" file="${five-dist.dir}/bin/fsc"/> + </target> + + <target name="five-dist.doc" depends="five-dist.base"> + <mkdir dir="${five-dist.dir}/doc/api"/> + <copy toDir="${five-dist.dir}/doc/api"> + <fileset dir="${build-five-docs.dir}/library"/> + </copy> + </target> + + <target name="five-dist.src" depends="five-dist.doc"> + <mkdir dir="${five-dist.dir}/src"/> + <jar destfile="${five-dist.dir}/src/scala-library-src.jar"> + <fileset dir="${build-five-src.dir}"/> + <fileset dir="${build-five-src.dir}-actors"/> + </jar> + <jar destfile="${five-dist.dir}/src/scala-dbc-src.jar"> + <fileset dir="${src.dir}/dbc"/> + </jar> + <jar destfile="${five-dist.dir}/src/scala-swing-src.jar"> + <fileset dir="${src.dir}/swing"/> + </jar> + <jar destfile="${five-dist.dir}/src/scala-compiler-src.jar"> + <fileset dir="${src.dir}/compiler"/> + </jar> + </target> + + <target name="five-dist.latest" depends="five-dist.src" unless="os.win"> + <symlink link="${dists.dir}/latest-jvm5" resource="${five-dist.dir}" overwrite="yes"/> + </target> + + <target name="five-dist.done" depends="five-dist.latest"/> + +</project> |