简体   繁体   中英

Using checkstyle with Ant during an automated eclipse build

For the last months I've been slowly improved the Eclipse automated PDE build process for our application.

The first thing I tried was automating the test cases. The next step was some scripting code to generate an installer automatically, for both linux and windows .

Now I want to add some static code analysis reports to the process. In my company we use Checkstyle for this purpose.

I understand that it is possible to automate the Checkstyle plugin in such a way that it can generate a report from the build process. It would be useful to distribute the checkstyle results together with the unit test report, which are being generated already.

Does anyone has some good example of how this can be achieved in a relatively painless way?

There's a Checkstyle Ant Task defined in the Checkstyle JAR file. Use it as follows:

<taskdef resource="checkstyletask.properties" classpath="/path/to/checkstyle-all-4.4.jar"/> 

<checkstyle config="/path/to/my/checkstyle_config.xml">
  <fileset dir="src/checkstyle" includes="**/*.java"/>
</checkstyle>

You might want to look at a CI server like Hudson , which you can use to automate your builds and with which you can easily integrate a number of plugins for FindBugs , CheckStyle, etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM