gpt4 book ai didi

eclipse - 在 Gradle 和 Eclipse 的 Checkstyle 插件中使用 ${samedir}

转载 作者:行者123 更新时间:2023-12-03 03:40:37 25 4
gpt4 key购买 nike

我使用 SuppressionFilter在我的检查样式配置中。文件 suppression.xml 的路径是相对于 checkstyle-configuration 给出的,使用 ${samedir} ( http://eclipse-cs.sourceforge.net/#!/properties )。原因:我将 eclipse 配置为使用远程 checkstyle-configuration:

<module name="SuppressionFilter">
<property name="file" value="${samedir}suppress.xml"/>
</module>

我的 Gradle 构建脚本使用相同的 checkstyle-configuration。不幸的是,gradle 的 checkstyle-plugin 似乎无法解析变量 ${samedir}。

有没有办法为 Eclipse 和 Gradle 使用相同的配置文件?我真的不想维护两个文件或在 Checkstyle 配置中使用绝对路径。

最佳答案

您可以使用 configProperties 在 Gradle 构建脚本中手动设置“samedir”变量。

checkstyle {
configFile = file("${rootDir}/build_dependencies/my_checks.xml")
configProperties = [samedir: "${rootDir}/build_dependencies"]
}

来源:改编自Maven version

关于eclipse - 在 Gradle 和 Eclipse 的 Checkstyle 插件中使用 ${samedir},我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29602867/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com