第四十三章. 构建公告插件

Chapter 43. The Build Announcements Plugin

构建公告插件目前仍然是孵化状态。请务必注意,在以后的 Gradle 版本中,相关的 DSL 和其他配置可能会有所改变。
The build announcements plugin is currently incubating. Please be aware that the DSL and other configuration may change in later Gradle versions.

构建公告插件使用 announce 插件发送构建过程中一些重要事件上的本地公告。
The build announcements plugin uses the announce plugin to send local announcements on important events in the build.

43.1. 用法

43.1. Usage

要使用构建公告插件,请在生成脚本中包括:
To use the build announcements plugin, include in your build script:

示例 43.1. 使用构建公告插件 - Example 43.1. Using the build announcements plugin

build.gradle

apply plugin: 'build-announcements'

就是这样。如果您想要调整公告的位置,你可以配置 announce 插件来更改本地的announcer。
That's it. If you want to tweak where the announcements go, you can configure the announce plugin to change the local announcer.

你还可以从一个 init 脚本应用这个插件:
You can also apply the plugin from an init script:

示例 43.2. 在 init 脚本中使用构建通知插件 - Example 43.2. Using the build announcements plugin from an init script

init.gradle

rootProject {
    apply plugin: 'build-announcements'
}