diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-12-15 17:36:05 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-12-19 10:45:09 -0800 |
commit | 0dde1ae27f0ecb916db4b2abf05ec4b0dd681678 (patch) | |
tree | bafa982cd094b6ebaff2a2d05300aa34417ce0b2 /src | |
parent | 94ca91dd5f404015bdfa94e373ed94c284761a1d (diff) | |
download | scala-0dde1ae27f0ecb916db4b2abf05ec4b0dd681678.tar.gz scala-0dde1ae27f0ecb916db4b2abf05ec4b0dd681678.tar.bz2 scala-0dde1ae27f0ecb916db4b2abf05ec4b0dd681678.zip |
scala-dist: all you need to roll your own scala distribution
We now publish a scala-dist artifact every time we publish to maven.
It captures everything needed to build a Scala distribution.
The packager should resolve all transitive dependencies of scala-dist,
put the class-file jars in the lib/ directory,
the scaladoc jars in the api/ directory,
and the source jars in the src/ directory,
in addition to unpacking the scala-dist jar itself,
which contains the bin/, doc/ and man/ directories,
which previously weren't available on maven.
This also removes the `@{dir}` abstraction, which was used to
package the continuations plugin. Since it's moved out,
we can go back to hard-coding it.
Diffstat (limited to 'src')
-rw-r--r-- | src/build/maven/maven-deploy.xml | 56 | ||||
-rw-r--r-- | src/build/maven/scala-dist-pom.xml | 84 |
2 files changed, 130 insertions, 10 deletions
diff --git a/src/build/maven/maven-deploy.xml b/src/build/maven/maven-deploy.xml index 174993f94a..d2877f95c5 100644 --- a/src/build/maven/maven-deploy.xml +++ b/src/build/maven/maven-deploy.xml @@ -10,6 +10,7 @@ see publish.* targets in /build.xml SuperSabbus extension for deploying a distribution to Maven. THIS FILE IS MEANT TO BE RUN STANDALONE IN THE MAVEN "distpack" DIRECTORY </description> + <macrodef name="deploy-remote"> <attribute name="jar" default=""/> <attribute name="pom"/> @@ -61,6 +62,9 @@ see publish.* targets in /build.xml <filter token="SCALA_BINARY_VERSION" value="${scala.binary.version}" /> <filter token="XML_VERSION" value="${scala-xml.version.number}" /> <filter token="PARSER_COMBINATORS_VERSION" value="${scala-parser-combinators.version.number}" /> + <filter token="CONTINUATIONS_PLUGIN_VERSION" value="${scala-continuations-plugin.version.number}" /> + <filter token="CONTINUATIONS_LIBRARY_VERSION" value="${scala-continuations-library.version.number}" /> + <filter token="SCALA_SWING_VERSION" value="${scala-swing.version.number}" /> <filter token="RELEASE_REPOSITORY" value="${remote.release.repository}" /> <filter token="SNAPSHOT_REPOSITORY" value="${remote.snapshot.repository}" /> <filter token="JLINE_VERSION" value="${jline.version}" /> @@ -76,13 +80,12 @@ see publish.* targets in /build.xml </macrodef> <macrodef name="deploy-one"> - <attribute name="dir" default=""/> <attribute name="name" /> <attribute name="local" default="false"/> <attribute name="signed" default="false"/> <sequential> - <local name="path"/> <property name="path" value="@{dir}@{name}/@{name}"/> + <local name="path"/> <property name="path" value="${dist.maven}/@{name}/@{name}"/> <echo>Deploying ${path}-[pom.xml|src.jar|docs.jar].</echo> @@ -121,23 +124,56 @@ see publish.* targets in /build.xml </sequential> </macrodef> + <macrodef name="deploy-jar"> + <attribute name="name" /> + <attribute name="local" default="false"/> + <attribute name="signed" default="false"/> + + <sequential> + <local name="path"/> <property name="path" value="${dist.maven}/@{name}/@{name}"/> + + <echo>Deploying ${path}.jar with ${path}-pom.xml.</echo> + + <filter-pom name="@{name}" path="@{path}"/> + + <if><equals arg1="@{signed}" arg2="false"/><then> + <deploy-to local="@{local}" jar="${path}.jar" pom="@{name}.pom"/> + </then><else> + <local name="repo"/> + <if><equals arg1="@{local}" arg2="false"/><then> + <property name="repo" value="${remote.repository}"/> + </then><else> + <property name="repo" value="${local.repository}"/> + </else></if> + <artifact:mvn failonerror="true"> + <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" /> + <arg value="-Durl=${repo}" /> + <arg value="-DrepositoryId=${repository.credentials.id}" /> + <arg value="-DpomFile=${path}-pom-filtered.xml" /> + <arg value= "-Dfile=${path}.jar" /> + <arg value="-Pgpg" /> + <arg value="-Dgpg.useagent=true" /> + </artifact:mvn> + </else></if> + </sequential> + </macrodef> + <macrodef name="deploy"> - <attribute name="dir" default=""/> <attribute name="local" default="false"/> <attribute name="signed" default="false"/> <sequential> - <deploy-one dir="@{dir}" name="scala-library" local="@{local}" signed="@{signed}"/> - <deploy-one dir="@{dir}" name="scala-reflect" local="@{local}" signed="@{signed}"/> - <deploy-one dir="@{dir}" name="scala-compiler" local="@{local}" signed="@{signed}"/> + <deploy-one name="scala-library" local="@{local}" signed="@{signed}"/> + <deploy-one name="scala-reflect" local="@{local}" signed="@{signed}"/> + <deploy-one name="scala-compiler" local="@{local}" signed="@{signed}"/> <!-- TODO modularize compiler. - <deploy-one dir="@{dir}" name="scala-compiler-doc" local="@{local}" signed="@{signed}"/> - <deploy-one dir="@{dir}" name="scala-compiler-interactive" local="@{local}" signed="@{signed}"/> + <deploy-one name="scala-compiler-doc" local="@{local}" signed="@{signed}"/> + <deploy-one name="scala-compiler-interactive" local="@{local}" signed="@{signed}"/> --> - <deploy-one dir="@{dir}" name="scala-actors" local="@{local}" signed="@{signed}"/> - <deploy-one dir="@{dir}" name="scalap" local="@{local}" signed="@{signed}"/> + <deploy-one name="scala-actors" local="@{local}" signed="@{signed}"/> + <deploy-one name="scalap" local="@{local}" signed="@{signed}"/> </sequential> </macrodef> diff --git a/src/build/maven/scala-dist-pom.xml b/src/build/maven/scala-dist-pom.xml new file mode 100644 index 0000000000..946bec62b5 --- /dev/null +++ b/src/build/maven/scala-dist-pom.xml @@ -0,0 +1,84 @@ +<?xml version="1.0"?> +<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.scala-lang</groupId> + <artifactId>scala-dist</artifactId> + <packaging>jar</packaging> + <version>@VERSION@</version> + <name>Scala Distribution Artifacts</name> + <description>The Artifacts Distributed with Scala</description> + <url>http://www.scala-lang.org/</url> + <inceptionYear>2002</inceptionYear> + <organization> + <name>LAMP/EPFL</name> + <url>http://lamp.epfl.ch/</url> + </organization> + <licenses> + <license> + <name>BSD 3-Clause</name> + <url>http://www.scala-lang.org/license.html</url> + <distribution>repo</distribution> + </license> + </licenses> + <scm> + <connection>scm:git:git://github.com/scala/scala.git</connection> + <url>https://github.com/scala/scala.git</url> + </scm> + <issueManagement> + <system>JIRA</system> + <url>https://issues.scala-lang.org/</url> + </issueManagement> + <dependencies> + <dependency> + <groupId>org.scala-lang</groupId> + <artifactId>scala-compiler</artifactId> + <version>@VERSION@</version> + </dependency> + <dependency> + <groupId>org.scala-lang.modules</groupId> + <artifactId>scala-xml_@SCALA_BINARY_VERSION@</artifactId> + <version>@XML_VERSION@</version> + </dependency> + <dependency> + <groupId>org.scala-lang.modules</groupId> + <artifactId>scala-parser-combinators_@SCALA_BINARY_VERSION@</artifactId> + <version>@PARSER_COMBINATORS_VERSION@</version> + </dependency> + <dependency> + <groupId>org.scala-lang.modules</groupId> + <artifactId>scala-continuations-plugin_@SCALA_BINARY_VERSION@</artifactId> + <version>@CONTINUATIONS_PLUGIN_VERSION@</version> + </dependency> + <dependency> + <groupId>org.scala-lang.modules</groupId> + <artifactId>scala-continuations-library_@SCALA_BINARY_VERSION@</artifactId> + <version>@CONTINUATIONS_LIBRARY_VERSION@</version> + </dependency> + <dependency> + <groupId>org.scala-lang.modules</groupId> + <artifactId>scala-swing_@SCALA_BINARY_VERSION@</artifactId> + <version>@SCALA_SWING_VERSION@</version> + </dependency> + </dependencies> + <distributionManagement> + <repository> + <id>scala-tools.org</id> + <url>@RELEASE_REPOSITORY@</url> + </repository> + <snapshotRepository> + <id>scala-tools.org</id> + <url>@SNAPSHOT_REPOSITORY@</url> + <uniqueVersion>false</uniqueVersion> + </snapshotRepository> + </distributionManagement> + <developers> + <developer> + <id>lamp</id> + <name>EPFL LAMP</name> + </developer> + <developer> + <id>Typesafe</id> + <name>Typesafe, Inc.</name> + </developer> + </developers> +</project> |