diff options
author | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2014-03-04 11:00:13 +0100 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2014-03-04 11:00:13 +0100 |
commit | 2dddb03b267770afcd0249ad700e55d53019e637 (patch) | |
tree | 79fecc826a9221c709258ae1baade8d279405fdb | |
parent | 13419e580337132002eb9d8336c36f4bf072fe76 (diff) | |
parent | 11682a9ff29b3d3dc5faecbb75d801f155f213b3 (diff) | |
download | scala-2dddb03b267770afcd0249ad700e55d53019e637.tar.gz scala-2dddb03b267770afcd0249ad700e55d53019e637.tar.bz2 scala-2dddb03b267770afcd0249ad700e55d53019e637.zip |
Merge pull request #3600 from adriaanm/build-cleanup
Enable binary comp testing. Final build cleanup.
-rw-r--r-- | bincompat-backward.whitelist.conf | 7 | ||||
-rw-r--r-- | bincompat-forward.whitelist.conf | 7 | ||||
-rw-r--r-- | build-ant-macros.xml | 223 | ||||
-rwxr-xr-x | build.xml | 284 | ||||
-rw-r--r-- | src/build/maven/maven-deploy.xml | 281 |
5 files changed, 301 insertions, 501 deletions
diff --git a/bincompat-backward.whitelist.conf b/bincompat-backward.whitelist.conf new file mode 100644 index 0000000000..9e93c32c70 --- /dev/null +++ b/bincompat-backward.whitelist.conf @@ -0,0 +1,7 @@ +filter { + packages = [ + "scala.reflect.internal" + # "scala.concurrent.impl" + # "scala.reflect.runtime" + ] +}
\ No newline at end of file diff --git a/bincompat-forward.whitelist.conf b/bincompat-forward.whitelist.conf new file mode 100644 index 0000000000..9e93c32c70 --- /dev/null +++ b/bincompat-forward.whitelist.conf @@ -0,0 +1,7 @@ +filter { + packages = [ + "scala.reflect.internal" + # "scala.concurrent.impl" + # "scala.reflect.runtime" + ] +}
\ No newline at end of file diff --git a/build-ant-macros.xml b/build-ant-macros.xml index 458d1014c2..b90102538b 100644 --- a/build-ant-macros.xml +++ b/build-ant-macros.xml @@ -489,8 +489,223 @@ </sequential> </macrodef> - <!-- TODO inline maven-deploy.xml's macrodefs, remove maven-deploy.xml --> - <include file="src/build/maven/maven-deploy.xml" as="deploy-macros"/> + <macrodef name="deploy-remote"> + <attribute name="jar" default=""/> + <attribute name="pom"/> + <element name="artifacts" implicit="true" optional="true"/> + <sequential> + <if><equals arg1="@{jar}" arg2="true"/><then> + <artifact:deploy settingsFile="${settings.file}"> + <artifact:remoteRepository url="${remote.repository}" id="${repository.credentials.id}" /> + <artifact:pom refid="@{pom}" /> + <artifacts/> + </artifact:deploy> + </then><else> + <artifact:deploy file="@{jar}" settingsFile="${settings.file}"> + <artifact:remoteRepository url="${remote.repository}" id="${repository.credentials.id}" /> + <artifact:pom refid="@{pom}" /> + <artifacts/> + </artifact:deploy> + </else></if> + </sequential> + </macrodef> + + <macrodef name="deploy-local"> + <attribute name="jar" default=""/> + <attribute name="pom"/> + <element name="artifacts" implicit="true" optional="true"/> + <sequential> + <if><equals arg1="@{jar}" arg2="true"/><then> + <artifact:install> + <artifact:localRepository path="${local.repository}" id="${repository.credentials.id}" /> + <artifact:pom refid="@{pom}" /> + <artifacts/> + </artifact:install> + </then><else> + <artifact:install file="@{jar}"> + <artifact:localRepository path="${local.repository}" id="${repository.credentials.id}" /> + <artifact:pom refid="@{pom}" /> + <artifacts/> + </artifact:install> + </else></if> + </sequential> + </macrodef> + + <macrodef name="deploy-to"> + <attribute name="jar" default=""/> + <attribute name="pom"/> + <attribute name="local"/> + <element name="artifacts" implicit="true" optional="true"/> + <sequential> + <if><equals arg1="@{local}" arg2="true"/><then> + <deploy-local jar="@{jar}" pom="@{pom}"> <artifacts/> </deploy-local> + </then><else> + <deploy-remote jar="@{jar}" pom="@{pom}"> <artifacts/> </deploy-remote> + </else></if> + </sequential> + </macrodef> + + <macrodef name="filter-pom"> + <attribute name="path" /> + <attribute name="name" /> + + <sequential> + <copy file="${path}-pom.xml" tofile="${path}-pom-filtered.xml" overwrite="true"> + <filterset> + <filter token="VERSION" value="${maven.version.number}" /> + <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}" /> + <filter token="AKKA_ACTOR_VERSION" value="${akka-actor.version.number}" /> + <filter token="ACTORS_MIGRATION_VERSION" value="${actors-migration.version.number}" /> + + <!-- TODO modularize compiler. + <filter token="SCALA_COMPILER_DOC_VERSION" value="${scala-compiler-doc.version.number}" /> + <filter token="SCALA_COMPILER_INTERACTIVE_VERSION" value="${scala-compiler-interactive.version.number}" /> + --> + </filterset> + </copy> + <artifact:pom id="@{name}.pom" file="${path}-pom-filtered.xml" /> + </sequential> + </macrodef> + + <macrodef name="deploy-one"> + <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}-[pom.xml|src.jar|docs.jar].</echo> + + <filter-pom name="@{name}" path="@{path}"/> + + <if><equals arg1="@{signed}" arg2="false"/><then> + <if><isset property="docs.skip"/><then> + <deploy-to local="@{local}" jar="${path}.jar" pom="@{name}.pom"> + <artifact:attach type="jar" file="${path}-src.jar" classifier="sources" /> + </deploy-to> + </then><else> + <deploy-to local="@{local}" jar="${path}.jar" pom="@{name}.pom"> + <artifact:attach type="jar" file="${path}-src.jar" classifier="sources" /> + <artifact:attach type="jar" file="${path}-docs.jar" classifier="javadoc" /> + </deploy-to> + </else></if> + </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="-Dsources=${path}-src.jar" /> + <arg value="-Djavadoc=${path}-docs.jar" /> + <arg value="-Pgpg" /> + <arg value="-Dgpg.useagent=true" /> + </artifact:mvn> + </else></if> + </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-pom"> + <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}-pom.xml.</echo> + + <filter-pom name="@{name}" path="@{path}"/> + + <if><equals arg1="@{signed}" arg2="false"/><then> + <deploy-to local="@{local}" 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}-pom-filtered.xml" /> + <arg value="-Pgpg" /> + <arg value="-Dgpg.useagent=true" /> + </artifact:mvn> + </else></if> + </sequential> + </macrodef> + + <macrodef name="deploy"> + <attribute name="local" default="false"/> + <attribute name="signed" default="false"/> + + <sequential> + <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 name="scala-compiler-doc" local="@{local}" signed="@{signed}"/> + <deploy-one name="scala-compiler-interactive" local="@{local}" signed="@{signed}"/> + --> + + <deploy-one name="scala-actors" local="@{local}" signed="@{signed}"/> + <deploy-one name="scalap" local="@{local}" signed="@{signed}"/> + </sequential> + </macrodef> <macrodef name="testSuite"> <attribute name="dir" default="${partest.dir}"/> @@ -534,8 +749,8 @@ <macrodef name="bc.check"> <attribute name="project"/> <sequential> - <bc.run-mima jar-name="scala-@{project}" prev="${org.scala-lang:scala-@{project}:jar}" curr="${@{name}.jar}" direction="backward"/> - <bc.run-mima jar-name="scala-@{project}" prev="${@{name}.jar}" curr="${org.scala-lang:scala-@{project}:jar}" direction="forward"/> + <bc.run-mima jar-name="scala-@{project}" prev="${org.scala-lang:scala-@{project}:jar}" curr="${@{project}.jar}" direction="backward"/> + <bc.run-mima jar-name="scala-@{project}" prev="${@{project}.jar}" curr="${org.scala-lang:scala-@{project}:jar}" direction="forward"/> </sequential> </macrodef> @@ -31,7 +31,17 @@ supported/exercised targets DO NOT RELY ON ANY OTHER TARGETS (ok, you're probably ok assuming the ones defined in the first 100 lines of this file) -NOTE: dists/maven/latest/build.xml will soon disappear; call `publish` in this build instead +To build your own Scala distribution, do, e.g.: + + ant publish-local-opt -Dmaven.version.suffix="-foo" + cd ~/git + hub clone scala/scala-dist + cd scala-dist + sbt 'set version := "2.11.0-foo"' 'set resolvers += Resolver.mavenLocal' universal:package-bin + +NOTE: `ant build` builds the essence of a Scala distribution under build/pack + (The only thing missing are the docs; see `pack.doc` and `docs.done`.) + --> <!-- To use Zinc with the ant build: @@ -55,23 +65,15 @@ TODO: <target name="test" depends="test.done" description="Runs test suite and bootstrapping test on Scala compiler and library."/> <target name="docs" depends="docs.done" description="Builds documentation for the Scala library. Scaladoc is in 'build/scaladoc/library'."/> <target name="docscomp" depends="docs.comp" description="Builds documentation for the Scala compiler and library. Scaladoc is in 'build/scaladoc'."/> - <target name="dist" depends="all.clean, all.done" description="Cleans all and builds and tests a new distribution."/> - <target name="partialdist" depends="dist.partial" description="Makes a new distribution without documentation, so just for testing."/> - <target name="fastdist" depends="dist.done" description="Makes a new distribution without testing it or removing partially build elements."/> <target name="build-opt" description="Optimized version of build."> <optimized name="build"/></target> <target name="test-opt" description="Optimized version of test."> <optimized name="test"/></target> <target name="test-core-opt" description="Optimized version of test.core."> <optimized name="test.core"/></target> <target name="test-stab-opt" description="Optimized version of test.stability."> <optimized name="test.stability"/></target> - <target name="dist-opt" description="Optimized version of dist."> <optimized name="dist"/></target> - <target name="partialdist-opt" description="Optimized version of partialdist."> <optimized name="partialdist"/></target> - <target name="fastdist-opt" description="Optimized version of fastdist."> <optimized name="fastdist"/></target> - <!-- packaging --> - <target name="distpack" depends="pack-archives.done, pack-maven.done"/> - <target name="distpack-maven" depends="pack-maven.done"/> - <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="test.done, pack-maven.done"/> + <target name="nightly"><optimized name="all.done"/></target> + <target name="nightly.checkall"> <antcall target="all.done"> <param name="partest.scalac_opts" value="-Ycheck:all"/></antcall></target> <!-- The IDE build requires actors/swing/continuations, so need to publish them during PR validation until they are modules --> <target name="publish-opt-nodocs" description="Publishes Scala (optimized) without generating docs/testing (library/reflect/compiler/actors/swing/continuations)."> @@ -91,20 +93,41 @@ TODO: <param name="docs.skip" value="1"/> </antcall> </target> - <target name="all.done" depends="test.done, distpack"/> - <target name="nightly-nopt" depends="all.done"/> - <target name="nightly"><optimized name="nightly-nopt"/></target> - <target name="nightly.checkall"> - <antcall target="nightly-nopt"> <param name="partest.scalac_opts" value="-Ycheck:all"/></antcall></target> <!-- prefer the sbt names, but the dotted names are used in jenkins; rename there first before dropping the dotted ones --> <target name="publish-local" depends="publish.local"/> + <target name="publish-local-opt"><optimized name="publish-local"/></target> <target name="publish-signed" depends="publish.signed"/> + + + + + + + + +<!-- DEPRECATED --> + <target name="dist" depends="all.clean, all.done" description="Cleans all and builds and tests a new distribution."/> + <target name="partialdist" depends="pack.done" description="Makes a new distribution without testing it or removing partially build elements."/> + <target name="fastdist" depends="pack.done, pack.doc" description="Makes a new distribution without testing it or removing partially build elements."/> + <target name="dist-opt" description="Optimized version of dist."> <optimized name="dist"/></target> + <target name="partialdist-opt" description="Optimized version of partialdist."> <optimized name="partialdist"/></target> + <target name="fastdist-opt" description="Optimized version of fastdist."> <optimized name="fastdist"/></target> + + <!-- packaging --> + <target name="distpack" depends="pack-maven.done"/> + <target name="distpack-maven" depends="pack-maven.done"/> + <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="distclean" depends="dist.clean" description="Removes all distributions. Binaries and documentation are untouched."/> + + <target name="nightly-nopt" depends="all.done"/> + <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."/> + <!-- =========================================================================== @@ -413,10 +436,6 @@ TODO: <!-- some default in case something went wrong getting the revision --> <property name="version.number" value="-unknown-"/> - <property name="dist.name" value="scala-${version.number}"/> - <property name="dist.dir" value="${dists.dir}/${dist.name}"/> - <property name="dist.maven" value="${dists.dir}/maven/${version.number}"/> - <condition property="has.java6"> <equals arg1="${ant.java.version}" arg2="1.6"/> </condition> @@ -1188,7 +1207,6 @@ TODO: <target name="strap-opt" description="Optimized version of strap.done."> <optimized name="strap.done"/></target> - <!-- =========================================================================== OSGi Artifacts ============================================================================ --> @@ -1483,14 +1501,14 @@ TODO: 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-reference-version" value="2.11.0-RC1"/> <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.5"/> + <dependency groupId="com.typesafe" artifactId="mima-reporter_2.10" version="0.1.6"/> </artifact:dependencies> <artifact:dependencies pathId="old.bc.classpath"> <dependency groupId="org.scala-lang" artifactId="scala-library" version="${bc-reference-version}"/> @@ -1499,13 +1517,8 @@ TODO: <property name="maven-deps-done-mima" value="true"/> </target> - - <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"> + <target name="test.bc" depends="bc.init, pack.lib, pack.reflect"> <bc.check project="library"/> <bc.check project="reflect"/> </target> @@ -1590,31 +1603,15 @@ TODO: <!-- TODO modularize compiler: docs.scaladoc, docs.interactive, --> <target name="docs.done" depends="docs.core, docs.actors, docs.scalap" unless="docs.skip"/> -<!-- =========================================================================== - DISTRIBUTION -============================================================================ --> - <!-- bin/ --> - <target name="dist.bin" depends="pack.bin"> - <mkdir dir="${dist.dir}/bin"/> - <copy toDir="${dist.dir}/bin" overwrite="true"> - <fileset dir="${build-pack.dir}/bin"/> - </copy> - <chmod perm="ugo+rx" file="${dist.dir}/bin/scala"/> - <chmod perm="ugo+rx" file="${dist.dir}/bin/scalac"/> - <chmod perm="ugo+rx" file="${dist.dir}/bin/scaladoc"/> - <chmod perm="ugo+rx" file="${dist.dir}/bin/fsc"/> - <chmod perm="ugo+rx" file="${dist.dir}/bin/scalap"/> - </target> - <!-- doc/ and man/ --> - <target name="dist.doc" depends="scaladoc.task" unless="docs.skip"> <!-- depends on scaladoc.task for scalac taskdef --> - <mkdir dir="${dist.dir}/doc"/> - <copy toDir="${dist.dir}/doc" overwrite="true"> + <target name="pack.doc" depends="scaladoc.task" unless="docs.skip"> <!-- depends on scaladoc.task for scalac taskdef --> + <mkdir dir="${build-pack.dir}/doc"/> + <copy toDir="${build-pack.dir}/doc" overwrite="true"> <fileset dir="${doc.dir}"/> </copy> - <mkdir dir="${dist.dir}/doc/tools"/> - <mkdir dir="${dist.dir}/man/man1"/> + <mkdir dir="${build-pack.dir}/doc/tools"/> + <mkdir dir="${build-pack.dir}/man/man1"/> <staged-uptodate stage="manual" project="manual"> <check><srcfiles dir="${src.dir}/manual"/></check> <do> @@ -1630,7 +1627,7 @@ TODO: classname="scala.tools.docutil.ManMaker" classpathref="manual.build.path"/> <genman command="fsc, scala, scalac, scaladoc, scalap" - htmlout="${dist.dir}/doc/tools" + htmlout="${build-pack.dir}/doc/tools" manout="${build-manual.dir}/genman"/> </do> </staged-uptodate> @@ -1638,9 +1635,9 @@ TODO: <!-- On Windows source and target files can't be the same ! --> <fixcrlf srcdir="${build-manual.dir}/genman" - destdir="${dist.dir}/man" + destdir="${build-pack.dir}/man" eol="unix" includes="**/*.1"/> - <copy todir="${dist.dir}/doc/tools" overwrite="true"> + <copy todir="${build-pack.dir}/doc/tools" overwrite="true"> <fileset dir="${src.dir}/manual/scala/tools/docutil/resources"> <include name="**/*.html"/> <include name="**/*.css"/> @@ -1650,130 +1647,13 @@ TODO: </copy> </target> - <!-- lib/ and src/ (jars: classes and sources) --> - <target name="dist.lib" depends="osgi.done"> - <mkdir dir="${dist.dir}/lib"/> - <mkdir dir="${dist.dir}/src"/> - - <copy todir="${dist.dir}/lib" overwrite="true"> - <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 classfile jars and source jars from osgi build to dist --> - <copy-bundle project="library"/> - <copy-bundle project="reflect"/> - <copy-bundle project="compiler"/> - - <copy-bundle project="actors"/> - - <copy-bundle project="continuations-plugin"/> - <copy-bundle project="continuations-library"/> - <copy-bundle project="parser-combinators"/> - <copy-bundle project="xml"/> - <copy-bundle project="swing"/> - - <!-- scalap --> - <copy toDir="${dist.dir}/lib" overwrite="true"> - <fileset dir="${build-pack.dir}/lib"> - <include name="scalap.jar"/> - </fileset> - </copy> - <jar whenmanifestonly="fail" destfile="${dist.dir}/src/scalap-src.jar" basedir="${src.dir}/scalap"/> - </target> - - <!-- api/ (scaladoc) --> - <target name="dist.api" depends="docs.done" unless="docs.skip"> - <mkdir dir="${dist.dir}/api"/> - <copy toDir="${dist.dir}/api" overwrite="true"> - <fileset dir="${build-docs.dir}/library"/> - </copy> - - <copy toDir="${dist.dir}/api" overwrite="true" flatten="true"> - <file file="${scala-xml-javadoc}"/> - <file file="${scala-parser-combinators-javadoc}"/> - <file file="${scala-continuations-plugin-javadoc}"/> - <file file="${scala-continuations-library-javadoc}"/> - <file file="${scala-swing-javadoc}"/> - </copy> - </target> - - <target name="dist.partial" depends="dist.lib, dist.bin, dist.doc"> - <if><not><os family="windows"/></not><then> - <symlink link="${dists.dir}/latest" resource="${dist.name}" overwrite="true"/> - </then><else> <!-- XXX THIS PROBABLY DOES NOT WORK: copying must happen last during dist.done! is this guaranteed? --> - <copydir dest="${dists.dir}/latest" src="${dist.dir}"/> - </else></if> - </target> - - <target name="dist.done" depends="dist.partial, dist.api"/> - <!-- =========================================================================== MAIN DISTRIBUTION PACKAGING ============================================================================ --> - - <!-- TODO: get rid of this, it's redundant between maven and github --> - <target name="pack-archives.done" depends="dist.done, docs.done"> - <mkdir dir="${dists.dir}/archives"/> - <property name="archive-base" value="${dists.dir}/archives/${dist.name}"/> - - <tarz name="${archive-base}"> - <tarfileset dir="${dist.dir}" prefix="${dist.name}" includes="bin/**" mode="755"/> - <tarfileset dir="${dist.dir}" prefix="${dist.name}" excludes="bin/**"/> - </tarz> - - <zip destfile="${archive-base}.zip"> - <zipfileset prefix="${dist.name}" dir="${dist.dir}"/> - </zip> - - <if><not><isset property="docs.skip"/></not><then> - <tarz name="${archive-base}-devel-docs"> - <tarfileset dir="${dist.dir}/api" prefix="${dist.name}-devel-docs"/> - </tarz> - </then></if> - - <tarz name="${archive-base}-sources"> - <tarfileset dir="${basedir}" prefix="${dist.name}-sources"> - <exclude name="bin/**"/> - <exclude name="build/**"/> - <exclude name="debian/**"/> - <exclude name="dists/**"/> - <exclude name="logs/**"/> - <exclude name="sandbox/**"/> - <exclude name="test/partest"/> - <exclude name=".git"/> - </tarfileset> - <tarfileset dir="${basedir}" prefix="${dist.name}-sources" filemode="755"> - <include name="test/partest"/> - </tarfileset> - </tarz> - - <!-- checksum everything --> - <checksum fileext=".md5"> - <fileset dir="${dists.dir}/archives"> - <include name="${dist.name}*"/> - </fileset> - </checksum> - - <!-- UNUSED: create 'scala-latest-sources.tgz' alias (or copy, on windows) - we use github's source download feature - <if><isset property="os.win"/><then> - <copy tofile="${dists.dir}/archives/scala-latest-sources.tgz" overwrite="true"> - <fileset dir="${dists.dir}/archives"> - <include name="scala-${version.number}-sources.tgz"/> - </fileset> - </copy> - </then><else> - (be sure to use a relative symlink to make the distribution portable, - `resource` is relative to directory of `link`) - <symlink link="${dists.dir}/archives/scala-latest-sources.tgz" - resource="scala-${version.number}-sources.tgz" - overwrite="true"/> - </else></if> --> - </target> - <target name="pack-maven.core" depends="osgi.core, docs.core"> + <property name="dist.maven" value="${dists.dir}/maven/${version.number}"/> + <mkdir dir="${dist.maven}"/> + <mvn-package project="library"/> <mvn-package project="reflect"/> <mvn-package project="compiler"/> @@ -1790,16 +1670,7 @@ MAIN DISTRIBUTION PACKAGING </then></if> </target> - <target name="pack-maven.dist" depends="dist.bin, dist.doc"> - <copy tofile="${dist.maven}/scala-dist/scala-dist-pom.xml" file="${src.dir}/build/maven/scala-dist-pom.xml" overwrite="true"/> - <jar whenmanifestonly="fail" destfile="${dist.maven}/scala-dist/scala-dist.jar" basedir="${dist.dir}"> - <include name="bin/" /> - <include name="doc/" /> - <include name="man/" /> - </jar> - </target> - - <target name="pack-maven.base" depends="pack-maven.core, osgi.done, docs.done, pack-maven.dist"> + <target name="pack-maven.done" depends="pack-maven.core, osgi.done, docs.done, pack.bin, pack.doc"> <!-- TODO modularize compiler <mvn-package project="interactive"/> <mvn-package project="scaladoc"/> @@ -1808,39 +1679,24 @@ MAIN DISTRIBUTION PACKAGING <mvn-package project="actors"/> <!-- don't bother fitting scalap into the mould: it will move out soon --> - <mkdir dir="${dist.maven}"/> <copy tofile="${dist.maven}/scalap/scalap-pom.xml" file="${src.dir}/build/maven/scalap-pom.xml" overwrite="true"/> <copy tofile="${dist.maven}/scalap/scalap.jar" file="${scalap.jar}" overwrite="true"/> <jar destfile="${dist.maven}/scalap/scalap-src.jar" basedir="${src.dir}/scalap" whenmanifestonly="fail"/> <if><not><isset property="docs.skip"/></not><then> <jar destfile="${dist.maven}/scalap/scalap-docs.jar" basedir="${build-docs.dir}/scalap"/> </then></if> - </target> - <!-- TODO: remove this target and delete src/build/maven-deploy.xml --> - <target name="pack-maven.done" depends="pack-maven.base"> - <!-- Create dists/maven/latest alias and copy maven-deploy ant build there. --> - <if><isset property="os.win"/><then> - <copy todir="${dists.dir}/maven/latest" overwrite="true"> - <fileset dir="${dist.maven}"/> - </copy> - </then><else> - <symlink link="${dists.dir}/maven/latest" - resource="${version.number}" - overwrite="true"/> - </else></if> - <!-- copy build file and its dependencies --> - <copy todir="${dist.maven}" - file="${lib-ant.dir}/ant-contrib.jar" overwrite="true"/> - <copy todir="${dist.maven}" - file="${lib-ant.dir}/maven-ant-tasks-2.1.1.jar" overwrite="true"/> - <copy tofile="${dist.maven}/build.xml" - file="${src.dir}/build/maven/maven-deploy.xml"/> - <!-- export properties for use when deploying --> - <echoproperties destfile="${dist.maven}/build.properties"/> + <copy tofile="${dist.maven}/scala-dist/scala-dist-pom.xml" file="${src.dir}/build/maven/scala-dist-pom.xml" overwrite="true"/> + <jar whenmanifestonly="fail" destfile="${dist.maven}/scala-dist/scala-dist.jar" basedir="${build-pack.dir}"> + <include name="bin/" /> + <include name="doc/" /> + <include name="man/" /> + </jar> </target> - <!-- keep these properties out of ${dist.maven}/build.properties, dumped in pack-maven.done --> +<!-- =========================================================================== + MAVEN PUBLISHING +============================================================================ --> <target name="init.maven" depends="init"> <property name="remote.snapshot.repository" value="https://oss.sonatype.org/content/repositories/snapshots" /> <property name="remote.release.repository" value="https://oss.sonatype.org/service/local/staging/deploy/maven2" /> @@ -1860,23 +1716,19 @@ MAIN DISTRIBUTION PACKAGING </else></if> </target> - -<!-- =========================================================================== - MAVEN PUBLISHING -============================================================================ --> - <target name="publish" depends="pack-maven.base, init.maven" description="Publishes unsigned artifacts to the maven repo."> + <target name="publish" depends="pack-maven.done, init.maven" description="Publishes unsigned artifacts to the maven repo."> <deploy /> <deploy-pom name="scala-library-all"/> <deploy-jar name="scala-dist"/> </target> - <target name="publish.local" depends="pack-maven.base, init.maven" description="Publishes unsigned artifacts to the local maven repo."> + <target name="publish.local" depends="pack-maven.done, init.maven" description="Publishes unsigned artifacts to the local maven repo."> <deploy local="true"/> <deploy-pom name="scala-library-all" local="true"/> <deploy-jar name="scala-dist" local="true"/> </target> - <target name="publish.signed" depends="pack-maven.base, init.maven" description="Publishes signed artifacts to the remote maven repo."> + <target name="publish.signed" depends="pack-maven.done, init.maven" description="Publishes signed artifacts to the remote maven repo."> <deploy signed="true"/> <deploy-pom name="scala-library-all" signed="true"/> <deploy-jar name="scala-dist" signed="true"/> diff --git a/src/build/maven/maven-deploy.xml b/src/build/maven/maven-deploy.xml deleted file mode 100644 index a2c3eefbca..0000000000 --- a/src/build/maven/maven-deploy.xml +++ /dev/null @@ -1,281 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- -THIS FILE WILL SOON SELF DESTRUCT; DO NOT USE -see publish.* targets in /build.xml ---> -<project name="sabbus-maven-deploy" xmlns:artifact="urn:maven-artifact-ant"> - - <description> - 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"/> - <element name="artifacts" implicit="true" optional="true"/> - <sequential> - <if><equals arg1="@{jar}" arg2="true"/><then> - <artifact:deploy settingsFile="${settings.file}"> - <artifact:remoteRepository url="${remote.repository}" id="${repository.credentials.id}" /> - <artifact:pom refid="@{pom}" /> - <artifacts/> - </artifact:deploy> - </then><else> - <artifact:deploy file="@{jar}" settingsFile="${settings.file}"> - <artifact:remoteRepository url="${remote.repository}" id="${repository.credentials.id}" /> - <artifact:pom refid="@{pom}" /> - <artifacts/> - </artifact:deploy> - </else></if> - </sequential> - </macrodef> - - <macrodef name="deploy-local"> - <attribute name="jar" default=""/> - <attribute name="pom"/> - <element name="artifacts" implicit="true" optional="true"/> - <sequential> - <if><equals arg1="@{jar}" arg2="true"/><then> - <artifact:install> - <artifact:localRepository path="${local.repository}" id="${repository.credentials.id}" /> - <artifact:pom refid="@{pom}" /> - <artifacts/> - </artifact:install> - </then><else> - <artifact:install file="@{jar}"> - <artifact:localRepository path="${local.repository}" id="${repository.credentials.id}" /> - <artifact:pom refid="@{pom}" /> - <artifacts/> - </artifact:install> - </else></if> - </sequential> - </macrodef> - - <macrodef name="deploy-to"> - <attribute name="jar" default=""/> - <attribute name="pom"/> - <attribute name="local"/> - <element name="artifacts" implicit="true" optional="true"/> - <sequential> - <if><equals arg1="@{local}" arg2="true"/><then> - <deploy-local jar="@{jar}" pom="@{pom}"> <artifacts/> </deploy-local> - </then><else> - <deploy-remote jar="@{jar}" pom="@{pom}"> <artifacts/> </deploy-remote> - </else></if> - </sequential> - </macrodef> - - <macrodef name="filter-pom"> - <attribute name="path" /> - <attribute name="name" /> - - <sequential> - <copy file="${path}-pom.xml" tofile="${path}-pom-filtered.xml" overwrite="true"> - <filterset> - <filter token="VERSION" value="${maven.version.number}" /> - <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}" /> - <filter token="AKKA_ACTOR_VERSION" value="${akka-actor.version.number}" /> - <filter token="ACTORS_MIGRATION_VERSION" value="${actors-migration.version.number}" /> - - <!-- TODO modularize compiler. - <filter token="SCALA_COMPILER_DOC_VERSION" value="${scala-compiler-doc.version.number}" /> - <filter token="SCALA_COMPILER_INTERACTIVE_VERSION" value="${scala-compiler-interactive.version.number}" /> - --> - </filterset> - </copy> - <artifact:pom id="@{name}.pom" file="${path}-pom-filtered.xml" /> - </sequential> - </macrodef> - - <macrodef name="deploy-one"> - <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}-[pom.xml|src.jar|docs.jar].</echo> - - <filter-pom name="@{name}" path="@{path}"/> - - <if><equals arg1="@{signed}" arg2="false"/><then> - <if><isset property="docs.skip"/><then> - <deploy-to local="@{local}" jar="${path}.jar" pom="@{name}.pom"> - <artifact:attach type="jar" file="${path}-src.jar" classifier="sources" /> - </deploy-to> - </then><else> - <deploy-to local="@{local}" jar="${path}.jar" pom="@{name}.pom"> - <artifact:attach type="jar" file="${path}-src.jar" classifier="sources" /> - <artifact:attach type="jar" file="${path}-docs.jar" classifier="javadoc" /> - </deploy-to> - </else></if> - </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="-Dsources=${path}-src.jar" /> - <arg value="-Djavadoc=${path}-docs.jar" /> - <arg value="-Pgpg" /> - <arg value="-Dgpg.useagent=true" /> - </artifact:mvn> - </else></if> - </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-pom"> - <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}-pom.xml.</echo> - - <filter-pom name="@{name}" path="@{path}"/> - - <if><equals arg1="@{signed}" arg2="false"/><then> - <deploy-to local="@{local}" 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}-pom-filtered.xml" /> - <arg value="-Pgpg" /> - <arg value="-Dgpg.useagent=true" /> - </artifact:mvn> - </else></if> - </sequential> - </macrodef> - - <macrodef name="deploy"> - <attribute name="local" default="false"/> - <attribute name="signed" default="false"/> - - <sequential> - <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 name="scala-compiler-doc" local="@{local}" signed="@{signed}"/> - <deploy-one name="scala-compiler-interactive" local="@{local}" signed="@{signed}"/> - --> - - <deploy-one name="scala-actors" local="@{local}" signed="@{signed}"/> - <deploy-one name="scalap" local="@{local}" signed="@{signed}"/> - </sequential> - </macrodef> - - - <target name="boot.maven"> - <!-- Pull in properties from build --> - <property file="build.properties" /> - <!-- Set up Ant contrib tasks so we can use <if><then><else> instead of the clunky `unless` attribute --> - <taskdef resource="net/sf/antcontrib/antlib.xml" classpath="ant-contrib.jar"/> - - <!-- Add our maven ant tasks --> - <path id="maven-ant-tasks.classpath" path="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" /> - </target> - - <target name="init.maven" depends="boot.maven"> - <property name="remote.snapshot.repository" value="https://oss.sonatype.org/content/repositories/snapshots" /> - <property name="remote.release.repository" value="https://oss.sonatype.org/service/local/staging/deploy/maven2" /> - - <property name="local.snapshot.repository" value="${user.home}/.m2/repository" /> - <property name="local.release.repository" value="${user.home}/.m2/repository" /> - - <property name="repository.credentials.id" value="sonatype-nexus" /> - <property name="settings.file" value="${user.home}/.m2/settings.xml" /> - - <if><contains string="${maven.version.number}" substring="-SNAPSHOT"/><then> - <property name="remote.repository" value="${remote.snapshot.repository}"/> - <property name="local.repository" value="${local.snapshot.repository}"/> - </then><else> - <property name="remote.repository" value="${remote.release.repository}"/> - <property name="local.repository" value="${local.release.repository}"/> - </else></if> - - <echo>Using server[${repository.credentials.id}] for maven repository credentials. - Please make sure that your ~/.m2/settings.xml has the needed username/password for this server id - </echo> - </target> - - <target name="deploy" depends="init.maven" description="Deploys unsigned artifacts to the maven repo."> - <echo message="WARNING!1! THIS TARGET HAS BEEN DEPRECATED -- CALL `ant publish` FROM /build.xml"/> - <deploy/> - </target> - - <target name="deploy.local" depends="init.maven" description="Deploys unsigned artifacts to the local maven repo."> - <echo message="WARNING!1! THIS TARGET HAS BEEN DEPRECATED -- CALL `ant publish.local` FROM /build.xml"/> - <deploy local="true"/> - </target> - - <target name="deploy.signed" depends="init.maven" description="Deploys signed artifacts to the remote maven repo."> - <echo message="WARNING!1! THIS TARGET HAS BEEN DEPRECATED -- CALL `ant publish.signed` FROM /build.xml"/> - <deploy signed="true"/> - </target> -</project> |