Android Studio 新版本 bumblebee 里面 gradle 脚本的疑惑

2022-02-06 09:51:08 +08:00
 SmaliYu

今天更新了新版本的 Android Studio ,其中我看到项目根目录的 gradle 文件变成了这个样子

plugins {
    id 'com.android.application' version '7.1.1' apply false
    id 'com.android.library' version '7.1.1' apply false
}

这个 apply false 是干嘛的?

4911 次点击
所在节点    Android
3 条回复
somebody
2022-02-06 10:24:09 +08:00
If you have a multi-project build, you probably want to apply plugins to some or all of the subprojects in your build, but not to the root project. The default behavior of the plugins {} block is to immediately resolve and apply the plugins. But, you can use the apply false syntax to tell Gradle not to apply the plugin to the current project and then use the plugins {} block without the version in subprojects' build scripts

> https://docs.gradle.org/current/userguide/plugins.html
SmaliYu
2022-02-06 10:30:58 +08:00
@somebody 屌,多谢老铁
petercui
2022-02-06 18:21:28 +08:00
apply false 大概就是 引用了插件但是不应用 吧 。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/832034

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX