Gradle 2.0 用户指南翻译——第四十八章. 包装器插件

本文详细介绍了Gradle包装器插件的功能和用法,包括如何自动将插件应用于项目,以及它如何生成所需的Gradle包装器文件,以便在没有安装Gradle的情况下也能运行构建。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

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

 

第四十八章. 包装器插件

Chapter 48. Wrapper Plugin

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

Gradle包装器程序插件允许通过添加 Wrapper 任务来生成Gradle包装器文件,该任务生成使用Gradle Wrapper来运行构建所需的所有文件。 有关Gradle Wrapper的详细信息,请参阅对应的章节《第六十一章,Gradle Wrapper》。 
The Gradle wrapper plugin allows the generation of Gradle wrapper files by adding a Wrapper task, that generates all files needed to run the build using the Gradle Wrapper. Details about the Gradle Wrapper can be found in the according chapter Chapter 61, The Gradle Wrapper

48.1. 用法

48.1. Usage

在不修改 build.gradle 文件的情况下,可以通过从命令行运行 gradle wrapper 来自动将包装器插件应用于当前构建的根项目。 如果未在构建中定义名为 wrapper 的任务,那么将会应用此插件。 
Without modifying the build.gradle file, the wrapper plugin can be auto-applied to the rootproject of the current build by running gradle wrapper from the commandline. This applies the plugin if no task named wrapper is already defined in the build.

48.2. 任务

48.2. Tasks

包装器插件向项目添加以下任务:
The wrapper plugin adds the following tasks to the project:

表 48.1. 包装器插件——任务 - Table 48.1. Wrapper plugin - tasks

任务名称
Task name
依赖于
Depends on
类型
Type
描述
Description
wrapper-Wrapper生成 Gradle wrapper 文件。
Generates Gradle wrapper files.
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值