Gradle 2.0 用户指南翻译——第三十一章. FindBugs 插件

这篇博客介绍了Gradle 2.0中FindBugs插件的使用,该插件利用FindBugs工具对Java源文件执行质量检查并生成报告。内容涵盖插件的用法、任务、依赖管理和配置。

翻译项目请关注Github上的地址:
https://github.com/msdx/gradledoc
本文翻译所在分支:
https://github.com/msdx/gradledoc/tree/2.0 。
在线浏览地址:
http://gradledoc.githang.com/2.0/userguide/userguide.html 。
另外,Android 手机用户可通过我写的一个程序浏览文档,带缓存功能的,目前0.6开发中版本兼容 Android 2.3以上系统,项目地址如下:
https://github.com/msdx/gradle-doc-apk
翻译不易,转载请注明本文在优快云博客上的出处:

https://blog.youkuaiyun.com/maosidiaoxian/article/details/86590723

关于我对Gradle的翻译,以Github上的项目及http://gradledoc.githang.com 上的文档为准。如发现翻译有误的地方,将首先在以上两个地方更新。因时间精力问题,博客中发表的译文基本不会同步修改。

第三十一章. FindBugs 插件

Chapter 31. The FindBugs Plugin

FindBugs 插件使用 FindBugs 对项目的 Java 源文件执行质量检查,并从这些检查中生成报告。 
The FindBugs plugin performs quality checks on your project's Java source files using FindBugs and generates reports from these checks.

31.1. 用法

31.1. Usage

要使用 FindBugs 插件,请在构建脚本中包含:
To use the FindBugs plugin, include in your build script:

示例 31.1. 使用 FindBugs 插件 - Example 31.1. Using the FindBugs plugin

build.gradle

apply plugin: 'findbugs'

该插件向项目添加了许多执行质量检查的任务。你可以通过运行 gradle check 来执行这些检查。
The plugin adds a number of tasks to the project that perform the quality checks. You can execute the checks by running gradle check.

31.2. 任务

31.2. Tasks

FindBugs 插件将以下任务添加到项目中:
The FindBugs plugin adds the following tasks to the project:

表 31.1. FindBugs 插件——任务 - Table 31.1. FindBugs plugin - tasks

任务名称
Task name
依赖于
Depends on
类型
Type
描述
Description
findbugsMainclassesFindBugs针对Java 的生产源文件运行 FindBugs。
Runs FindBugs against the production Java source files.
findbugsTesttestClassesFindBugs针对 Java 测试源文件运行 FindBugs。
Runs FindBugs against the test Java source files.
findbugsSourceSetsourceSetClassesFindBugs针对给定源集的 Java 源文件运行 FindBugs。
Runs FindBugs against the given source set's Java source files.

FindBugs 插件向 Java 插件所定义的任务添加了以下依赖。
The FindBugs plugin adds the following dependencies to tasks defined by the Java plugin.

表 31.2. FindBugs 插件——附加的任务依赖 - Table 31.2. FindBugs plugin - additional task dependencies

任务名称
Task name
依赖于
Depends on
check所有 FindBugs 任务,包括 findbugsMain 和 findbugsTest
All FindBugs tasks, including findbugsMain and findbugsTest.

31.3. 依赖管理

31.3. Dependency management

FindBugs 插件添加了下列的依赖配置:
The FindBugs plugin adds the following dependency configurations:

表31.3. FindBugs 插件——依赖配置 - Table 31.3. FindBugs plugin - dependency configurations

名称
Name
意义
Meaning
findbugs要使用的 FindBugs 库
The FindBugs libraries to use

31.4. 配置

31.4. Configuration

请参阅 FindBugsExtension
See FindBugsExtension.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值