0
我正在尝试将checkstyle添加到我的build.gradle
。Checkdle with Gradle
Checkstyle模板是commons-math3
,可以从here访问。
但是该文件使用${checkstyle.header.file}
来检查每个源文件顶部的许可证声明。
<!-- Verify that EVERY source file has the appropriate license -->
<module name="Header">
<property name="headerFile" value="${checkstyle.header.file}"/>
</module>
所以我添加下面的语句在我build.gradle
:
checkstyle {
configFile = rootProject.file("commons-math-checkstyle.xml")
headerFile = rootProject.file("license-header.txt")
toolVersion = '7.8.1'
}
,但它使一个错误。
从build.gradle
卸下headerFile = rootProject.file("license-header.txt")
,使在CheckStyle的xml文件Header
模块通过<!--
和-->
(即禁止)使CheckStyle的效果很好缠绕。
如何在我的build.gradle
文件中声明checkstyle.header.file
?