Greetings, all,
I've just committed a bunch of files to update Hackystat to using Checkstyle 4.2. This
was a bit more complicated than I expected, because Checkstyle is now a
bytecode/classpath crunching system like PMD or FindBugs. I had to do some AutoConfig
hacking to enable each module's auto-generated checkstyle target to autogenerate a
reference to that module's classpath property. The good news is that there are some
interesting new code compliance checks that we can take advantage of, and of course we
can run it on Java5 code.
The bad news is that upon your next svn update, your environment will be broken until you
do the following:
(a) Delete <ant>/lib/checkstyle-3.1-all.jar
(b) Download Checkstyle 4.2 from <http://checkstyle.sourceforge.net/>.
(c) Unzip it someplace reasonable, like c:\java.
(d) Define CHECKSTYLE_HOME to point to c:\java\checkstyle-4.2 (or wherever).
(e) Invoke 'ant -f autoconfig.build.xml' to rebuild your checkstyle targets.
There are a few peculiarities that I'll mention in passing:
- Checkstyle now requires access to the compiled code, so the <module>.checkstyle target
now depends upon <module>.compile.
- I've updated all local.build.xml files so that <module>.compile includes a depends
clause for the modules listed in the
required.modules dependency. This is so that if you call <module>.checkstyle to run
checkstyle over a single module, it will ensure that all of the system that your module
depends on will be compiled, so that checkstyle will find the classes that it needs.
- In freshStart, the all.checkstyle target now comes after the all.compile target (for
obvious reasons).
- Some JavaDocs used the @see tag. In the new Checkstyle, or maybe its the new JavaDoc,
the way to do this is with [EMAIL PROTECTED] I've updated all of the modules to use the
latter.
- I've updated the docbooks to indicate the need to install Checkstyle as part of
installing the source distribution.
- The devbox has been updated. We'll see what happens tonight. I will not be surprised if
there are some problems, even though (I swear) I did a complete all.checkstyle on every
Hackystat public module and it passed on my local workstation. Honest.
- The hackyCore_Build/lib/checkstyle/checkstyle.xml file contains our current compliance
checks. There are a few in there that are commented out. I found them while reading the
4.2 documentation, and they look good, but they generate lots of additional errors and I
decided to leave them for a future task. See
<http://hackydev.ics.hawaii.edu:8080/browse/HACK-763> if you're curious.
Let me know if you run into difficulties.
Cheers,
Philip