我的库中 gradle wrapper.jar 的用途 [英] Purpose of gradle wrapper.jar in my libraries

查看:62
本文介绍了我的库中 gradle wrapper.jar 的用途的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将库添加到我的项目中,但出于某种原因,我看到了一个包含 gradle wrapper.jar 和 artifactory.gradle 的 gradle 文件夹.

I am trying to add libraries to my project and for some reason I am seeing a gradle folder with gradle wrapper.jar and artifactory.gradle.

这些文件的用途是什么?在添加这个库之前,我需要修改它们或调用它们吗?

what are the purposes of these files? Do I need to toch them or invoke them before adding this library?

推荐答案

我将根据文件将答案分为两部分:

I'll divide the answer in two parts, depending on files:

gradle-wrapper.jar:

此 jar 包含 Gradle 的打包版本.建议为每个使用 Gradle 的项目使用包装器,原因有两个:

This jar contains a packaged version of Gradle. It's recommended to have a wrapper for each projects that uses Gradle for two reasons:

  1. 包装器可以确保每个将使用您的项目的人都拥有相同版本的 Gradle.
  2. 如果有人没有安装 Gradle,他可以使用包装器来执行命令.
  1. The wrapper can ensure to have the same version of Gradle for everyone that will use your project.
  2. If someone hasn't Gradle installed, he can use the wrapper to execute commands.

您不能调用"包装器,但可以对包装器使用相同的 Gradle 命令.

You can't "invoke" the wrapper but you can use the same Gradle commands with the wrapper.

artifactory.gradle

这个 gradle 文件可以是一个随机文件,里面有一些脚本/任务,但我很确定(顾名思义)它包含一个脚本来上传工件到 Artifactory.

This gradle file can be a random file with some scripts/tasks inside but I'm pretty sure (as the name suggest) that it contains a script to upload artifacts to Artifactory.

您可以使用包装器(或本地 Gradle)执行其任务.

You can execute its task with the wrapper (or a local Gradle).

在添加这个库之前,我需要触摸它们或调用它们吗?

Do I need to toch them or invoke them before adding this library?

没有

这篇关于我的库中 gradle wrapper.jar 的用途的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆