summaryrefslogtreecommitdiff
path: root/build.xml
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2013-08-29 17:15:34 -0700
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-08-29 20:09:05 -0700
commitce5c506ec3b815b8c97a2b938371154ab7dc668d (patch)
tree8a6fa480ad0a3fe884e5853d23f61d8074b050bc /build.xml
parent884bc78071f06be3113bfc53e3115b8d9061188f (diff)
downloadscala-ce5c506ec3b815b8c97a2b938371154ab7dc668d.tar.gz
scala-ce5c506ec3b815b8c97a2b938371154ab7dc668d.tar.bz2
scala-ce5c506ec3b815b8c97a2b938371154ab7dc668d.zip
Include xml and parsers in dist, tool classpath.
This brings the external modules (xml, parsers) back to the classpaths of build/(quick|pack)/bin/scala*. Include the OSGIfied jars for external modules in dist. (TODO: OSGI-fy externally) Download javadoc/sources from maven and include in dist.
Diffstat (limited to 'build.xml')
-rwxr-xr-xbuild.xml141
1 files changed, 82 insertions, 59 deletions
diff --git a/build.xml b/build.xml
index 4934071b50..fa1ca8e699 100755
--- a/build.xml
+++ b/build.xml
@@ -196,12 +196,12 @@ TODO:
</target>
<macrodef name="copy-deps" description="Copy a file set based on maven dependency resolution to a directory. Currently used by the IntelliJ config files.">
- <attribute name="fileset.prefix"></attribute>
- <attribute name="out"></attribute>
+ <attribute name="project" />
+ <attribute name="refid" default="@{project}.fileset"/>
<sequential>
- <delete dir="${build-deps.dir}/@{out}" includes="*.jar"/>
- <copy todir="${build-deps.dir}/@{out}">
- <fileset refid="@{fileset.prefix}.fileset" />
+ <delete dir="${build-deps.dir}/@{project}" includes="*.jar"/>
+ <copy todir="${build-deps.dir}/@{project}">
+ <resources refid="@{refid}" />
<mapper type="flatten" />
</copy>
</sequential>
@@ -233,7 +233,7 @@ TODO:
<artifact:dependencies pathId="junit.classpath" filesetId="junit.fileset">
<dependency groupId="junit" artifactId="junit" version="${junit.version}"/>
</artifact:dependencies>
- <copy-deps fileset.prefix="junit" out="junit"/>
+ <copy-deps project="junit"/>
<!-- Pax runner -->
<property name="pax.exam.version" value="2.5.0"/>
@@ -261,39 +261,64 @@ TODO:
<artifact:remoteRepository refid="sonatype-release"/>
<dependency groupId="org.scala-lang.modules" artifactId="scala-partest_${scala.binary.version}" version="${partest.version.number}" />
</artifact:dependencies>
- <copy-deps fileset.prefix="partest" out="partest"/>
+ <copy-deps project="partest"/>
- <artifact:dependencies pathId="repl.deps.classpath" filesetId="repl.deps.fileset" versionsId="repl.deps.versions">
+ <artifact:dependencies pathId="repl.deps.classpath" filesetId="repl.fileset" versionsId="repl.deps.versions">
<dependency groupId="jline" artifactId="jline" version="${jline.version}"/>
</artifact:dependencies>
- <copy-deps fileset.prefix="repl.deps" out="repl"/>
+ <copy-deps project="repl"/>
- <artifact:dependencies pathId="scaladoc.deps.classpath" filesetId="scaladoc.deps.fileset" versionsId="scaladoc.deps.versions">
- <!-- uncomment the following to facilitate building and publishing modules locally
- not on by default to avoid using unpublished jars in releases -->
- <!-- <localRepository path="${user.home}/.m2/repository"/> -->
+ <!-- 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">
<!-- sonatype is not enabled by default for modules to avoid a Scala release relying on a JAR that's not on maven (yet) -->
<!-- <artifact:remoteRepository refid="sonatype-release"/> -->
<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>
- <copy-deps fileset.prefix="scaladoc.deps" out="scaladoc"/>
- <!-- used by the test.osgi target to create osgi bundles for the xml, parser-combinator jars -->
- <artifact:dependencies pathId="osgi.deps.classpath" filesetId="osgi.deps.fileset" versionsId="osgi.deps.versions">
- <!-- sonatype is not enabled by default for modules to avoid a Scala release relying on a JAR that's not on maven (yet) -->
- <!-- <artifact:remoteRepository refid="sonatype-release"/> -->
- <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>
+ <!-- External modules, excluding the core -->
+ <path id="external-modules-nocore">
+ <restrict>
+ <path refid="external-modules.deps.classpath"/>
+ <rsel:not><rsel:or>
+ <rsel:name name="scala-library*.jar"/>
+ <rsel:name name="scala-reflect*.jar"/>
+ <rsel:name name="scala-compiler*.jar"/>
+ </rsel:or></rsel:not>
+ </restrict>
+ </path>
+ <copy-deps refid="external-modules-nocore" project="scaladoc"/>
+
+ <!--
+ include partest and its run-time dependencies,
+ but filter out the compiler we just built, as that's what we want to test!
+ TODO: mark partest's compiler dependencies as provided when publishing to maven,
+ so that we don't have to filter them out here...
+ -->
+ <path id="partest-deps-nocore">
+ <restrict>
+ <path refid="partest.classpath"/>
+ <rsel:not><rsel:or>
+ <rsel:name name="scala-library*.jar"/>
+ <rsel:name name="scala-reflect*.jar"/>
+ <rsel:name name="scala-compiler*.jar"/>
+ <!-- TODO: remove actors & scalap, move to external modules -->
+ <rsel:name name="scala-actors*.jar"/>
+ <rsel:name name="scala-scalap*.jar"/>
+ </rsel:or></rsel:not>
+ </restrict>
+ </path>
<!-- Set property named @{name} to the jar resolved as @{jar}_${scala.binary.version}:jar.
@{jar}_${scala.binary.version} must be a maven dependency. -->
- <macrodef name="propertyCrossedJar">
+ <macrodef name="propertyForCrossedArtifact">
<attribute name="name" />
<attribute name="jar" />
<sequential>
- <readProperty name="@{name}" property="@{jar}_${scala.binary.version}:jar" />
+ <readProperty name="@{name}" property="@{jar}_${scala.binary.version}:jar" />
+ <readProperty name="@{name}-sources" property="@{jar}_${scala.binary.version}:java-source:sources" />
+ <readProperty name="@{name}-javadoc" property="@{jar}_${scala.binary.version}:java-source:javadoc" />
</sequential>
</macrodef>
@@ -307,6 +332,9 @@ TODO:
</sequential>
</macrodef>
+ <propertyForCrossedArtifact name="scala-parser-combinators" jar="org.scala-lang.modules:scala-parser-combinators"/>
+ <propertyForCrossedArtifact name="scala-xml" jar="org.scala-lang.modules:scala-xml"/>
+
<!-- BND support -->
<typedef resource="aQute/bnd/ant/taskdef.properties" classpathref="extra.tasks.classpath" />
@@ -635,7 +663,7 @@ TODO:
<path id="quick.scaladoc.build.path">
<path refid="quick.compiler.build.path"/>
<path refid="partest.classpath"/>
- <path refid="scaladoc.deps.classpath"/>
+ <path refid="external-modules-nocore"/>
<pathelement location="${build-quick.dir}/classes/scaladoc"/>
</path>
@@ -650,6 +678,7 @@ TODO:
<path refid="quick.actors.build.path"/>
<pathelement location="${build-quick.dir}/classes/scalap"/>
<pathelement location="${build-quick.dir}/classes/continuations-library"/>
+ <path refid="external-modules-nocore"/>
</path>
<!-- PACK -->
@@ -663,8 +692,9 @@ TODO:
</path>
<path id="pack.bin.tool.path">
- <!-- NOTE: this no longer provides xml or the parser combinators by default -->
<pathelement location="${build-pack.dir}/lib/scala-library.jar"/>
+ <pathelement location="${build-pack.dir}/lib/scala-xml.jar"/>
+ <pathelement location="${build-pack.dir}/lib/scala-parser-combinators.jar"/>
<pathelement location="${build-pack.dir}/lib/scala-actors.jar"/>
<pathelement location="${build-pack.dir}/lib/scala-reflect.jar"/>
<pathelement location="${build-pack.dir}/lib/scala-compiler.jar"/>
@@ -720,16 +750,8 @@ TODO:
<!-- MISC -->
<path id="docs.compiler.path">
+ <path refid="external-modules-nocore"/>
<pathelement location="${build-pack.dir}/lib/scala-library.jar"/>
- <restrict>
- <!-- need xml and parser combinators, but not the other jars,
- we're using our own -->
- <path refid="scaladoc.deps.classpath"/>
- <rsel:or>
- <rsel:name name="scala-parser-combinators*.jar"/>
- <rsel:name name="scala-xml*.jar"/>
- </rsel:or>
- </restrict>
<pathelement location="${build-pack.dir}/lib/scala-reflect.jar"/>
<pathelement location="${build-pack.dir}/lib/scala-compiler.jar"/>
<pathelement location="${build-pack.dir}/lib/scalap.jar"/>
@@ -760,34 +782,19 @@ TODO:
<pathelement location="${build-pack.dir}/lib/scala-library.jar"/>
<pathelement location="${build-pack.dir}/lib/scala-reflect.jar"/>
<pathelement location="${build-pack.dir}/lib/scala-compiler.jar"/>
- <pathelement location="${build-pack.dir}/lib/scala-actors.jar"/>
<!-- to test a quick build without packing, replace the above pathelements with: (may need a little tweaking)
<path refid="quick.bin.tool.path">
<path refid="quick.interactive.build.path">
-->
+ <!-- TODO: move scalap & actors out of repo -->
<pathelement location="${build-pack.dir}/lib/scalap.jar"/>
- <!-- TODO: move scalap out of repo -->
+ <pathelement location="${build-pack.dir}/lib/scala-actors.jar"/>
- <!--
- include partest and its run-time dependencies,
- but filter out the compiler we just built, as that's what we want to test!
- TODO: mark partest's compiler dependencies as provided when publishing to maven,
- so that we don't have to filter them out here...
- -->
- <restrict>
- <path refid="partest.classpath"/>
- <rsel:not><rsel:or>
- <rsel:name name="scala-library*.jar"/>
- <rsel:name name="scala-reflect*.jar"/>
- <rsel:name name="scala-compiler*.jar"/>
- <rsel:name name="scala-actors*.jar"/>
- <rsel:name name="scala-scalap*.jar"/>
- <!-- <rsel:name name="scala-parser-combinators*.jar"/>
- <rsel:name name="scala-xml*.jar"/> -->
- </rsel:or></rsel:not>
- </restrict>
+ <!-- partest dependencies, without the jars we built locally
+ TODO: figure out why scalap tests fail if we move this up-->
+ <path refid="partest-deps-nocore"/>
<!-- partest classes specific to the core compiler build -->
<pathelement location="${build-pack.dir}/lib/scala-partest-extras.jar"/>
@@ -1319,7 +1326,7 @@ TODO:
<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 todir="${build-pack.dir}/lib">
- <resources refid="repl.deps.fileset"/>
+ <resources refid="repl.fileset"/>
<mapper classpathref="maven-ant-tasks.classpath" classname="org.apache.maven.artifact.ant.VersionMapper" from="${repl.deps.versions}" to="flatten"/>
</copy>
<copy todir="${build-pack.dir}/lib">
@@ -1345,6 +1352,11 @@ TODO:
<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.actors, pack.plugins, pack.reflect, pack.scalap, pack.swing">
+ <copy todir="${build-pack.dir}/lib">
+ <path refid="external-modules-nocore" />
+ <mapper type="flatten" />
+ </copy>
+
<staged-bin stage="pack"/>
</target>
@@ -1383,7 +1395,7 @@ TODO:
<fileset dir="${asm-classes}"/>
</jar>
<copy todir="${build-palo.dir}/lib">
- <resources refid="repl.deps.fileset"/>
+ <resources refid="repl.fileset"/>
<mapper classpathref="maven-ant-tasks.classpath" classname="org.apache.maven.artifact.ant.VersionMapper" from="${repl.deps.versions}" to="flatten"/>
</copy>
</target>
@@ -1445,12 +1457,10 @@ TODO:
<stopwatch name="osgi.bundle.timer"/>
<make-bundle name="scala-library" version="${osgi.version.number}" />
<make-bundle name="scala-actors" version="${osgi.version.number}" />
- <propertyCrossedJar name="scala-parser-combinators" jar="org.scala-lang.modules:scala-parser-combinators"/>
<make-bundle name="scala-parser-combinators" version="${osgi.version.number}" jar="${scala-parser-combinators}"/>
<make-bundle name="scala-reflect" version="${osgi.version.number}" />
<make-bundle name="scala-compiler" version="${osgi.version.number}" />
<make-plugin-bundle name="continuations" version="${osgi.version.number}" />
- <propertyCrossedJar name="scala-xml" jar="org.scala-lang.modules:scala-xml"/>
<make-bundle name="scala-xml" version="${osgi.version.number}" jar="${scala-xml}"/>
<touch file="${build-osgi.dir}/bundles.complete" verbose="no"/>
@@ -1876,8 +1886,9 @@ TODO:
</fileset>
</copy>
+ <!-- TODO -->
<copy todir="${dist.dir}/lib">
- <resources refid="repl.deps.fileset"/>
+ <resources refid="repl.fileset"/>
<mapper classpathref="maven-ant-tasks.classpath" classname="org.apache.maven.artifact.ant.VersionMapper"
from="${repl.deps.versions}" to="flatten"/>
</copy>
@@ -1885,6 +1896,8 @@ TODO:
<mkdir dir="${dist.dir}/bin"/>
<!-- TODO - Stop being inefficient and don't copy OSGi bundles overtop other jars. -->
<copy-bundle name="scala-library"/>
+ <copy-bundle name="scala-xml"/>
+ <copy-bundle name="scala-parser-combinators"/>
<copy-bundle name="scala-reflect"/>
<copy-bundle name="scala-swing"/>
<copy-bundle name="scala-actors"/>
@@ -1903,6 +1916,11 @@ TODO:
<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">
+ <file file="${scala-xml-javadoc}"/>
+ <file file="${scala-parser-combinators-javadoc}"/>
+ </copy>
+
<copy file="${docs.dir}/LICENSE" toDir="${dist.dir}/doc"/>
<copy file="${docs.dir}/README" toDir="${dist.dir}/doc"/>
<mkdir dir="${dist.dir}/doc/scala-devel-docs/api"/>
@@ -1932,6 +1950,11 @@ TODO:
<target name="dist.src" depends="dist.base">
<mkdir dir="${dist.dir}/src"/>
+ <copy toDir="${dist.dir}/src">
+ <file file="${scala-xml-sources}"/>
+ <file file="${scala-parser-combinators-sources}"/>
+ </copy>
+
<jar whenmanifestonly="fail" destfile="${dist.dir}/src/scala-library-src.jar">
<fileset dir="${src.dir}/library"/>
<fileset dir="${src.dir}/continuations/library"/>