Created attachment 26627 [details] Patch to enable caching Checkstyle supports caching files that have successfully passed with no errors, so that these files are not processed again on subsequent invocations of Checkstyle until the files are modified again. As the output below shows, this speeds up the Checkstyle from 51 seconds to 15 seconds. The attached patch, based on trunk, adds support for caching Checkstyle results. The cache files are stored in the ${tomcat.output} directory, so are removed whenever an "ant clean" is performed. You could get more sophisticated and store the cache files outside of the ${tomcat.output} directory to save history across "ant clean" invocations. In this case, you then need to make the build logic smarter to invalidate the cache files if any of the Checkstyle configuration files change. Let me know if you are interested in a patch to do this. ======================================================= oliver@oliver-laptop tomcat-trunk]$ ant -q validate [echo] Testing for /tmp/tomcat/checkstyle-5.1/checkstyle-all-5.1.jar [checkstyle] /home/oliver/play/tomcat-trunk/java/org/apache/catalina/tribes/group/ExtendedRpcCallback.java:21:8: Unused import - org.apache.catalina.tribes.ErrorHandler. BUILD FAILED /home/oliver/play/tomcat-trunk/build.xml:430: Got 1 errors and 0 warnings. Total time: 55 seconds [oliver@oliver-laptop tomcat-trunk]$ ant -q validate [echo] Testing for /tmp/tomcat/checkstyle-5.1/checkstyle-all-5.1.jar [checkstyle] /home/oliver/play/tomcat-trunk/java/org/apache/catalina/tribes/group/ExtendedRpcCallback.java:21:8: Unused import - org.apache.catalina.tribes.ErrorHandler. BUILD FAILED /home/oliver/play/tomcat-trunk/build.xml:430: Got 1 errors and 0 warnings. Total time: 15 seconds
Thanks for the patch. I applied a slightly modified version to 7.0.x which will ship with 7.0.9 onwards. I'm happy with a clean clearing out the cache - I think that makes sense.