ListDiff

Description

Compares two lists of programming elements and computes differences.

You use ListDiff to list changes in what is considered part of the published API. It only needs the lists of names and signatures. No source or bytecode required.

It writes the list of differences into an XML document that follows the list-diff DTD.

Parameters

Attribute Description Required
old input text file for the old version of the list. Yes
new input text file for the new version of the list. Yes
destfile where to write the output. If the file does not exist, it is created. If it already exists, its content is overwritten. Yes
encoding encoding used for the XML output document. Only useful with xml. No
dtdprefix prefix of the DTD URL for the XML output document. Only useful with xml. No
indenttext used for each indentation level in textual and XML output. No
name project name for the report. No
oldlabel version name for the report. If omitted, the tools will use the value of the old parameter instead. No
newlabel version name for the report. If omitted, the tools will use the value of the new parameter instead. No
compress removes redundant entries from the both the removed and added lists. If a package is in a list, its classes and their features are redundant and can be removed. If a class is in a list, its features are redundant and can be removed. No

Nested elements

None

Examples

Suppose you generated old.txt and new.txt by hand from your old and new codebases respectively.

To compare the lists in old.txt and new.txt and save the resulting report to diff.xml:

  <listdiff old="old.xml"
            new="new.xml"
            destfile="diff.xml"/>

To add nice labels and convert to HTML:

  <listdiff name="Dependency Finder"
            old="old.xml"
            oldlabel="20020127"
            new="new.xml"
            newlabel="20020711"
            destfile="diff.xml"/>
  <xslt style="${dependencyfinder.home}/etc/ListDiffToHTML.xsl"
        in="diff.xml"
        out="diff.html"/>

To compare the lists in old.txt and new.txt and save the resulting report, with compression, to diff.xml:

  <listdiff old="old.xml"
            new="new.xml"
            destfile="diff.xml"
            compress="yes"/>

Copyright © 2001-2024 Jean Tessier. All rights reserved.