Gradle 2.0 用户指南翻译——第四十一章. 项目报告插件

本文禁止w3cschool转载!

翻译项目请关注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.1版本兼容 Android 4.0.3以上系统,项目地址如下:
https://github.com/msdx/gradle-doc-apk

翻译不易,本文采用 CC BY-NC-SA 4.0 许可协议,转载请务必署名及注明本文在CSDN博客上的出处:

https://coder.blog.csdn.net/article/details/90632153

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

 

第四十一章. 项目报告插件

Chapter 41. The Project Report Plugin

项目报告插件向项目添加了一些任务,用于生成包含有关构建的有用信息的报告。这些任务生成的内容,与由gradle tasks, gradle dependenciesgradle properties 触发的命令行报告完全相同(见第11.6节,《获取有关构建的信息》)。与命令行报告相比,报告插件会将报告生成到文件中。这里还有一个聚合任务,它依赖于该插件添加的所有报告任务。 
The Project report plugin adds some tasks to your project which generate reports containing useful information about your build. Those tasks generate exactly the same content as the command line reports triggered by gradle tasksgradle dependencies and gradle properties (see Section 11.6, “Obtaining information about your build”). In contrast to the command line reports, the report plugin generates the reports into a file. There is also an aggregating task that depends on all report tasks added by the plugin.

我们计划在未来发布的版本中,向现有的报告添加更多的内容,并创建其他报告。 
We plan to add much more to the existing reports and create additional ones in future releases of Gradle.

41.1. 用法

41.1. Usage

要使用项目报告插件,请在构建脚本中包含:
To use the Project report plugin, include in your build script:

apply plugin: 'project-report'

41.2. 任务

41.2. Tasks

项目报告插件定义了以下任务:
The project report plugin defines the following tasks:

表 41.1. 项目报告插件——任务 - Table 41.1. Project report plugin - tasks

任务名称
Task name
依赖于
Depends on
类型
Type
描述
Description
dependencyReport-DependencyReportTask生成项目依赖项报告。
Generates the project dependency report.
htmlDependencyReport-HtmlDependencyReportTask为项目或项目集生成 HTML 依赖和依赖洞察报告。
Generates an HTML dependency and dependency insight report for the project or a set of projects.
propertyReport-PropertyReportTask生成项目属性报告。
Generates the project property report.
taskReport-TaskReportTask生成项目任务报告。
Generates the project task report.
projectReportdependencyReportpropertyReporttaskReporthtmlDependencyReportTask生成所有项目报告。
Generates all project reports.

41.3. 项目布局

41.3. Project layout

项目报告插件不需要任何特定的项目布局。
The project report plugin does not require any particular project layout.

41.4. 依赖管理

41.4. Dependency management

项目报告插件没有定义任何的依赖配置。
The project report plugin does not define any dependency configurations.

41.5. 约定属性

41.5. Convention properties

项目报告定义了以下约定属性:
The project report defines the following convention properties:

表 41.2. 项目报告插件——约定属性 - Table 41.2. Project report plugin - convention properties

属性名称
Property name
类型
Type
默认值
Default value
描述
Description
reportsDirNameStringreports相对于构建目录,生成报告的目录的名称。 
The name of the directory to generate reports into, relative to the build directory.
reportsDirFile (只读) 
File (read-only)
buildDir/reportsDirName要生成报告的目录。 
The directory to generate reports into.
projectsSet<Project>一个单元素的集合,元素为应用了该插件的项目。 
A one element set with the project the plugin was applied to.
要生成报告的所有项目。 
The projects to generate the reports for.
projectReportDirNameStringproject生成项目报告的目录名称,它是相对于报告目录的相对路径。 
The name of the directory to generate the project report into, relative to the reports directory.
projectReportDirFile (只读) 
File (read-only)
reportsDir/projectReportDirName生成项目报告的目录。 
The directory to generate the project report into.

这些约定属性由一个ProjectReportsPluginConvention 类型的约定对象提供。
These convention properties are provided by a convention object of type ProjectReportsPluginConvention.

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值