summaryrefslogtreecommitdiff
path: root/build.xml
diff options
context:
space:
mode:
Diffstat (limited to 'build.xml')
-rwxr-xr-xbuild.xml165
1 files changed, 136 insertions, 29 deletions
diff --git a/build.xml b/build.xml
index 0c6eb1e50d..67e4a32636 100755
--- a/build.xml
+++ b/build.xml
@@ -29,7 +29,7 @@ scalacArgs examples:
"-Dscalac.args=\"-Yrangepos\" -Dpartest.scalac_opts=\"-Yrangepos\""
targets exercised:
- distpack-maven-opt nightly locker.done build-opt test.suite test.continuations.suite test.scaladoc
+ deploy-core.snapshot publish-opt-nodocs distpack-maven-opt nightly locker.done build build-opt test.suite test.continuations.suite test.scaladoc
NOTE: after distpack-maven-opt, it is expected there's a build file in dists/maven/latest that defines targets deploy and deploy.local
TODO: get rid of this separate step
@@ -278,18 +278,20 @@ TODO:
<artifact:remoteRepository id="extra-repo" url="${extra.repo.url}"/>
+ <!-- TODO: delay until absolutely necessary to allow minimal build, also move out partest dependency from scaladoc -->
<artifact:dependencies pathId="partest.classpath" filesetId="partest.fileset" versionsId="partest.versions">
<!-- uncomment the following if you're deploying your own partest locally -->
<!-- <localRepository path="${user.home}/.m2/repository"/> -->
<!-- so we don't have to wait for artifacts to synch to maven central
(we don't distribute partest with Scala, so the risk of sonatype and maven being out of synch is irrelevant):
-->
- <!-- <artifact:remoteRepository refid="extra-repo"/> -->
+ <artifact:remoteRepository refid="extra-repo"/>
<dependency groupId="org.scala-lang.modules" artifactId="scala-partest_${scala.binary.version}" version="${partest.version.number}" />
</artifact:dependencies>
<copy-deps project="partest"/>
<artifact:dependencies pathId="scalacheck.classpath" filesetId="scalacheck.fileset" versionsId="scalacheck.versions">
+ <artifact:remoteRepository refid="extra-repo"/>
<dependency groupId="org.scalacheck" artifactId="scalacheck_${scala.binary.version}" version="${scalacheck.version.number}" />
</artifact:dependencies>
@@ -301,7 +303,7 @@ TODO:
<!-- used by the test.osgi target to create osgi bundles for the xml, parser-combinator jars
must specify sourcesFilesetId, javadocFilesetId to download these types of artifacts -->
<artifact:dependencies pathId="external-modules.deps.classpath" sourcesFilesetId="external-modules.sources.fileset" javadocFilesetId="external-modules.javadoc.fileset">
- <!-- <artifact:remoteRepository refid="extra-repo"/> -->
+ <artifact:remoteRepository refid="extra-repo"/>
<dependency groupId="org.scala-lang.modules" artifactId="scala-xml_${scala.binary.version}" version="${scala-xml.version.number}"/>
<dependency groupId="org.scala-lang.modules" artifactId="scala-parser-combinators_${scala.binary.version}" version="${scala-parser-combinators.version.number}"/>
</artifact:dependencies>
@@ -573,9 +575,23 @@ TODO:
<property name="reflect.skipPackages" value="scala.reflect.macros.internal:scala.reflect.internal:scala.reflect.io"/>
<property name="compiler.description" value="Scala Compiler"/>
- <property name="compiler.name" value="scala-compiler"/>
<property name="compiler.docroot" value="rootdoc.txt"/>
+ <!-- these are not used used, preparation for the 'TODO modularize compiler' task -->
+ <property name="interactive.description" value="Scala Interactive Compiler" />
+ <property name="interactive.package" value="modules." />
+ <property name="interactive.name" value="scala-compiler-interactive"/>
+ <property name="interactive.namesuffix" value="_${scala.binary.version}"/>
+ <property name="interactive.version" value="${scala-compiler-interactive.version.number}"/>
+ <property name="interactive.targetjar" value="scala-compiler-interactive_${scala.binary.version}-${scala-compiler-interactive.version.number}.jar"/>
+
+ <property name="scaladoc.description" value="Scala Documentation Generator"/>
+ <property name="scaladoc.package" value="modules." />
+ <property name="scaladoc.name" value="scala-compiler-doc" />
+ <property name="scaladoc.namesuffix" value="_${scala.binary.version}"/>
+ <property name="scaladoc.version" value="${scala-compiler-doc.version.number}"/>
+ <property name="scaladoc.targetjar" value="scala-compiler-doc_${scala.binary.version}-${scala-compiler-doc.version.number}.jar"/>
+
<property name="actors.description" value="Scala Actors Library"/>
<property name="continuations-plugin.description" value="Scala Delimited Continuations Compiler Plugin"/>
@@ -623,7 +639,7 @@ TODO:
</macrodef>
<!-- projects without project-specific options: asm, forkjoin, manual, bin, repl -->
- <for list="actors,compiler,continuations-library,continuations-plugin,library,parser-combinators,partest,partest-extras,partest-javaagent,reflect,scalap,swing,xml" param="project">
+ <for list="actors,compiler,interactive,scaladoc,continuations-library,continuations-plugin,library,parser-combinators,partest,partest-extras,partest-javaagent,reflect,scalap,swing,xml" param="project">
<sequential>
<!-- description is mandatory -->
<init-project-prop project="@{project}" name="package" default=""/>
@@ -673,7 +689,9 @@ TODO:
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, continuations-plugin, continuations-library, interactive, scaladoc, scalap
+ when stage is quick, @{project} also includes: actors, repl, swing, continuations-plugin, continuations-library, scalap
+
+ NOTE: interactive, scaladoc, are only used upto quick; they are still packed into the compiler jar
-->
<!-- LOCKER -->
@@ -766,7 +784,6 @@ TODO:
<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>
@@ -795,6 +812,7 @@ TODO:
<pathelement location="${actors.jar}"/>
<pathelement location="${reflect.jar}"/>
<pathelement location="${compiler.jar}"/>
+ <!-- TODO modularize compiler: <pathelement location="${scaladoc.jar}"/> -->
<pathelement location="${scalap.jar}"/>
<path refid="repl.deps.classpath"/>
<path refid="aux.libs"/>
@@ -812,12 +830,19 @@ TODO:
<path id="pack.compiler.files">
<fileset dir="${build-quick.dir}/classes/compiler"/>
- <fileset dir="${build-quick.dir}/classes/repl"/>
+
+ <!-- TODO modularize compiler. Remove the other class dirs as soon as they become modules -->
<fileset dir="${build-quick.dir}/classes/scaladoc"/>
<fileset dir="${build-quick.dir}/classes/interactive"/>
+ <fileset dir="${build-quick.dir}/classes/repl"/>
<fileset dir="${asm-classes}"/>
</path>
+ <!-- TODO modularize compiler.
+ <path id="pack.scaladoc.files"> <fileset dir="${build-quick.dir}/classes/scaladoc"/> </path>
+ <path id="pack.interactive.files"><fileset dir="${build-quick.dir}/classes/interactive"/> </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.continuations-plugin.files"> <fileset dir="${build-quick.dir}/classes/continuations-plugin"/> </path>
@@ -849,18 +874,26 @@ TODO:
<path id="docs.library.build.path"> <path refid="quick.library.build.path"/> </path>
<path id="docs.reflect.build.path"> <path refid="quick.reflect.build.path"/> </path>
<path id="docs.compiler.build.path"> <path refid="quick.compiler.build.path"/> </path>
+ <path id="docs.scaladoc.build.path"> <path refid="quick.scaladoc.build.path"/> </path>
+ <path id="docs.interactive.build.path"> <path refid="quick.interactive.build.path"/> </path>
<path id="docs.scalap.build.path"> <path refid="quick.scalap.build.path"/> </path>
<path id="docs.continuations-plugin.build.path"> <path refid="quick.continuations-plugin.build.path"/> </path>
<path id="docs.continuations-library.build.path"> <path refid="quick.continuations-plugin.build.path"/> </path>
<path id="docs.actors.build.path"> <path refid="quick.actors.build.path"/> </path>
<path id="docs.swing.build.path"> <path refid="quick.swing.build.path"/> </path>
- <!-- run-time classpath for scaladoc: should be resolved through maven once it's an actual module -->
+ <!-- run-time classpath for scaladoc TODO: resolve through maven -->
<path id="scaladoc.classpath">
<path refid="external-modules-nocore"/>
<pathelement location="${library.jar}"/>
<pathelement location="${reflect.jar}"/>
<pathelement location="${compiler.jar}"/>
+
+ <!-- TODO modularize compiler
+ <pathelement location="${interactive.jar}"/>
+ <pathelement location="${scaladoc.jar}"/>
+ -->
+
<pathelement location="${ant.jar}"/>
<path refid="aux.libs"/>
</path>
@@ -874,10 +907,10 @@ TODO:
<!-- 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"/>
+ <path refid="scaladoc.classpath"/>
+ <!-- TODO modularize compiler: bring back when repl leaves compiler jar
+ <pathelement location="${build-quick.dir}/classes/repl"/>
+ -->
<pathelement location="${sbt.interface.jar}"/>
</path>
@@ -888,9 +921,20 @@ TODO:
Why, the compiler we're testing, of course, and partest with all its dependencies.
-->
<path id="partest.compilation.path">
+ <path refid="partest.compilation.path.core"/>
+ <path refid="partest.compilation.path.noncore"/>
+ </path>
+ <path id="partest.compilation.path.core">
<pathelement location="${library.jar}"/>
<pathelement location="${reflect.jar}"/>
<pathelement location="${compiler.jar}"/>
+ </path>
+ <path id="partest.compilation.path.noncore">
+
+ <!-- TODO modularize compiler
+ <pathelement location="${scaladoc.jar}"/>
+ <pathelement location="${interactive.jar}"/>
+ -->
<!-- TODO: move scalap & actors out of repo -->
<pathelement location="${scalap.jar}"/>
@@ -1353,6 +1397,8 @@ TODO:
</sequential>
</macrodef>
+
+
<!-- ===========================================================================
LOCAL REFERENCE BUILD (LOCKER)
============================================================================ -->
@@ -1407,13 +1453,6 @@ TODO:
<target name="quick.swing" depends="quick.actors, quick.lib" if="has.java6">
<staged-build with="locker" stage="quick" project="swing"/> </target>
- <target name="quick.partest-extras"
- depends="quick.comp">
- <!-- compile compiler-specific parts of partest -->
- <staged-build with="starr" stage="quick" project="partest-extras" />
- <staged-build with="starr" stage="quick" project="partest-javaagent" />
- </target>
-
<target name="quick.plugins" depends="quick.comp">
<staged-uptodate stage="quick" project="continuations-plugin">
@@ -1459,6 +1498,7 @@ TODO:
<target name="pack.reflect" depends="quick.reflect"> <staged-pack project="reflect"/> </target>
+ <!-- TODO modularize compiler. Remove other quick targets when they become modules. -->
<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) -->
@@ -1485,6 +1525,11 @@ TODO:
</staged-pack>
</target>
+ <!-- TODO modularize compiler. These targets are currently not used.
+ <target name="pack.scaladoc" depends="quick.scaladoc"> <staged-pack project="scaladoc"/> </target>
+ <target name="pack.interactive" depends="quick.interactive"> <staged-pack project="interactive"/> </target>
+ -->
+
<target name="pack.actors" depends="quick.actors"> <staged-pack project="actors"/> </target>
<target name="pack.swing" if="has.java6" depends="quick.swing"> <staged-pack project="swing"/> </target>
@@ -1494,21 +1539,27 @@ TODO:
<target name="pack.core" depends="pack.reflect, pack.comp, pack.lib"/>
- <target name="pack.modules" depends="pack.core, pack.actors, pack.swing, pack.plugins, pack.scalap">
+ <!-- TODO modularize compiler: pack.scaladoc, pack.interactive, -->
+ <target name="pack.modules" depends="pack.actors, pack.swing, pack.plugins, pack.scalap">
<copy todir="${build-pack.dir}/lib">
<path refid="external-modules-nocore" />
<mapper type="flatten" />
</copy>
</target>
- <target name="scaladoc.task" depends="pack.modules" unless="docs.skip">
+ <!-- depends on pack.core for scaladoc -->
+ <target name="scaladoc.task" depends="pack.core, pack.modules" unless="docs.skip">
<taskdef resource="scala/tools/ant/antlib.xml" classpathref="scaladoc.classpath"/>
</target>
- <target name="pack.partest-extras" depends="quick.partest-extras">
- <staged-pack project="partest-extras"/>
- <staged-pack project="partest-javaagent"
- manifest="${src.dir}/partest-javaagent/scala/tools/partest/javaagent/MANIFEST.MF"/>
+ <target name="pack.partest-extras" depends="quick.comp">
+ <!-- compile compiler-specific parts of partest -->
+ <staged-build with="quick" stage="quick" project="partest-extras" />
+ <staged-build with="quick" stage="quick" project="partest-javaagent" />
+
+ <staged-pack project="partest-extras"/>
+ <staged-pack project="partest-javaagent"
+ manifest="${src.dir}/partest-javaagent/scala/tools/partest/javaagent/MANIFEST.MF"/>
</target>
<target name="pack.bin" depends="pack.core, pack.modules, pack.partest-extras">
@@ -1558,6 +1609,10 @@ TODO:
<!-- ===========================================================================
OSGi Artifacts
============================================================================ -->
+ <!-- This task takes the output of the pack stage and OSGi-fies the jars based on the bnd files in src/build/bnd
+ This means adding manifests and enforcing the Exports clauses (removing non-exported classes!)
+ These jars are then copied to the distribution and published to maven.
+ -->
<macrodef name="make-bundle">
<attribute name="project" />
<element name="srcs" description="Sources for this bundle" optional="true" implicit="true"/>
@@ -1620,11 +1675,12 @@ TODO:
<fileset dir="${src.dir}/reflect"/>
</make-bundle>
+ <!-- TODO modularize compiler. Remove the other class dirs as soon as they become modules -->
<make-bundle project="compiler">
<fileset dir="${src.dir}/compiler"/>
- <fileset dir="${src.dir}/repl"/>
<fileset dir="${src.dir}/scaladoc"/>
<fileset dir="${src.dir}/interactive"/>
+ <fileset dir="${src.dir}/repl"/>
</make-bundle>
<touch file="${build-osgi.dir}/bundles.core.complete" verbose="no"/>
@@ -1633,10 +1689,16 @@ TODO:
</target>
<target name="osgi.done" depends="pack.done, osgi.core">
- <uptodate property="osgi.bundles.available" targetfile="${build-osgi.dir}/bundles.all.complete">
+ <uptodate property="osgi.all.bundles.available" targetfile="${build-osgi.dir}/bundles.all.complete">
<srcfiles dir="${basedir}">
<include name="build.xml"/>
<include name="src/build/bnd/*.bnd"/>
+
+ <!-- TODO modularize compiler
+ <include name="${interactive.jar}"/>
+ <include name="${scaladoc.jar}"/>
+ -->
+
<include name="${actors.jar}"/>
<include name="${continuations-plugin.jar}"/>
<include name="${swing.jar}"/>
@@ -1645,9 +1707,22 @@ TODO:
</srcfiles>
</uptodate>
- <if><not><isset property="osgi.bundles.available"/></not><then>
+ <if><not><isset property="osgi.all.bundles.available"/></not><then>
<stopwatch name="osgi.all.timer"/>
+ <!-- TODO modularize compiler
+ TODO: refactor so that we can restrict exported packages to scala.tools.nsc.doc.*
+ move ant task, partest stuff to other jars,
+ and move scala.tools.nsc.ScalaDoc main class to scala.tools.nsc.doc
+ <make-bundle project="scaladoc">
+ <fileset dir="${src.dir}/scaladoc"/>
+ </make-bundle>
+
+ TODO: refactor so that we can restrict exported packages to scala.tools.nsc.interactive.*
+ <make-bundle project="interactive">
+ <fileset dir="${src.dir}/interactive"/>
+ </make-bundle>
+ -->
<make-bundle project="actors">
<fileset dir="${src.dir}/actors"/>
@@ -1825,6 +1900,17 @@ TODO:
<testSuite colors="8" kinds="pos neg run jvm res scalap scalacheck specialized instrumented"/>
</target>
+ <target name="test.suite.quick" depends="init, quick.done">
+ <path id="test.suite.path">
+ <path refid="quick.bin.tool.path"/>
+ <path refid="quick.interactive.build.path"/>
+ <path refid="partest.compilation.path.noncore"/>
+ </path>
+ <property name="pcp" value="${toString:test.suite.path}"/>
+ <taskdef classpathref="test.suite.path" resource="scala/tools/partest/antlib.xml"/>
+ <testSuite colors="8" kinds="pos neg run jvm res scalap scalacheck specialized instrumented" pcp="${pcp}"/>
+ </target>
+
<target name="test.run" depends="test.suite.init">
<testSuite kinds="run jvm"/>
</target>
@@ -1970,6 +2056,20 @@ TODO:
</staged-docs>
</target>
+ <!-- TODO modularize compiler. These targets are currently not used.
+ <target name="docs.scaladoc" depends="docs.start" unless="docs.skip">
+ <staged-docs project="scaladoc">
+ <include name="**/*.scala"/>
+ </staged-docs>
+ </target>
+
+ <target name="docs.interactive" depends="docs.start" unless="docs.skip">
+ <staged-docs project="interactive">
+ <include name="**/*.scala"/>
+ </staged-docs>
+ </target>
+ -->
+
<target name="docs.actors" depends="docs.start" unless="docs.skip">
<staged-docs project="actors">
<include name="**/*.scala"/>
@@ -2038,6 +2138,7 @@ TODO:
</target>
<target name="docs.core" depends="docs.lib, docs.reflect, docs.comp" unless="docs.skip"/>
+ <!-- TODO modularize compiler: docs.scaladoc, docs.interactive, -->
<target name="docs.done" depends="docs.core, docs.actors, docs.swing, docs.scalap, docs.continuations-plugin, docs.continuations-library" unless="docs.skip"/>
<!-- ===========================================================================
@@ -2097,6 +2198,7 @@ TODO:
<chmod perm="ugo+rx" file="${dist.dir}/bin/scalap"/>
</target>
+
<target name="dist.doc" depends="dist.base, docs.done">
<mkdir dir="${dist.dir}/doc/scala-devel-docs"/>
<copy toDir="${dist.dir}/doc/scala-devel-docs" overwrite="true" flatten="true">
@@ -2257,6 +2359,11 @@ MAIN DISTRIBUTION PACKAGING
</target>
<target name="pack-maven.base" depends="pack-maven.core, osgi.done, docs.done">
+ <!-- TODO modularize compiler
+ <mvn-package project="interactive"/>
+ <mvn-package project="scaladoc"/>
+ -->
+
<mvn-package project="swing"/>
<mvn-package project="actors"/>
<mvn-package project="continuations-plugin"/>