第22章 Standard Gradle plugins 標(biāo)準(zhǔn) Gradle 插件

2018-02-24 15:56 更新

Gradle 發(fā)布包包含了很多插件,如下:

22.1. Language plugins 語言類插件

這些插件添加各種語言可以被編譯為在JVM中執(zhí)行的支持。

Table 22.1. Language plugins

Plugin Id Automatically applies Works with Description
java java-base - 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 java,groovy-base - Adds support for building Groovy projects. See also?Chapter?9,?Groovy Quickstart.
scala java,scala-base - Adds support for building Scala projects.
antlr java - Adds support for generating parsers using?Antlr.

22.2. Incubating language plugins 孵化中的語言插件

Table 22.2. Language plugins

Plugin Id Automatically applies Works with Description
assembler - - Adds native assembly language capabilities to a project.
c - - Adds C source compilation capabilities to a project.
cpp - - Adds C++ source compilation capabilities to a project.
objective-c - - Adds Objective-C source compilation capabilities to a project.
objective-cpp - - Adds Objective-C++ source compilation capabilities to a project.
windows-resources - - Adds support for including Windows resources in native binaries.

22.3. Integration plugins 集成插件

這些插件提供一些集成各種運(yùn)行技術(shù)。

Table 22.3. Integration plugins

Plugin Id Automatically applies Works with Description
application java - Adds tasks for running and bundling a Java project as a command-line application.
ear - java Adds support for building J2EE applications.
jetty war - Deploys your web application to a Jetty web container embedded in the build. See also?Chapter?10,?Web Application Quickstart.
maven - java,war Adds support for publishing artifacts to Maven repositories.
osgi java-base java Adds support for building OSGi bundles.
war java - Adds support for assembling web application WAR files. See alsoChapter?10,?Web Application Quickstart.

22.4. Incubating integration plugins 孵化中的集成插件

這些插件提供一些集成各種運(yùn)行技術(shù)。

Table 22.4. Incubating integration plugins

Plugin Id Automatically applies Works with Description
distribution - - Adds support for building ZIP and TAR distributions.
java-library-distribution java,distribution - Adds support for building ZIP and TAR distributions for a Java library.
ivy-publish - java,war This plugin provides a new DSL to support publishing artifacts to Ivy repositories, which improves on the existing DSL.
maven-publish - java,war This plugin provides a new DSL to support publishing artifacts to Maven repositories, which improves on the existing DSL.

22.5. Software development plugins 軟件開發(fā)插件

Table 22.5. Software development plugins

Plugin Id Automatically applies Works with Description
announce - - 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 - Performs quality checks on your project's Java source files using?Checkstyle?and generates reports from these checks.
codenarc groovy-base - Performs quality checks on your project's Groovy source files using?CodeNarc?and generates reports from these checks.
eclipse - java,groovy,scala 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 - ear,?war 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 - Performs quality checks on your project's Java source files using?FindBugs?and generates reports from these checks.
idea - java Generates files that are used by?Intellij IDEA IDE, thus making it possible to import the project into IDEA.
jdepend java-base - Performs quality checks on your project's source files usingJDepend?and generates reports from these checks.
pmd java-base - Performs quality checks on your project's Java source files using?PMD?and generates reports from these checks.
project-report reporting-base - 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 Provides integration with the?Sonar?code quality platform. Superceeded by the?sonar-runner?plugin.

22.6. Incubating software development plugins 孵化中的軟件開發(fā)插件

Table 22.6. Software development plugins

Plugin Id Automatically applies Works with Description
build-dashboard reporting-base - Generates build dashboard report.
build-init wrapper - Adds support for initializing a new Gradle build. Handles converting a Maven build to a Gradle build.
cunit - - Adds support for running?CUnit?tests.
jacoco reporting-base java Provides integration with the?JaCoCo?code coverage library for Java.
sonar-runner - java-base, java, jacoco Provides integration with the?Sonar?code quality platform. Supersedes the?sonar?plugin.
visual-studio - native language plugins Adds integration with Visual Studio.
wrapper - - Adds a?Wrapper?task for generating Gradle wrapper files.
java-gradle-plugin java Assists with development of Gradle plugins by providing standard plugin build configuration and validation.

22.7. Base plugins 基本插件

這些插件形成基本構(gòu)建塊,用來提供給其他插件組裝。它們可以被使用在你的構(gòu)建文件,并列出的完整性。然而,要注意他們還沒有考慮 Gradle 的公共API的一部分。因此,這些插件都不能列在用戶指南文件中。你可以參考他們的API文檔來了解他們。

Table 22.7. Base plugins

Plugin Id Description
base Adds the standard lifecycle tasks and configures reasonable defaults for the archive tasks:
java-base Adds the source sets concept to the project. Does not add any particular source sets.
groovy-base Adds the Groovy source sets concept to the project.
scala-base 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. Third party plugins 第三方插件

可以從這里看到外部的插件

以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號