干净,gradlew干净之间的区别 [英] Difference between clean, gradlew clean
问题描述
当从 Android Studio 项目的终端发出时,以下语句有什么区别:
What is the difference between the following statements when issued from a Android Studio Project's terminal :
Android_Studio_Project_Path: ./gradlew clean
Android_Studio_Project_Path: ./gradlew clean
Android_Studio_Project_Path: ./gradlew clean assembleDebug
Android_Studio_Project_Path: ./gradlew clean assembleDebug
Android_Studio_Project_Path: ./gradlew clean :assembleDebug
Android_Studio_Project_Path: ./gradlew clean :assembleDebug
和普通的 Android Studio -->构建 -->干净.
and normal Android Studio --> Build --> Clean.
内部流程有何不同.
推荐答案
./gradlew clean
使用您项目的 gradle wrapper 来执行您的项目的 clean
任务.通常,这只是意味着删除构建目录.
Uses your project's gradle wrapper to execute your project's clean
task. Usually, this just means the deletion of the build directory.
./gradlew clean assembleDebug
同样,使用项目的 gradle 包装器分别执行 clean
和 assembleDebug
任务.因此,它将首先清理,然后在任何非最新的依赖任务之后执行 assembleDebug
.
Again, uses your project's gradle wrapper to execute the clean
and assembleDebug
tasks, respectively. So, it will clean first, then execute assembleDebug
, after any non-up-to-date dependent tasks.
./gradlew clean :assembleDebug
本质上与#2 相同.冒号代表任务路径.任务路径在 gradle 多项目中是必不可少的,在这种情况下没有那么多.这意味着运行根项目的 assembleDebug 任务.在这里,根项目是唯一的项目.
Is essentially the same as #2. The colon represents the task path. Task paths are essential in gradle multi-project's, not so much in this context. It means run the root project's assembleDebug task. Here, the root project is the only project.
Android Studio -->构建 -->干净
本质上与./gradlew clean
相同.请参阅此处.
Is essentially the same as ./gradlew clean
. See here.
有关更多信息,我建议您花时间阅读 Android 文档,尤其是 这个.
For more info, I suggest taking the time to read through the Android docs, especially this one.
这篇关于干净,gradlew干净之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!