summaryrefslogtreecommitdiff
path: root/build-support.xml
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2013-11-25 16:06:21 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-11-25 17:32:45 -0800
commit23f52a8aadea40248cb16c59273b271324db40fd (patch)
treef04542689a71141987ffe196a682123f09369dfb /build-support.xml
parent7a1a160d8ba2d1c2a8d71453978ac8e4d3838f06 (diff)
downloadscala-23f52a8aadea40248cb16c59273b271324db40fd.tar.gz
scala-23f52a8aadea40248cb16c59273b271324db40fd.tar.bz2
scala-23f52a8aadea40248cb16c59273b271324db40fd.zip
Move all macros in build.xml to build-support.xml.
No functional changes -- in an effort to separate state from behavior.
Diffstat (limited to 'build-support.xml')
-rw-r--r--build-support.xml547
1 files changed, 547 insertions, 0 deletions
diff --git a/build-support.xml b/build-support.xml
new file mode 100644
index 0000000000..735e91ba7b
--- /dev/null
+++ b/build-support.xml
@@ -0,0 +1,547 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="build-support">
+ <description> Macros for Scala's ant build </description>
+
+ <macrodef name="optimized">
+ <attribute name="name"/>
+ <sequential>
+ <antcall target="@{name}">
+ <param name="scalac.args.optimise" value="-optimise"/>
+ </antcall>
+ </sequential>
+ </macrodef>
+
+ <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="project"/>
+ <attribute name="refid" default="@{project}.fileset"/>
+ <sequential>
+ <delete dir="${build-deps.dir}/@{project}" includes="*.jar"/>
+ <copy todir="${build-deps.dir}/@{project}">
+ <resources refid="@{refid}"/>
+ <mapper type="flatten"/>
+ </copy>
+ </sequential>
+ </macrodef>
+
+ <!-- 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="propertyForCrossedArtifact">
+ <attribute name="name"/>
+ <attribute name="jar"/>
+ <sequential>
+ <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>
+
+ <!-- Set property named @{name} to the value of the property named @{property}.
+ Helper for performing nested property expansion without using the ant props lib -->
+ <macrodef name="readProperty">
+ <attribute name="name"/>
+ <attribute name="property"/>
+ <sequential>
+ <property name="@{name}" value="${@{property}}"/>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="init-project-prop">
+ <attribute name="project"/>
+ <attribute name="name"/>
+ <attribute name="default"/>
+ <sequential>
+ <local name="@{name}"/>
+ <if>
+ <not>
+ <isset property="@{project}.@{name}"/>
+ </not>
+ <then>
+ <property name="@{project}.@{name}" value="@{default}"/>
+ </then>
+ </if>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="clean">
+ <attribute name="build"/>
+ <sequential>
+ <delete dir="${build-@{build}.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="simple-javac">
+ <attribute name="project"/>
+ <!-- project: asm/forkjoin -->
+ <attribute name="args" default=""/>
+ <attribute name="jar" default="yes"/>
+ <sequential>
+ <uptodate property="@{project}.available" targetfile="${build-libs.dir}/@{project}.complete">
+ <srcfiles dir="${src.dir}/@{project}"/>
+ </uptodate>
+ <if>
+ <not>
+ <isset property="@{project}.available"/>
+ </not>
+ <then>
+ <stopwatch name="@{project}.timer"/>
+ <mkdir dir="${@{project}-classes}"/>
+ <javac debug="true" srcdir="${src.dir}/@{project}" destdir="${@{project}-classes}" classpath="${@{project}-classes}" includes="**/*.java" target="1.6" source="1.5" compiler="javac1.6">
+ <compilerarg line="${javac.args} @{args}"/>
+ </javac>
+ <if>
+ <equals arg1="@{jar}" arg2="yes"/>
+ <then>
+ <jar whenmanifestonly="fail" destfile="${build-libs.dir}/@{project}.jar" basedir="${@{project}-classes}"/>
+ </then>
+ </if>
+ <stopwatch name="@{project}.timer" action="total"/>
+ <mkdir dir="${build-libs.dir}"/>
+ <touch file="${build-libs.dir}/@{project}.complete" verbose="no"/>
+ </then>
+ </if>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="staged-javac">
+ <attribute name="stage"/>
+ <!-- current stage (locker, quick, strap) -->
+ <attribute name="project"/>
+ <!-- project: library/reflect/compiler/actors -->
+ <attribute name="destproject" default="@{project}"/>
+ <!-- overrides the output directory; used when building multiple projects into the same directory-->
+ <attribute name="args" default=""/>
+ <attribute name="excludes" default=""/>
+ <sequential>
+ <javac debug="true" srcdir="${src.dir}/@{project}" destdir="${build-@{stage}.dir}/classes/@{destproject}" includes="**/*.java" excludes="@{excludes}" target="1.6" source="1.5">
+ <compilerarg line="${javac.args} @{args}"/>
+ <classpath refid="@{stage}.@{destproject}.build.path"/>
+ </javac>
+ </sequential>
+ </macrodef>
+
+ <!-- Zinc assumes a one-to-one correspondence of output folder to set of source files.
+ When compiling different sets of source files in multiple compilations to the same output directory,
+ Zinc thinks source files that appeared in an earlier compilation but are absent in the current one,
+ were deleted and thus deletes the corresponding output files.
+
+ Note that zinc also requires each arg to scalac to be prefixed by -S.
+ -->
+ <macrodef name="zinc">
+ <attribute name="compilerpathref"/>
+ <attribute name="destdir"/>
+ <attribute name="srcdir"/>
+ <attribute name="srcpath" default="NOT SET"/>
+ <!-- needed to compile the library, "NOT SET" is just a convention to denote an optional attribute -->
+ <attribute name="buildpathref"/>
+ <attribute name="params" default=""/>
+ <attribute name="java-excludes" default=""/>
+ <sequential>
+ <local name="sources"/>
+ <pathconvert pathsep=" " property="sources">
+ <fileset dir="@{srcdir}">
+ <include name="**/*.java"/>
+ <include name="**/*.scala"/>
+ <exclude name="@{java-excludes}"/>
+ </fileset>
+ </pathconvert>
+ <local name="args"/>
+ <local name="sargs"/>
+ <if>
+ <not>
+ <equals arg1="@{srcpath}" arg2="NOT SET"/>
+ </not>
+ <then>
+ <property name="args" value="@{params} -sourcepath @{srcpath}"/>
+ </then>
+ </if>
+ <property name="args" value="@{params}"/>
+ <!-- default -->
+ <!-- HACK: prefix scalac args by -S -->
+ <script language="javascript">
+ project.setProperty("sargs", project.getProperty("args").trim().replaceAll(" ", " -S"));
+ </script>
+ <exec osfamily="unix" executable="tools/zinc" failifexecutionfails="true" failonerror="true">
+ <arg line="-nailed -compile-order JavaThenScala -scala-path ${ant.refid:@{compilerpathref}} -d @{destdir} -classpath ${toString:@{buildpathref}} ${sargs} ${sources}"/>
+ </exec>
+ </sequential>
+ </macrodef>
+
+ <!-- STAGED COMPILATION MACROS -->
+ <macrodef name="staged-scalac">
+ <attribute name="with"/>
+ <!-- will use path `@{with}.compiler.path` to locate scalac -->
+ <attribute name="stage"/>
+ <!-- current stage (locker, quick, strap) -->
+ <attribute name="project"/>
+ <!-- project: library/reflect/compiler/actors -->
+ <attribute name="srcpath" default="NOT SET"/>
+ <!-- needed to compile the library -->
+ <attribute name="args" default=""/>
+ <!-- additional args -->
+ <attribute name="destproject" default="@{project}"/>
+ <!-- overrides the output directory; used when building multiple projects into the same directory-->
+ <attribute name="srcdir" default="@{project}"/>
+ <attribute name="java-excludes" default=""/>
+ <sequential>
+ <!-- TODO: detect zinc anywhere on PATH
+ use zinc for the quick stage if it's available;
+ would use it for locker but something is iffy in sbt: get a class cast error on global phase -->
+ <if>
+ <and>
+ <available file="tools/zinc"/>
+ <equals arg1="@{stage}" arg2="quick"/>
+ <not>
+ <equals arg1="@{project}" arg2="continuations-plugins"/>
+ </not>
+ <!-- doesn't work in zinc because it requires the quick compiler, which isn't jarred up-->
+ </and>
+ <then>
+ <zinc taskname="Z.@{stage}.@{project}" compilerpathref="@{with}.compiler.path" destdir="${build-@{stage}.dir}/classes/@{destproject}" srcdir="${src.dir}/@{srcdir}" srcpath="@{srcpath}" buildpathref="@{stage}.@{project}.build.path" params="${scalac.args.@{stage}} @{args}" java-excludes="@{java-excludes}"/>
+ </then>
+ <else>
+ <if>
+ <equals arg1="@{srcpath}" arg2="NOT SET"/>
+ <then>
+ <scalacfork taskname="@{stage}.@{project}" jvmargs="${scalacfork.jvmargs}" compilerpathref="@{with}.compiler.path" destdir="${build-@{stage}.dir}/classes/@{destproject}" srcdir="${src.dir}/@{srcdir}" params="${scalac.args.@{stage}} @{args}">
+ <include name="**/*.scala"/>
+ <compilationpath refid="@{stage}.@{project}.build.path"/>
+ </scalacfork>
+ </then>
+ <else>
+ <scalacfork taskname="@{stage}.@{project}" jvmargs="${scalacfork.jvmargs}" compilerpathref="@{with}.compiler.path" destdir="${build-@{stage}.dir}/classes/@{destproject}" srcdir="${src.dir}/@{srcdir}" srcpath="@{srcpath}" params="${scalac.args.@{stage}} @{args}">
+ <include name="**/*.scala"/>
+ <compilationpath refid="@{stage}.@{project}.build.path"/>
+ </scalacfork>
+ </else>
+ </if>
+ </else>
+ </if>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="staged-uptodate">
+ <attribute name="stage"/>
+ <attribute name="project"/>
+ <element name="check"/>
+ <element name="do"/>
+ <sequential>
+ <uptodate property="@{stage}.@{project}.available" targetfile="${build-@{stage}.dir}/@{project}.complete">
+ <check/>
+ </uptodate>
+ <if>
+ <not>
+ <isset property="@{stage}.@{project}.available"/>
+ </not>
+ <then>
+ <do/>
+ <touch file="${build-@{stage}.dir}/@{project}.complete" verbose="no"/>
+ </then>
+ </if>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="staged-build">
+ <attribute name="with"/>
+ <!-- will use path `@{with}.compiler.path` to locate scalac -->
+ <attribute name="stage"/>
+ <!-- current stage (locker, quick, strap) -->
+ <attribute name="project"/>
+ <!-- project: library/reflect/compiler/actors -->
+ <attribute name="srcpath" default="NOT SET"/>
+ <!-- needed to compile the library -->
+ <attribute name="args" default=""/>
+ <!-- additional args -->
+ <attribute name="includes" default="comp.includes"/>
+ <attribute name="java-excludes" default=""/>
+ <attribute name="version" default=""/>
+ <!-- non-empty for scaladoc: use @{version}.version.number in property file-->
+ <sequential>
+ <staged-uptodate stage="@{stage}" project="@{project}">
+ <check>
+ <srcfiles dir="${src.dir}/@{project}"/>
+ </check>
+ <do>
+ <stopwatch name="@{stage}.@{project}.timer"/>
+ <mkdir dir="${build-@{stage}.dir}/classes/@{project}"/>
+ <staged-javac stage="@{stage}" project="@{project}" excludes="@{java-excludes}"/>
+ <!-- always compile with javac for simplicity and regularity; it's cheap -->
+ <staged-scalac with="@{with}" stage="@{stage}" project="@{project}" srcpath="@{srcpath}" args="@{args}" java-excludes="@{java-excludes}"/>
+ <if>
+ <equals arg1="@{version}" arg2=""/>
+ <then>
+ <propertyfile file="${build-@{stage}.dir}/classes/@{project}/@{project}.properties">
+ <entry key="version.number" value="${version.number}"/>
+ <entry key="maven.version.number" value="${maven.version.number}"/>
+ <entry key="osgi.version.number" value="${osgi.version.number}"/>
+ <entry key="copyright.string" value="${copyright.string}"/>
+ </propertyfile>
+ </then>
+ <else>
+ <propertyfile file="${build-@{stage}.dir}/classes/@{project}/@{project}.properties">
+ <entry key="version.number" value="${@{version}.version.number}"/>
+ <entry key="copyright.string" value="${copyright.string}"/>
+ </propertyfile>
+ </else>
+ </if>
+ <copy todir="${build-@{stage}.dir}/classes/@{project}">
+ <fileset dir="${src.dir}/@{project}">
+ <patternset refid="@{includes}"/>
+ </fileset>
+ </copy>
+ <stopwatch name="@{stage}.@{project}.timer" action="total"/>
+ </do>
+ </staged-uptodate>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="staged-bin">
+ <attribute name="stage"/>
+ <attribute name="classpathref" default="NOT SET"/>
+ <sequential>
+ <staged-uptodate stage="@{stage}" project="bin">
+ <check>
+ <srcfiles dir="${src.dir}">
+ <include name="compiler/scala/tools/ant/templates/**"/>
+ </srcfiles>
+ </check>
+ <do>
+ <taskdef name="mk-bin" classname="scala.tools.ant.ScalaTool" classpathref="@{stage}.bin.tool.path"/>
+ <mkdir dir="${build-@{stage}.dir}/bin"/>
+ <if>
+ <equals arg1="@{classpathref}" arg2="NOT SET"/>
+ <then>
+ <mk-bin file="${build-@{stage}.dir}/bin/scala" class="scala.tools.nsc.MainGenericRunner" javaFlags="${java.flags}"/>
+ <mk-bin file="${build-@{stage}.dir}/bin/scalac" class="scala.tools.nsc.Main" javaFlags="${java.flags}"/>
+ <mk-bin file="${build-@{stage}.dir}/bin/scaladoc" class="scala.tools.nsc.ScalaDoc" javaFlags="${java.flags}"/>
+ <mk-bin file="${build-@{stage}.dir}/bin/fsc" class="scala.tools.nsc.CompileClient" javaFlags="${java.flags}"/>
+ <mk-bin file="${build-@{stage}.dir}/bin/scalap" class="scala.tools.scalap.Main" javaFlags="${java.flags}"/>
+ </then>
+ <else>
+ <mk-bin file="${build-@{stage}.dir}/bin/scala" class="scala.tools.nsc.MainGenericRunner" javaFlags="${java.flags}" classpathref="@{classpathref}"/>
+ <mk-bin file="${build-@{stage}.dir}/bin/scalac" class="scala.tools.nsc.Main" javaFlags="${java.flags}" classpathref="@{classpathref}"/>
+ <mk-bin file="${build-@{stage}.dir}/bin/scaladoc" class="scala.tools.nsc.ScalaDoc" javaFlags="${java.flags}" classpathref="@{classpathref}"/>
+ <mk-bin file="${build-@{stage}.dir}/bin/fsc" class="scala.tools.nsc.CompileClient" javaFlags="${java.flags}" classpathref="@{classpathref}"/>
+ <mk-bin file="${build-@{stage}.dir}/bin/scalap" class="scala.tools.scalap.Main" javaFlags="${java.flags}" classpathref="@{classpathref}"/>
+ </else>
+ </if>
+ <chmod perm="ugo+rx" file="${build-@{stage}.dir}/bin/scala"/>
+ <chmod perm="ugo+rx" file="${build-@{stage}.dir}/bin/scalac"/>
+ <chmod perm="ugo+rx" file="${build-@{stage}.dir}/bin/scaladoc"/>
+ <chmod perm="ugo+rx" file="${build-@{stage}.dir}/bin/fsc"/>
+ <chmod perm="ugo+rx" file="${build-@{stage}.dir}/bin/scalap"/>
+ </do>
+ </staged-uptodate>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="staged-pack">
+ <attribute name="project"/>
+ <attribute name="manifest" default=""/>
+ <element name="pre" optional="true"/>
+ <element name="jar-opts" optional="true"/>
+ <sequential>
+ <local name="destfile"/>
+ <property name="destfile" value="${build-pack.dir}/${@{project}.targetdir}/${@{project}.targetjar}"/>
+ <uptodate property="pack.@{project}.available" targetfile="${destfile}">
+ <srcresources>
+ <resources refid="pack.@{project}.files"/>
+ <!-- <path><pathelement location="${build-quick.dir}/@{project}.complete"/></path> -->
+ </srcresources>
+ </uptodate>
+ <if>
+ <not>
+ <isset property="pack.@{project}.available"/>
+ </not>
+ <then>
+ <mkdir dir="${build-pack.dir}/${@{project}.targetdir}"/>
+ <pre/>
+ <if>
+ <not>
+ <equals arg1="@{manifest}" arg2=""/>
+ </not>
+ <then>
+ <jar whenmanifestonly="fail" destfile="${destfile}" manifest="@{manifest}">
+ <!-- update="true" makes no difference on my machine, so starting from scratch-->
+ <jar-opts/>
+ <path refid="pack.@{project}.files"/>
+ </jar>
+ </then>
+ <else>
+ <jar whenmanifestonly="fail" destfile="${destfile}">
+ <jar-opts/>
+ <path refid="pack.@{project}.files"/>
+ </jar>
+ </else>
+ </if>
+ </then>
+ </if>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="staged-docs">
+ <attribute name="project"/>
+ <element name="includes" implicit="true"/>
+ <sequential>
+ <staged-uptodate stage="docs" project="@{project}">
+ <check>
+ <srcfiles dir="${src.dir}/${@{project}.srcdir}"/>
+ </check>
+ <do>
+ <stopwatch name="docs.@{project}.timer"/>
+ <mkdir dir="${build-docs.dir}/@{project}"/>
+ <if>
+ <equals arg1="${@{project}.docroot}" arg2="NOT SET"/>
+ <then>
+ <scaladoc destdir="${build-docs.dir}/@{project}" doctitle="${@{project}.description}" docfooter="epfl" docversion="${version.number}" sourcepath="${src.dir}" classpathref="docs.@{project}.build.path" srcdir="${src.dir}/${@{project}.srcdir}" addparams="${scalac.args.all}" implicits="on" diagrams="on" groups="on" rawOutput="${scaladoc.raw.output}" noPrefixes="${scaladoc.no.prefixes}" docUncompilable="${src.dir}/library-aux" skipPackages="${@{project}.skipPackages}">
+ <includes/>
+ </scaladoc>
+ </then>
+ <else>
+ <scaladoc destdir="${build-docs.dir}/@{project}" doctitle="${@{project}.description}" docfooter="epfl" docversion="${version.number}" sourcepath="${src.dir}" classpathref="docs.@{project}.build.path" srcdir="${src.dir}/${@{project}.srcdir}" docRootContent="${src.dir}/@{project}/${@{project}.docroot}" addparams="${scalac.args.all}" implicits="on" diagrams="on" groups="on" rawOutput="${scaladoc.raw.output}" noPrefixes="${scaladoc.no.prefixes}" docUncompilable="${src.dir}/library-aux" skipPackages="${@{project}.skipPackages}">
+ <includes/>
+ </scaladoc>
+ </else>
+ </if>
+ <stopwatch name="docs.@{project}.timer" action="total"/>
+ </do>
+ </staged-uptodate>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="make-bundle">
+ <attribute name="project"/>
+ <element name="srcs" description="Sources for this bundle" optional="true" implicit="true"/>
+ <sequential>
+ <copy file="${src.dir}/build/bnd/${@{project}.name}.bnd" tofile="${build-osgi.dir}/${@{project}.name}.bnd" overwrite="true">
+ <filterset>
+ <filter token="VERSION" value="${osgi.version.number}"/>
+ <filter token="SCALA_BINARY_VERSION" value="${scala.binary.version}"/>
+ <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>
+ <bnd classpath="${@{project}.jar}" eclipse="false" failok="false" exceptions="true" files="${build-osgi.dir}/${@{project}.name}.bnd" output="${build-osgi.dir}"/>
+ <if>
+ <equals arg1="${@{project}.src}" arg2="true"/>
+ <then>
+ <!--
+ A jar-like task that creates an OSGi source bundle. It adds the required MANIFEST.MF headers that allow
+ Eclipse to match sources with the corresponding binaries.
+ -->
+ <jar whenmanifestonly="fail" destfile="${build-osgi.dir}/${@{project}.name}-src.jar">
+ <srcs/>
+ <manifest>
+ <attribute name="Manifest-Version" value="1.0"/>
+ <attribute name="Bundle-Name" value="${@{project}.description} Sources"/>
+ <attribute name="Bundle-SymbolicName" value="org.scala-lang.${@{project}.package}${@{project}.name}${@{project}.namesuffix}.source"/>
+ <attribute name="Bundle-Version" value="${@{project}.version}"/>
+ <attribute name="Eclipse-SourceBundle" value="org.scala-lang.${@{project}.package}${@{project}.name}${@{project}.namesuffix};version=&quot;${@{project}.version}&quot;;roots:=&quot;.&quot;"/>
+ </manifest>
+ </jar>
+ </then>
+ </if>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="copy-bundle">
+ <attribute name="project"/>
+ <sequential>
+ <copy tofile="${dist.dir}/${@{project}.targetdir}/${@{project}.name}.jar" file="${build-osgi.dir}/org.scala-lang.${@{project}.package}${@{project}.name}.jar" overwrite="true"/>
+ <copy tofile="${dist.dir}/src/${@{project}.name}-src.jar" file="${@{project}.srcjar}" overwrite="true"/>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="mvn-package">
+ <attribute name="project"/>
+ <sequential>
+ <local name="artifact-base"/>
+ <property name="artifact-base" value="${maven-base}/${@{project}.dir}${@{project}.name}/${@{project}.name}"/>
+ <mkdir dir="${maven-base}/${@{project}.dir}${@{project}.name}"/>
+ <copy tofile="${artifact-base}.jar" file="${build-osgi.dir}/org.scala-lang.${@{project}.package}${@{project}.name}${@{project}.namesuffix}.jar" overwrite="true"/>
+ <copy tofile="${artifact-base}-src.jar" file="${build-osgi.dir}/${@{project}.name}-src.jar" overwrite="true"/>
+ <copy tofile="${artifact-base}-pom.xml" file="${src.dir}/build/maven/${@{project}.dir}/${@{project}.name}-pom.xml" overwrite="true"/>
+ <if>
+ <not>
+ <isset property="docs.skip"/>
+ </not>
+ <then>
+ <jar destfile="${artifact-base}-docs.jar" basedir="${build-docs.dir}/@{project}" whenmanifestonly="fail">
+ <include name="**/*"/>
+ </jar>
+ </then>
+ </if>
+ </sequential>
+ </macrodef>
+
+
+
+ <macrodef name="testSuite">
+ <attribute name="dir" default="${partest.dir}"/>
+ <attribute name="srcdir" default="files"/> <!-- TODO: make targets for `pending` and other subdirs -->
+ <attribute name="colors" default="${partest.colors}"/>
+ <attribute name="scalacOpts" default="${scalac.args.optimise}"/>
+ <attribute name="pcp" default="${toString:partest.compilation.path}"/>
+ <attribute name="kinds"/>
+ <sequential>
+ <property name="partest.dir" value="@{dir}" />
+ <partest srcdir="@{srcdir}"
+ kinds="@{kinds}"
+ colors="@{colors}"
+ scalacOpts="@{scalacOpts}"
+ compilationpath="@{pcp}"/>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="bc.run-mima">
+ <attribute name="jar-name"/>
+ <attribute name="prev"/>
+ <attribute name="curr"/>
+ <attribute name="direction"/>
+ <sequential>
+ <echo message="Checking @{direction} binary compatibility for @{jar-name} (against ${bc-reference-version})"/>
+ <java taskname="mima" fork="true" failonerror="true" classname="com.typesafe.tools.mima.cli.Main">
+ <arg value="--prev"/>
+ <arg value="@{prev}"/>
+ <arg value="--curr"/>
+ <arg value="@{curr}"/>
+ <arg value="--filters"/>
+ <arg value="${basedir}/bincompat-@{direction}.whitelist.conf"/>
+ <arg value="--generate-filters"/>
+ <classpath>
+ <path refid="mima.classpath"/>
+ </classpath>
+ </java>
+ </sequential>
+ </macrodef>
+
+ <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"/>
+ </sequential>
+ </macrodef>
+
+ <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>
+</project>