第四十九章. Build Dashboard 插件

Chapter 49. The Build Dashboard Plugin

Build Dashboard 插件是目前是孵化中状态。请务必注意,在以后的 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 dashboard,提供对由构建生成的所有报告的单点访问。
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 任务到你的 project 中。该任务为在 all projects 中实现了 Reporting 接口的所有任务聚合了报告。它通常只应用于根项目。
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 任务不依赖于任何其他任务。它只聚合作为构建的一部分正在独立运行的报告任务。如果要生成 build dashboard,只需在要执行的任务列表中包含 buildDashboard 任务。例如, gradle buildDashboard build 将为 build任务 所依赖的所有报告任务生成一个 dashboard。
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 生成 build dashboard 报告。
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 修改 build dashboard 插件生成内容的位置。
You can influence the location of build dashboard plugin generation via ReportingExtension.