Permalink
Browse files

Merge pull request #2271 from retronym/topic/mima-refactor

Reduce duplication and increase verbosity in MiMa execution.
  • Loading branch information...
adriaanm committed Mar 18, 2013
2 parents 144671e + e90efd6 commit bbd69f5dd1d5b7eb6a90aa7d59df9c491d112d4d
Showing with 44 additions and 91 deletions.
  1. +44 −91 build.xml
View
135 build.xml
@@ -2665,100 +2665,53 @@ Binary compatibility testing
</artifact:dependencies>
</target>
+ <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}"/>
+ <java
+ 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="jar-name"/>
+ <sequential>
+ <bc.run-mima
+ jar-name="@{jar-name}"
+ prev="${org.scala-lang:@{jar-name}:jar}"
+ curr="${build-pack.dir}/lib/@{jar-name}.jar"
+ direction="backward"/>
+ <bc.run-mima
+ jar-name="@{jar-name}"
+ prev="${build-pack.dir}/lib/@{jar-name}.jar"
+ curr="${org.scala-lang:@{jar-name}:jar}"
+ direction="forward"/>
+ </sequential>
+ </macrodef>
+
<target name="bc.run" depends="bc.init, pack.done">
- <java
- fork="true"
- failonerror="true"
- classname="com.typesafe.tools.mima.cli.Main">
- <arg value="--prev"/>
- <arg value="${org.scala-lang:scala-library:jar}"/>
- <arg value="--curr"/>
- <arg value="${build-pack.dir}/lib/scala-library.jar"/>
- <arg value="--filters"/>
- <arg value="${basedir}/bincompat-backward.whitelist.conf"/>
- <arg value="--generate-filters"/>
- <classpath>
- <path refid="mima.classpath"/>
- </classpath>
- </java>
- <java
- fork="true"
- failonerror="true"
- classname="com.typesafe.tools.mima.cli.Main">
- <arg value="--prev"/>
- <arg value="${org.scala-lang:scala-reflect:jar}"/>
- <arg value="--curr"/>
- <arg value="${build-pack.dir}/lib/scala-reflect.jar"/>
- <arg value="--filters"/>
- <arg value="${basedir}/bincompat-backward.whitelist.conf"/>
- <arg value="--generate-filters"/>
- <classpath>
- <path refid="mima.classpath"/>
- </classpath>
- </java>
- <java
- fork="true"
- failonerror="true"
- classname="com.typesafe.tools.mima.cli.Main">
- <arg value="--prev"/>
- <arg value="${org.scala-lang:scala-swing:jar}"/>
- <arg value="--curr"/>
- <arg value="${build-pack.dir}/lib/scala-swing.jar"/>
- <arg value="--filters"/>
- <arg value="${basedir}/bincompat-backward.whitelist.conf"/>
- <arg value="--generate-filters"/>
- <classpath>
- <path refid="mima.classpath"/>
- </classpath>
- </java>
- <java
- fork="true"
- failonerror="true"
- classname="com.typesafe.tools.mima.cli.Main">
- <arg value="--curr"/>
- <arg value="${org.scala-lang:scala-library:jar}"/>
- <arg value="--prev"/>
- <arg value="${build-pack.dir}/lib/scala-library.jar"/>
- <arg value="--filters"/>
- <arg value="${basedir}/bincompat-forward.whitelist.conf"/>
- <arg value="--generate-filters"/>
- <classpath>
- <path refid="mima.classpath"/>
- </classpath>
- </java>
- <java
- fork="true"
- failonerror="true"
- classname="com.typesafe.tools.mima.cli.Main">
- <arg value="--curr"/>
- <arg value="${org.scala-lang:scala-reflect:jar}"/>
- <arg value="--prev"/>
- <arg value="${build-pack.dir}/lib/scala-reflect.jar"/>
- <arg value="--filters"/>
- <arg value="${basedir}/bincompat-forward.whitelist.conf"/>
- <arg value="--generate-filters"/>
- <classpath>
- <path refid="mima.classpath"/>
- </classpath>
- </java>
- <java
- fork="true"
- failonerror="true"
- classname="com.typesafe.tools.mima.cli.Main">
- <arg value="--curr"/>
- <arg value="${org.scala-lang:scala-swing:jar}"/>
- <arg value="--prev"/>
- <arg value="${build-pack.dir}/lib/scala-swing.jar"/>
- <arg value="--filters"/>
- <arg value="${basedir}/bincompat-forward.whitelist.conf"/>
- <arg value="--generate-filters"/>
- <classpath>
- <path refid="mima.classpath"/>
- </classpath>
- </java>
+ <bc.check jar-name="scala-library"/>
+ <bc.check jar-name="scala-reflect"/>
+ <bc.check jar-name="scala-swing"/>
</target>
-
<!-- ===========================================================================
DISTRIBUTION
============================================================================ -->

0 comments on commit bbd69f5

Please sign in to comment.