本文禁止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/95245865

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

第四十九章. 构建仪表盘插件

Chapter 49. The Build Dashboard Plugin

构建仪表盘插件目前是一个试验性插件。注意,在以后的 Gradle 版本中,其 DSL 和其他配置可能会有变化。 
The build dashboard plugin is currently incubating. Please be aware that the DSL and other configuration may change in later Gradle versions.

Build Dashboard 插件可以用于生成单个 HTML 仪表盘,该仪表盘提供对构建所生成的所有报告的单点访问。 
The Build Dashboard plugin can be used to generate a single HTML dashboard that provides a single point of access to all of the reports generated by a build.

49.1. 用法

49.1. Usage

要使用 Build Dashboard 插件,请在构建脚本中包含以下内容:
To use the Build Dashboard plugin, include the following in your build script:

示例 49.1 使用 Build Dashboard 插件 - Example 49.1. Using the Build Dashboard plugin

build.gradle

apply plugin: 'build-dashboard'

应用插件会将 buildDashboard 任务添加到项目。 此任务将聚合了在构建中从 所有项目 实现了 报告 接口的所有任务的报告。 它通常仅应用于根项目。 
Applying the plugin adds the buildDashboard task to your project. The task aggregates the reports for all tasks that implement the Reporting interface from all projects in the build. It is typically only applied to the root project.

buildDashboard 任务不依赖于任何其他任务。 它只聚合在构建运行过程中独立执行的报告任务。 要生成构建仪表盘,只需在要执行的任务列表中包含 buildDashboard 任务。 例如,gradle buildDashboard build 将为 build 任务所依赖的所有报告任务生成仪表盘。 
The buildDashboard task does not depend on any other tasks. It will only aggregate the reporting tasks that are independently being executed as part of the build run. To generate the build dashboard, simply include the buildDashboard task in the list of tasks to execute. For example, gradle buildDashboard build will generate a dashboard for all of the reporting tasks that are dependents of the build task.

49.2. 任务

49.2. Tasks

Build Dashboard 插件向项目中添加以下任务:
The Build Dashboard plugin adds the following task to the project:

表 49.1. Build Dashboard 插件——任务 - Table 49.1. Build Dashboard plugin - tasks

任务名称
Task name
依赖于
Depends on
类型
Type
描述
Description
buildDashboard-GenerateBuildDashboard生成构建仪表板报告。
Generates build dashboard report.

49.3. 项目布局

49.3. Project layout

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

49.4. 依赖管理

49.4. Dependency management

Build Dashboard 插件没有定义任何的依赖配置。
The Build Dashboard plugin does not define any dependency configurations.

49.5. 配置

49.5. Configuration

你可以通过 ReportingExtension 修改构建仪表盘插件生成内容的位置。
You can influence the location of build dashboard plugin generation via ReportingExtension.

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐