ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject [ANN] jardump and jdiff
Date Fri, 19 Jul 2002 19:01:35 GMT
For what it's worth...

Included is a zip that contains only one Java source and a build.xml (that
requires BCEL and GenJar). Once compiled and package into a 100KB self
contained executable Jar, it dumps to standard output all the public classes
(their public/protected members only by default) contained within the Jar.
Here's an extract of jardump.jar run on itself:

P:\com_lgc\build\tools\jardump>java -jar jardump.jar jardump.jar >
jardump.txt

P:\com_lgc\build\tools\jardump>C:\pro\cygwin\bin\head.exe jardump.txt

public class JarApiWriter {
  public static final boolean VERBOSE;
  public static final boolean QUIET;
  public static final boolean NOEXIT;

  public static void main(String[] args)
  public static int execute(String[] args)
}

This utility can thus be used to compare two versions of the same jar. Dump
both jars, and simply compare the two dumps using your favorite graphical
(or not) diff tool. Hopefully that should help us avoid team members
checking in new version of jars with incompatible changes to the public API
of a jar before it breaks the build... Because it uses BCEL, one doesn't
need any classes on the classpath the dumped Jar depends on, like Javap
requires (severely limiting its use!).

To get the gory details about all classes in the JAR (instead of just
public/protected members of public classes/interfaces), add -Dverbose=true
to the java command line.

Note also that there's a tool called JDiff (at
http://javadiff.sourceforge.net <http://javadiff.sourceforge.net>  ) that
allows to extract differences between two releases of the same software
(since it's a doclet, I assume it needs the source code though). Would be
great to have the differences between Ant 1.4.1 and 1.5 code bases. --DD

 <<jardump.zip>> 

Mime
View raw message