Teach an old dog new tricks (or now using Classycle)
Thanks to Tim Vernum for responding to my last post about Detecting Cycles with ANT/JDepend, I now know about the tool Classycle which is much better suited for the task. Here is the ANT target I added to my build.xml
file replacing the old approach:
As you can see this is a lot smaller and simpler than the previous approach.
Some notes:
-
Another nice advantage of this approach is that you do not need to
classcyle.jar
to your${ANT\_HOME}/lib
directory. With the JDepend approach you need to add the JDepend JAR file to the${ANT\_HOME}/lib
directory. - I still use the Checkstyle ImportControl check for enforcing the project layering/dependency rules. The immediate feedback this gives in the Eclipse IDE via the eclipse-cs is invaluable. That said, Classycle looks very capable.