翻译项目请关注Github上的地址:

https://github.com/msdx/gradledoc

本文翻译所在分支:

https://github.com/msdx/gradledoc/tree/2.0 。

在线浏览地址:

http://gradledoc.qiniudn.com/2.0/userguide/userguide.html 。

另外,Android 手机用户可通过我写的一个程序浏览文档,带缓存功能的,目前0.6开发中版本兼容 Android 2.3以上系统,项目地址如下:

https://github.com/msdx/gradle-doc-apk

翻译不易,转载请注明本文在CSDN博客上的出处:

https://blog.csdn.net/maosidiaoxian/article/details/80106838

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

第二十二章. 标准的 Gradle 插件

Chapter 22. Standard Gradle plugins

Gradle 发行版中包含一些插件,如下列所示 
There are a number of plugins included in the Gradle distribution. These are listed below.

22.1. 语言插件

22.1. Language plugins

这些插件添加了让各种语言可以在 JVM 中被编译和执行的支持。
These plugins add support for various languages which can be compiled for and executed in the JVM.

表 22.1. 语言插件 - Table 22.1. Language plugins

插件 Id
Plugin Id
自动应用
Automatically applies
与什么一起使用
Works with
描述
Description
java java-base -

向一个项目添加 Java 编译,测试和捆绑的功能。它是许多其他 Gradle 插件的基础服务。另请参阅《第7章,Java 快速入门》。

Adds Java compilation, testing and bundling capabilities to a project. It serves as the basis for many of the other Gradle plugins. See also Chapter 7, Java Quickstart.

groovy javagroovy-base -

添加对 Groovy 项目构建的支持。另请参阅《第九章,Groovy 快速入门》。

Adds support for building Groovy projects. See also Chapter 9, Groovy Quickstart.

scala javascala-base -

添加对 Scala 项目构建的支持。

Adds support for building Scala projects.

antlr java -

添加对使用 Antlr 作为生成解析器的支持。

Adds support for generating parsers using Antlr.

22.2. 试验性的语言插件

22.2. Incubating language plugins

这些插件添加了对各种语言的支持:
These plugins add support for various languages:

表 22.2. 语言插件 - Table 22.2. Language plugins

插件 Id
Plugin Id
自动应用
Automatically applies
与什么一起使用
Works with
描述
Description
assembler - -

向项目添加本地汇编语言的功能。

Adds native assembly language capabilities to a project.

c - -

向项目添加 C语言代码编译的功能。

Adds C source compilation capabilities to a project.

cpp - -

向项目添加 C++ 代码编译的功能。

Adds C++ source compilation capabilities to a project.

objective-c - -

向项目中添加 Objective-C 代码编译的功能。

Adds Objective-C source compilation capabilities to a project.

objective-cpp - -

向项目中添加 Objective-C 代码编译的功能。

Adds Objective-C++ source compilation capabilities to a project.

windows-resources - -

添加对本地二进制文件包含 Windows 资源的支持。

Adds support for including Windows resources in native binaries.

22.3. 集成插件

22.3. Integration plugins

以下这些插件提供了一些与各种运行时技术的集成。
These plugins provide some integration with various runtime technologies.

表 22.3. 集成插件 - Table 22.3. Integration plugins

插件 Id
Plugin Id
自动应用
Automatically applies
与什么一起使用
Works with
描述
Description
application java -

添加了一些用于运行和捆绑 Java 项目的任务作为命令行应用程序。

Adds tasks for running and bundling a Java project as a command-line application.

ear - java

添加用于构建 J2EE 应用程序的支持。

Adds support for building J2EE applications.

jetty war -

在构建中将你的 web 应用程序部署到内嵌的 Jetty web 容器中。另请参阅《第十章,Web 应用程序快速入门》。

Deploys your web application to a Jetty web container embedded in the build. See also Chapter 10, Web Application Quickstart.

maven - javawar

添加将项目发布到 Maven 仓库的支持。

Adds support for publishing artifacts to Maven repositories.

osgi java-base java

添加构建 OSGi 包的支持。

Adds support for building OSGi bundles.

war java -

添加装配 web 应用程序的 WAR 文件的支持。另请参阅《第十章,Web 应用程序快速入门》。

Adds support for assembling web application WAR files. See also Chapter 10, Web Application Quickstart.

22.4. 试验性的集成插件

22.4. Incubating integration plugins

以下这些插件提供了一些与各种运行时技术的集成。
These plugins provide some integration with various runtime technologies.

表 22.4. 试验性的集成插件 - Table 22.4. Incubating integration plugins

插件 Id
Plugin Id
自动应用
Automatically applies
与什么一起使用
Works with
描述
Description
distribution - -

添加构建 ZIP 和 TAR 分发包的支持。

Adds support for building ZIP and TAR distributions.

java-library-distribution javadistribution -

添加构建 Java 库的 ZIP 和 TAR 分发包的支持。

Adds support for building ZIP and TAR distributions for a Java library.

ivy-publish - javawar

这个插件提供了一个新的 DSL,用于支持发布工件到 Ivy 存储库,它改进了现有的 DSL。

This plugin provides a new DSL to support publishing artifacts to Ivy repositories, which improves on the existing DSL.

maven-publish - javawar

这个插件提供了一个新的 DSL,用于支持发布工件到 Maven 存储库,它改进了现有的 DSL。

This plugin provides a new DSL to support publishing artifacts to Maven repositories, which improves on the existing DSL.

22.5. 软件开发插件

22.5. Software development plugins

这些插件为你的软件开发过程提供帮助。
These plugins provide help with your software development process.

表 22.5. 软件开发插件 - Table 22.5. Software development plugins

插件 Id
Plugin Id
自动应用
Automatically applies
与什么一起使用
Works with
描述
Description
announce - -

将消息发布到你所喜欢的平台,如 Twitter 或 Growl。

Publish messages to your favourite platforms, such as Twitter or Growl.

build-announcements announce -

在构建的生命周期中,把本地公告中有关你感兴趣的事件发送到你的桌面。

Sends local announcements to your desktop about interesting events in the build lifecycle.

checkstyle java-base -

对你的项目的 Java 源文件使用 Checkstyle 执行质量检查并生成报告。

Performs quality checks on your project's Java source files using Checkstyle and generates reports from these checks.

codenarc groovy-base -

对你的项目的 Groovy 源文件使用 CodeNarc 执行质量检查并生成报告。

Performs quality checks on your project's Groovy source files using CodeNarc and generates reports from these checks.

eclipse - java,groovyscala

生成 Eclipse IDE 所用到的文件,从而使项目能够导入到 Eclipse。另请参阅《第七章,Java 快速入门》。

Generates files that are used by Eclipse IDE, thus making it possible to import the project into Eclipse. See also Chapter 7, Java Quickstart.

eclipse-wtp - earwar

与 eclipse 插件一样,但它还生成 eclipse WTP(Web 工具平台)的配置文件。你的 war/ear 项目在导入 eclipse 后,应配置为能在 WTP 中使用。另请参阅《第七章,Java 快速入门》。

Does the same as the eclipse plugin plus generates eclipse WTP (Web Tools Platform) configuration files. After importing to eclipse your war/ear projects should be configured to work with WTP. See also Chapter 7, Java Quickstart.

findbugs java-base -

对你的项目的 Java 源文件使用 FindBugs 执行质量检查并生成报告。

Performs quality checks on your project's Java source files using FindBugs and generates reports from these checks.

idea - java

生成 Intellij IDEA IDE 所用到的文件,从而使项目能够导入到 IDEA。

Generates files that are used by Intellij IDEA IDE, thus making it possible to import the project into IDEA.

jdepend java-base -

使用 JDepend 对你的项目的源文件执行质量检查并生成报告。

Performs quality checks on your project's source files using JDepend and generates reports from these checks.

pmd 
pmd
java-base -

对你的项目的 Java 源文件使用 PMD 执行质量检查并生成报告。

Performs quality checks on your project's Java source files using PMD and generates reports from these checks.

project-report reporting-base -

生成包括了关于你的 Gradle 构建的有用信息的报告。

Generates reports containing useful information about your Gradle build.

signing base -

添加对生成的文件或工件进行数字签名的功能。

Adds the ability to digitally sign built files and artifacts.

sonar - java-base,java,jacoco
java-base, java, jacoco

提供对 Sonar 代码质量平台的集成。已经被 sonar-runner 插件取代。

Provides integration with the Sonar code quality platform. Superceeded by the sonar-runner plugin.

22.6. 试验性的软件开发插件

22.6. Incubating software development plugins

这些插件为你的软件开发过程提供帮助。
These plugins provide help with your software development process.

表 22.6. 软件开发插件 - Table 22.6. Software development plugins

插件 Id
Plugin Id
自动应用
Automatically applies
与什么一起使用
Works with
描述
Description
build-dashboard reporting-base -

生成构建仪表板报告。

Generates build dashboard report.

build-init wrapper -

添加用于初始化一个新 Gradle 构建的支持,以及处理从 Maven 构建到 Gradle 构建的转换。

Adds support for initializing a new Gradle build. Handles converting a Maven build to a Gradle build.

cunit - -

添加用于运行 CUnit 测试的支持。

Adds support for running CUnit tests.

jacoco reporting-base java

提供对 Java 的JaCoCo 代码覆盖率库的集成。

Provides integration with the JaCoCo code coverage library for Java.

sonar-runner - java-base,java,jacoco
java-base, java, jacoco

取代 sonar 插件,提供对 Sonar 代码质量平台的集成。

Provides integration with the Sonar code quality platform. Supersedes the sonar plugin.

visual-studio - 本机语言插件
native language plugins

添加对 Visual Studio 的集成。

Adds integration with Visual Studio.

wrapper - -

添加用于生成 Gradle wrapper 文件的 Wrapper 任务。

Adds a Wrapper task for generating Gradle wrapper files.

22.7. 基本插件

22.7. Base plugins

这些插件构成了基本构建块,其他插件都由此组装而来。它们可供您在构建文件中使用,并在此处完整列出。但是请注意,它们还没有被视为 Gradle 公共 API 的一部分。因此,这些插件都不在用户指南中记录。你可以参考它们的 API 文档来了解更多关于它们的信息。 
These plugins form the basic building blocks which the other plugins are assembled from. They are available for you to use in your build files, and are listed here for completeness. However, be aware that they are not yet considered part of Gradle's public API. As such, these plugins are not documented in the user guide. You might refer to their API documentation to learn more about them.

表 22.7. 基本插件 - Table 22.7. Base plugins

插件 Id
Plugin Id
描述
Description
base

添加标准的生命周期任务,并为归档任务默认进行合理的配置:

  • 添加构建 ConfigurationName 的任务,这些任务组装了属于指定配置的工件。
  • 添加上传 ConfigurationName 的任务,这些任务组装并上传属于指定配置的工件。
  • 为所有归档任务(比如从 AbstractArchiveTask 中继承的任务)配置合理的默认值。例如,以下类型的归档任务:JarTarZip。确切地说,是对这些归档任务的 destinationDirbaseName 和 version 属性预先配置了默认值。这是非常有用的,因为它可以推动项目之间的一致性,以及关于构建完成后档案的命名规范及其位置的一致性。

Adds the standard lifecycle tasks and configures reasonable defaults for the archive tasks:

  • adds build ConfigurationName tasks. Those tasks assemble the artifacts belonging to the specified configuration.
  • adds upload ConfigurationName tasks. Those tasks assemble and upload the artifacts belonging to the specified configuration.
  • configures reasonable default values for all archive tasks (e.g. tasks that inherit from AbstractArchiveTask). For example, the archive tasks are tasks of types: JarTarZip. Specifically, destinationDirbaseName and version properties of the archive tasks are preconfigured with defaults. This is extremely useful because it drives consistency across projects; the consistency regarding naming conventions of archives and their location after the build completed.
java-base

对项目添加源集的概念。它不会添加任何特定的源集。

Adds the source sets concept to the project. Does not add any particular source sets.

groovy-base

向项目添加 Groovy 源集的概念。

Adds the Groovy source sets concept to the project.

scala-base

向项目添加 Scala 源集的概念。

Adds the Scala source sets concept to the project.

reporting-base

将一些共享的约定属性添加到项目中,它们与报告的生成有关。

Adds some shared convention properties to the project, relating to report generation.

22.8. 第三方插件

22.8. Third party plugins

你可以在维基上找到外部插件列表。 
You can find a list of external plugins on the wiki.

Gradle 2.0 用户指南翻译——第二十二章. 标准的 Gradle 插件相关推荐

  1. Gradle 2.0 用户指南翻译——第五十一章. 发布工件

    本文禁止w3cschool转载! 翻译项目请关注Github上的地址:https://github.com/msdx/gradledoc . 本文翻译所在分支:https://github.com/m ...

  2. Gradle 2.0 用户指南翻译——第五十六章. 多项目构建

    本文禁止w3cschool转载! 翻译项目请关注Github上的地址:https://github.com/msdx/gradledoc . 本文翻译所在分支:https://github.com/m ...

  3. Gradle2.0用户指南翻译——第二章. 概述

    翻译项目请关注Github上的地址: https://github.com/msdx/gradledoc 本文翻译所在分支: https://github.com/msdx/gradledoc/tre ...

  4. Gradle 2.0 用户指南翻译——第五十章. 依赖管理

    本文禁止w3cschool转载! 翻译项目请关注Github上的地址:https://github.com/msdx/gradledoc . 本文翻译所在分支:https://github.com/m ...

  5. 【正点原子Linux连载】第二十二章 AP3216C 摘自【正点原子】I.MX6U嵌入式Qt开发指南V1.0.2

    1)实验平台:正点原子阿尔法Linux开发板 2)平台购买地址:https://item.taobao.com/item.htm?id=603672744434 3)全套实验源码+手册+视频下载地址: ...

  6. 【正点原子FPGA连载】 第二十二章 HDMI方块移动实验 -摘自【正点原子】领航者ZYNQ之FPGA开发指南_V2.0

    1)实验平台:正点原子领航者ZYNQ开发板 2)平台购买地址:https://item.taobao.com/item.htm?&id=606160108761 3)全套实验源码+手册+视频下 ...

  7. 【正点原子MP157连载】第二十二章 新字符设备驱动实验-摘自【正点原子】STM32MP1嵌入式Linux驱动开发指南V1.7

    1)实验平台:正点原子STM32MP157开发板 2)购买链接:https://item.taobao.com/item.htm?&id=629270721801 3)全套实验源码+手册+视频 ...

  8. stm32l0的停止模式怎么唤醒_探索者 STM32F407 开发板资料连载第二十二章 待机唤醒实验

    1)实验平台:alientek 阿波罗 STM32F767 开发板 2)摘自<STM32F7 开发指南(HAL 库版)>关注官方微信号公众号,获取更多资料:正点原子 第二十二章 待机唤醒实 ...

  9. stm32 文件系统dma大小_「正点原子NANO STM32F103开发板资料连载」第二十二章 DMA 实验...

    1)实验平台:[正点原子] NANO STM32F103 开发板 2)摘自<正点原子STM32 F1 开发指南(NANO 板-HAL 库版)>关注官方微信号公众号,获取更多资料:正点原子 ...

最新文章

  1. Apache - AH00526 – server.crt
  2. Linux下ll命令与ls -l
  3. windows渗透大全
  4. Taro+react开发(99):问答模块06实现加减
  5. 修正线性单元(Rectified linear unit,ReLU)
  6. Programming 2D Games 读书笔记(第二章)
  7. 李飞飞:一站式全链路数据管理与服务成为产业布局重点
  8. 如果程序员面试时,大家都说真话会怎么样?画面过于真实....
  9. 你还没听过 CynosDB 吗?不来这场数据库技术沙龙就要 OUT 了!
  10. 【影像学基本知识】Slice gap and slice thickness and cross-talk
  11. Android的JNI【实战教程】5⃣️---Android Studio 2.2 以上 NDK开发
  12. 用java实现学生成绩管理系统(附有详细代码)
  13. 网页鼠标指针源码 小樱茉莉Q版鼠标指针
  14. python残差神经网络_残差神经网络
  15. js判断手机是否安装了某个APP,如果安装了就打开,没安装就下载
  16. Python:datetime时间UTC时间转东八区
  17. 获取Excel中sheet页的name,并对不同sheet 页进行处理
  18. redhat 7 手册
  19. iOS10后友盟推送报错,在iOS9设备上获取到device_token但接不到推送消息,iOS10上报错code=3000
  20. Remote Sensing投稿经历

热门文章

  1. 亲测成功解决Typora旧版本无法使用提示需要更新的问题
  2. iOS计步器功能实现之CoreMotion(一)
  3. G - Cutie Pie-(暑假组队赛4-题意不懂-格式不会控制)
  4. 计算机视觉(1)关于cvThreshold二值化函数
  5. 一份热乎乎的滴滴前端面经
  6. 【微信小程序控制硬件 第14篇】分享一下我在微信公众号和小程序上实现的几个颜色采集器,轻松集成到您项目实现调光。
  7. NILM论文笔记:R.Reddy, et al: A feature fusion technique for improved NILM
  8. 微信小程序之跳转wx.switchTab的使用
  9. 个股期权系统软件月租、年租模式与注意事项
  10. 2023年了,IT行业真的吃香吗?