Gradle 1.12 User Guide translation-Chapter 2. CodeNarc plug-in, gradlecodenarc

Source: Internet
Author: User

Gradle 1.12 User Guide translation-Chapter 2. CodeNarc plug-in, gradlecodenarc

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/45640323

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. CodeNarc plug-in

The CodeNarc plug-in uses CodeNarc to perform quality checks on the Groovy source files of the project and generate reports.

30.1. Usage

To use the CodeNarc plug-in, include the following statement in the build script:

Example 30.1. Use the CodeNarc plug-in

build.gradle

apply plugin: 'codenarc'

This plug-in adds a large number of quality check tasks to your project. You can rungradle checkRun the check.

30.2. Task

The CodeNarc plug-in adds the following tasks to the project:

Table 30.1. CodeNarc plug-in-task

Task Name Dependent on Type Description
codenarcMain - codenarc Run CodeNarc for the Groovy source file.
codenarcTest - codenarc Run CodeNarc for the Groovy source file.
codenarcSourceSet - codenarc Run CodeNarc for the Groovy source file of the given source set.

The CodeNarc plug-in adds the following dependencies to the tasks added to the Groovy plug-in.

Table 30.2. CodeNarc plug-in-attached task dependencies

Task Name Dependent on
check All CodeNarc tasks, includingcodenarcMainAndcodenarcTest.
30.3. Project Layout

The CodeNarc plug-in is expected to have the following project layout:

Table 30.3. CodeNarc plug-in-Project Layout

File Meaning
config/codenarc/codenarc.xml CodeNarc configuration file
30.4. Dependency Management

The CodeNarc plug-in adds the following dependency configurations:

Table 30.4. CodeNarc plug-in-dependency Configuration

Name Meaning
codenarc CodeNarc library used
30.5. Configuration

SeeCodeNarcExtension.


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.