使用gradlew和gradle的区别 [英] Difference between using gradlew and gradle

查看:673
本文介绍了使用gradlew和gradle的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 gradlew gradle 或它们是否相同?

解决方案

不同之处在于 ./ gradlew 表示您正在使用gradle包装器。包装通常是项目的一部分,它有助于安装Gradle。如果您在没有包装的情况下使用gradle,则必须手动安装它 - 例如,在mac brew install gradle 中,然后使用调用gradle。 gradle 命令。在这两种情况下,您都使用gradle,但前者更方便,并确保不同机器之间的版本一致性。


每个包装都绑定到特定版本的Gradle,所以当你
首先运行上面给定Gradle版本的命令之一时,它
将下载相应的Gradle发行版并将它用于
执行构建版。 p>

这不仅意味着您不必手动安装Gradle
,但您也一定要使用Gradle版本,即
build是专为。这使得您的历史版本更加可靠

阅读更多信息 - https://docs.gradle.org/current/userguide/gradle_wrapper.html



另外,Udacity有一个整洁,解释Gradle包装器概念的高级视频 - https://www.youtube.com/watch?v= 1aA949H-shk

What is the difference between using gradlew and gradle or are they the same?

解决方案

The difference lies in the fact that ./gradlew indicates you are using a gradle wrapper. The wrapper is generally part of a project and it facilitates installation of gradle. If you were using gradle without the wrapper you would have to manually install it - for example, on a mac brew install gradle and then invoke gradle using the gradle command. In both cases you are using gradle, but the former is more convenient and ensures version consistency across different machines.

Each Wrapper is tied to a specific version of Gradle, so when you first run one of the commands above for a given Gradle version, it will download the corresponding Gradle distribution and use it to execute the build.

Not only does this mean that you don’t have to manually install Gradle yourself, but you are also sure to use the version of Gradle that the build is designed for. This makes your historical builds more reliable

Read more here - https://docs.gradle.org/current/userguide/gradle_wrapper.html

Also, Udacity has a neat, high level video explaining the concept of the gradle wrapper - https://www.youtube.com/watch?v=1aA949H-shk

这篇关于使用gradlew和gradle的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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