Skip to content

Commit

Permalink
build.gradle: fix checkstyle plugin failure
Browse files Browse the repository at this point in the history
The `checkstyle` plugin of Gradle fails in JDK11.

The main reason is that, in JDK11, the `user.dir` cannot be reset by
Gradle [1]. So, checkstyle plugin is unable to locate the suppressions
file correctly. Also, the `FileContentHolder` module are deprecated[2].

Let's add ` config_loc` variable suggested by Gradle to solve the
problem.[1]

[1] gradle/gradle#8286
[2] checkstyle/checkstyle#5187
  • Loading branch information
fzdy1914 committed Mar 14, 2019
1 parent 148e301 commit 77827db
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,13 @@
</module>

<module name="SuppressionFilter">
<property name="file" value="config/checkstyle/suppressions.xml"/>
<property name="file" value="${config_loc}/suppressions.xml"/>
</module>


<!-- All Java AST specific tests live under TreeWalker module. -->
<module name="TreeWalker">

<!-- Required for SuppressionCommentFilter to work -->
<module name="FileContentsHolder"/>

<!-- Required to allow exceptions in code style -->
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
Expand Down

0 comments on commit 77827db

Please sign in to comment.