Gradle 1.12 User Guide translation-Chapter 29th. Checkstyle plug-in, gradlecheckstyle

Source: Internet
Author: User
Tags checkstyle

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 checkRun 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 sourceSetClasses 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, includingcheckstyleMainAndcheckstyleTest.
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.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.