WTP/Build/VersionChecker

Introduction

In WTP we use a utility application, informally called VersionChecker, that can be used during a build to compare the current set of bundle version numbers to some reference set of version numbers to make sure they follow the rules of versioning (they all "increase" in minor or service fields) from one release to another. We don't intend this to be API or a general purpose tools that fits all projects, but if other teams/projects would like to use it, add it it, fix bugs!, etc. feel free. But please do contribute back any improvements or fixes you make ... or, even, improve these brief directions so others could use them!

Note: in Eclipse 3.4 there are API tools that should help developers spot and correctly increment version numbers. API Tools also includes a set of ANT tasks that can be run in a Headless build. These tasks are included in the org.eclipse.pde.api.tools plug-in. Currently WTP still uses it's own version checker. More information on API Tooling from PDE can be found in the API Tooling Introduction on Developer Works. The API Tooling ANT tasks are available in the Eclipse 3.5 Milestone builds, along with the documentation.

Code Location

Brief outline of use

The reference data is currently kept in a master file in the versionchecker bundle, named referenceVersioningData.xml. Each set if reference data is in one element, referenceData, with a reference id attribute which is how subsequent tests find the data to compare.

[TODO: in practice, it'd help to have the ability to find reference data in a location independent of the bundle.]

Listing data:

There is one mode (application) of only listing data, org.eclipse.wtp.releng.versionchecker.listVersions. After all, you need at least one reference to compare to. In practice, the reference data file is generated every build, in case that is desired to become official reference data.

Comparing data:

There is another mode (application) to compare the current set of version numbers (in the environment that is running) with a specified set of reference data.

In practice, this can be used as a JUnit test with code similar to the following.

During such a run of the test, there are several files created ... that are identified by the buildid:

versioningReference_3.0.2.xmlThis is simply a listing of the current version numbers ... in a form that can be used as a future reference set. If that is desired, then the set of data in this file, must be copied into the master data file, referenceVersioningData.xml

versioningReport_3.0.2.xmlThis is an actual report of the differences found. Also included are bundles that had do difference, bundles that are new, and bundles that are no longer in the current environment.

versioningReportToHTML.xslNot actually created, but exists in versionChecker bundle to produce an HTML form of the report. Can be customized or improved for better reports, naturally.