Android in Hudson (6) 加入checkstyle分析
checkstyle跟前面的findbugs與PMD一樣,與Android預設的行為沒有關係,一樣只要按照其官方文件的寫法加入project的build.xml中即可
<!-- CheckStyle -->
<property name="checkstyle.home" value="path to your checkstyle" />
<taskdef resource="checkstyletask.properties" classpath="${checkstyle.home}/checkstyle-5.3-all.jar"/>
<target name="checkstyle" description="Generates a report of code convention violations.">
<checkstyle config="${checkstyle.home}/sun_checks.xml"
failureProperty="checkstyle.failure"
failOnViolation="false">
<formatter type="xml" tofile="checkstyle_report.xml"/>
<fileset dir="src" includes="**/*.java"/>
</checkstyle>
</target>
參考文件:http://checkstyle.sourceforge.net/anttask.html
注意:target定義需在<setup />後,taskdef與property等需在<setup />前