Gradle 1.12 User Guide translation-Chapter 29th. Checkstyle plug-in, gradlecheckstyle
For translation of other chapters, see:
Http://blog.csdn.net/column/details/gradle-translation.html
Please pay attention to the address on Github for translation projects:
Https://github.com/msdx/gradledoc/tree/1.12.
To view the bilingual documents directly, visit:
Http://gradledoc.qiniudn.com/1.12/userguide/userguide.html.
In addition, Android mobile users can browse documents through a program I have written, with the cache function. Currently, Android 0.2 is compatible with Android 2.1 and later versions (not tested in versions 5.0 and later). The address is as follows:
Http://www.wandoujia.com/apps/com.githang.gradledoc
It is not easy to translate. For more information, see the source of this article on the CSDN blog:
Http://blog.csdn.net/maosidiaoxian/article/details/45575131
For my translations of Gradle, refer to the project on Github and documents on the http://gradledoc.qiniudn.com. If any translation error is found, it will be updated in the above two places first. Due to time and energy problems, the translations published in the blog are basically not modified simultaneously.
Chapter 2. Checkstyle plug-in
The Checkstyle plugin uses Checkstyle to perform a quality check on the Java source files of your project and generate a report from the check results.
29.1. Usage
To use the Checkstyle plug-in, include the following statements in the build script:
Example 29.1. Use the Checkstyle plug-in
build.gradle
apply plugin: 'checkstyle'
This plug-in adds a large number of quality check tasks to your project. You can rungradle check
Run the check.
29.2. Tasks
The Checkstyle plug-in adds the following tasks to the project:
Table 29.1. Checkstyle plug-in-tasks
Task Name |
Dependent on |
Type |
Description |
checkstyleMain |
classes |
checkstyle |
Run Checkstyle for the production Java source file. |
checkstyleTest |
testClasses |
checkstyle |
Run Checkstyle for the test Java source file. |
checkstyleSourceSet |
sourceSet Classes
|
checkstyle |
Run Checkstyle for the Java source file of the source set. |
The Checkstyle plug-in adds the following dependencies to the Java Plug-in's tasks.
Table 29.2. Checkstyle plug-in-additional task dependencies
Task Name |
Dependent on |
check |
All Checkstyle tasks, includingcheckstyleMain AndcheckstyleTest . |
29.3. Project Layout
The Checkstyle plug-in is expected to have the following project layout:
Table 29.3. Checkstyle plug-in-Project Layout
File |
Meaning |
config/checkstyle/checkstyle.xml |
Checkstyle configuration file |
29.4. Dependency Management
The Checkstyle plug-in adds the following dependency configurations:
Table 29.4. Checkstyle plug-in-dependency Configuration
Name |
Meaning |
checkstyle |
Checkstyle library used |
29.5. Configuration
SeeCheckstyleExtension
.