diff options
-rwxr-xr-x | build.xml | 274 |
1 files changed, 101 insertions, 173 deletions
@@ -2056,67 +2056,48 @@ TODO: MAIN DISTRIBUTION PACKAGING ============================================================================ --> - <target name="pack-archives.start" depends="dist.done, docs.done"> + <target name="pack-archives.done" depends="dist.done, docs.done"> + <macrodef name="tarz"> + <attribute name="name" description="The tar file name (without extension)."/> + <element name="file-sets" description="A sequence of fileset elements to be included in the tar balls." optional="false" implicit="true"/> + + <sequential> + <tar destfile="@{name}.tar" compression="none" longfile="gnu"> + <file-sets/> + </tar> + <gzip src="@{name}.tar" destfile="@{name}.tgz"/> + <if> + <not><equals arg1="${archives.skipxz}" arg2="true" /></not> + <then> + <exec executable="xz" failifexecutionfails="false"> + <arg line="-k -9e -S .xz @{name}.tar"/> + </exec> + <move file="@{name}.tar.xz" tofile="@{name}.txz" failonerror="false"/> + </then> + </if> + <delete file="@{name}.tar" /> + </sequential> + </macrodef> + <mkdir dir="${dists.dir}/archives"/> - </target> + <property name="archive-base" value="${dists.dir}/archives/${dist.name}"/> - <target name="pack-archives.tar" depends="pack-archives.start"> - <tar destfile="${dists.dir}/archives/${dist.name}.tar" - compression="none" longfile="gnu"> + <tarz name="${archive-base}"> <tarfileset dir="${dist.dir}" prefix="${dist.name}" includes="bin/**" mode="755"/> <tarfileset dir="${dist.dir}" prefix="${dist.name}" excludes="bin/**"/> - </tar> - <gzip src="${dists.dir}/archives/${dist.name}.tar" destfile="${dists.dir}/archives/${dist.name}.tgz"/> - <if> - <not><equals arg1="${archives.skipxz}" arg2="true" /></not> - <then> - <exec executable="xz" failifexecutionfails="false"> - <arg line="-k -9e -S .xz ${dists.dir}/archives/${dist.name}.tar"/> - </exec> - <move file="${dists.dir}/archives/${dist.name}.tar.xz" tofile="${dists.dir}/archives/${dist.name}.txz" failonerror="false"/> - </then> - </if> - <delete file="${dists.dir}/archives/${dist.name}.tar" /> - <checksum fileext=".md5"> - <fileset dir="${dists.dir}/archives"> - <include name="${dist.name}.t?z"/> - </fileset> - </checksum> - </target> + </tarz> - <target name="pack-archives.zip" depends="pack-archives.tar"> - <zip destfile="${dists.dir}/archives/${dist.name}.zip"> + <zip destfile="${archive-base}.zip"> <zipfileset prefix="${dist.name}" dir="${dist.dir}"/> </zip> - <checksum file="${dists.dir}/archives/${dist.name}.zip" fileext=".md5"/> - </target> - <target name="pack-devel-docs.tar" depends="pack-archives.zip" unless="docs.skip"> - <tar destfile="${dists.dir}/archives/${dist.name}-devel-docs.tar" - compression="none" longfile="gnu"> - <tarfileset dir="${dist.dir}/doc/scala-devel-docs" prefix="${dist.name}-devel-docs"/> - </tar> - <gzip src="${dists.dir}/archives/${dist.name}-devel-docs.tar" destfile="${dists.dir}/archives/${dist.name}-devel-docs.tgz"/> - <if> - <not><equals arg1="${archives.skipxz}" arg2="true" /></not> - <then> - <exec executable="xz" failifexecutionfails="false"> - <arg line="-k -9e -S .xz ${dists.dir}/archives/${dist.name}-devel-docs.tar"/> - </exec> - <move file="${dists.dir}/archives/${dist.name}-devel-docs.tar.xz" tofile="${dists.dir}/archives/${dist.name}-devel-docs.txz" failonerror="false"/> - </then> - </if> - <delete file="${dists.dir}/archives/${dist.name}-devel-docs.tar" /> - <checksum fileext=".md5"> - <fileset dir="${dists.dir}/archives"> - <include name="${dist.name}-devel-docs.t?z"/> - </fileset> - </checksum> - </target> + <if><not><isset property="docs.skip"/></not><then> + <tarz name="${archive-base}-devel-docs"> + <tarfileset dir="${dist.dir}/doc/scala-devel-docs" prefix="${dist.name}-devel-docs"/> + </tarz> + </then></if> - <target name="pack-archives.src" depends="pack-devel-docs.tar"> - <tar destfile="${dists.dir}/archives/${dist.name}-sources.tar" - compression="none" longfile="gnu"> + <tarz name="${archive-base}-sources"> <tarfileset dir="${basedir}" prefix="${dist.name}-sources"> <exclude name="bin/**"/> <exclude name="build/**"/> @@ -2130,152 +2111,99 @@ MAIN DISTRIBUTION PACKAGING <tarfileset dir="${basedir}" prefix="${dist.name}-sources" filemode="755"> <include name="test/partest"/> </tarfileset> - </tar> - <gzip src="${dists.dir}/archives/${dist.name}-sources.tar" destfile="${dists.dir}/archives/${dist.name}-sources.tgz"/> - <if> - <not><equals arg1="${archives.skipxz}" arg2="true" /></not> - <then> - <exec executable="xz" failifexecutionfails="false"> - <arg line="-k -9e -S .xz ${dists.dir}/archives/${dist.name}-sources.tar"/> - </exec> - <move file="${dists.dir}/archives/${dist.name}-sources.tar.xz" tofile="${dists.dir}/archives/${dist.name}-sources.txz" failonerror="false"/> - </then> - </if> - <delete file="${dists.dir}/archives/${dist.name}-sources.tar" /> + </tarz> + + <!-- checksum everything --> <checksum fileext=".md5"> <fileset dir="${dists.dir}/archives"> - <include name="${dist.name}-sources.t?z"/> + <include name="${dist.name}*"/> </fileset> </checksum> - </target> - - <target name="pack-archives.latest.unix" depends="pack-archives.src" unless="os.win"> - <!-- 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"/> - </target> - - <target name="pack-archives.latest.win" depends="pack-archives.src" if="os.win"> - <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> - </target> - - <target name="pack-archives.done" depends="pack-archives.src, pack-archives.latest.win, pack-archives.latest.unix"/> - <target name="pack-maven.start" depends="dist.done, docs.done"> - <mkdir dir="${dists.dir}/maven/${version.number}"/> - </target> - - <target name="pack-maven.libs" depends="pack-maven.start"> - <macrodef name="mvn-copy-lib"> - <attribute name="mvn.artifact.name"/> + <!-- 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.done" depends="dist.done, docs.done"> + <property name="maven-base" value="${dists.dir}/maven/${version.number}"/> + + <macrodef name="mvn-package"> + <attribute name="dir" default="" /> + <attribute name="clsdir" default="${dist.dir}/lib/" /> + <attribute name="project" /> + <attribute name="name" default="scala-@{project}"/> <sequential> - <mkdir dir="${dists.dir}/maven/${version.number}/@{mvn.artifact.name}"/> - <copy verbose="true" overwrite="true" todir="${dists.dir}/maven/${version.number}/@{mvn.artifact.name}"> - <fileset dir="${dist.dir}/lib/"> - <filename name="@{mvn.artifact.name}.jar"/> + <local name="path"/> <property name="path" value="${maven-base}/@{dir}@{name}"/> + + <mkdir dir="${path}"/> + <copy verbose="true" overwrite="true" todir="${path}"> + <fileset dir="@{clsdir}"> + <filename name="@{name}.jar"/> </fileset> - <fileset dir="${src.dir}/build/maven/"> - <filename name="@{mvn.artifact.name}-pom.xml"/> + <fileset dir="${src.dir}/build/maven/@{dir}"> + <filename name="@{name}-pom.xml"/> </fileset> <fileset dir="${dist.dir}/src/"> - <filename name="@{mvn.artifact.name}-src.jar"/> + <filename name="@{name}-src.jar"/> </fileset> </copy> - </sequential> - </macrodef> - <mvn-copy-lib mvn.artifact.name="scala-library"/> - <mvn-copy-lib mvn.artifact.name="scala-reflect"/> - <mvn-copy-lib mvn.artifact.name="scala-compiler"/> - <mvn-copy-lib mvn.artifact.name="scala-swing"/> - <mvn-copy-lib mvn.artifact.name="scala-actors"/> - <mvn-copy-lib mvn.artifact.name="scalap"/> - </target> - <target name="pack-maven.plugins" depends="pack-maven.start"> - <macrodef name="mvn-copy-plugin"> - <attribute name="mvn.artifact.name"/> - <sequential> - <mkdir dir="${dists.dir}/maven/${version.number}/plugins/@{mvn.artifact.name}"/> - <copy todir="${dists.dir}/maven/${version.number}/plugins/@{mvn.artifact.name}" overwrite="true"> - <fileset dir="${dist.dir}/misc/scala-devel/plugins/"> - <filename name="@{mvn.artifact.name}.jar"/> - </fileset> - <fileset dir="${src.dir}/build/maven/plugins/"> - <filename name="@{mvn.artifact.name}-pom.xml"/> - </fileset> - </copy> + <if><not><isset property="docs.skip"/></not><then> + <jar whenmanifestonly="fail" destfile="${path}/@{name}-docs.jar" + basedir="${build-docs.dir}/@{project}"> + <include name="**/*"/> + </jar> + </then></if> </sequential> </macrodef> - <mvn-copy-plugin mvn.artifact.name="continuations"/> - </target> - <target name="pack-maven.srcs" depends="pack-maven.libs"> - <!-- Add missing src jars. --> - <!-- Continuations plugin --> - <jar whenmanifestonly="fail" destfile="${dists.dir}/maven/${version.number}/plugins/continuations/continuations-src.jar" - basedir="${src.dir}/continuations/plugin"> - <include name="**/*"/> - </jar> - </target> - <target name="pack-maven.docs" depends="pack-maven.libs, pack-maven.plugins" unless="docs.skip"> - <jar whenmanifestonly="fail" destfile="${dists.dir}/maven/${version.number}/scala-library/scala-library-docs.jar" - basedir="${build-docs.dir}/library"> - <include name="**/*"/> - </jar> - <jar whenmanifestonly="fail" destfile="${dists.dir}/maven/${version.number}/scala-compiler/scala-compiler-docs.jar" - basedir="${build-docs.dir}/compiler"> - <include name="**/*"/> - </jar> - <jar whenmanifestonly="fail" destfile="${dists.dir}/maven/${version.number}/scalap/scalap-docs.jar" - basedir="${build-docs.dir}/scalap"> - <include name="**/*"/> - </jar> - <jar whenmanifestonly="fail" destfile="${dists.dir}/maven/${version.number}/plugins/continuations/continuations-docs.jar" - basedir="${build-docs.dir}/continuations-plugin"> - <include name="**/*"/> - </jar> + <mkdir dir="${maven-base}"/> - <!-- TODO - Scala swing and actors should maybe have thier own jar, but creating it is SLOW. --> - <copy tofile="${dists.dir}/maven/${version.number}/scala-swing/scala-swing-docs.jar" - file="${dists.dir}/maven/${version.number}/scala-library/scala-library-docs.jar" overwrite="true"/> - <copy tofile="${dists.dir}/maven/${version.number}/scala-actors/scala-actors-docs.jar" - file="${dists.dir}/maven/${version.number}/scala-library/scala-library-docs.jar" overwrite="true"/> - <copy tofile="${dists.dir}/maven/${version.number}/scala-reflect/scala-reflect-docs.jar" - file="${dists.dir}/maven/${version.number}/scala-library/scala-library-docs.jar" overwrite="true"/> - </target> + <mvn-package project="library"/> + <mvn-package project="reflect"/> + <mvn-package project="compiler"/> - <target name="pack-maven.latest.unix" depends="pack-maven.docs" unless="os.win"> - <symlink link="${dists.dir}/maven/latest" - resource="${version.number}" - overwrite="true"/> - </target> + <mvn-package project="swing"/> + <mvn-package project="actors"/> + <mvn-package project="scalap" name="scalap"/> + <mvn-package project="continuations-plugin" name="continuations" dir="plugins/" clsdir="${dist.dir}/misc/scala-devel/plugins/"/> - <target name="pack-maven.latest.win" depends="pack-maven.docs" if="os.win"> - <copy todir="${dists.dir}/maven/latest" overwrite="true"> - <fileset dir="${dists.dir}/maven/${version.number}"/> - </copy> - </target> - <target name="pack-maven.scripts" depends="pack-maven.latest.unix,pack-maven.latest.win,pack-maven.srcs"> - <copy todir="${dists.dir}/maven/${version.number}" + <!-- 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="${maven-base}"/> + </copy> + </then><else> + <symlink link="${dists.dir}/maven/latest" + resource="${version.number}" + overwrite="true"/> + </else></if> + <!-- copy build file and its dependencies --> + <copy todir="${maven-base}" file="${lib-ant.dir}/ant-contrib.jar" overwrite="true"/> - <copy todir="${dists.dir}/maven/${version.number}" + <copy todir="${maven-base}" file="${lib-ant.dir}/maven-ant-tasks-2.1.1.jar" overwrite="true"/> - <copy tofile="${dists.dir}/maven/${version.number}/build.xml" + <copy tofile="${maven-base}/build.xml" file="${src.dir}/build/maven/maven-deploy.xml"/> <!-- export properties for use when deploying --> - <echoproperties destfile="${dists.dir}/maven/${version.number}/build.properties"/> - </target> - - <target name="pack-maven.done" depends="pack-maven.scripts"/> + <echoproperties destfile="${maven-base}/build.properties"/> + </target> <!-- =========================================================================== |