SmaliYu
V2EX  ›  Android

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

  •  
  •   SmaliYu · Feb 6, 2022 · 14294 views
    This topic created in 1735 days ago, the information mentioned may be changed or developed.

    今天更新了新版本的 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 是干嘛的?

    somebody
    somebody
    Feb 6, 2022❤️2
    1
    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
    SmaliYu
    OP
    Feb 6, 2022
    2
    @somebody 屌,多谢老铁
    petercui
    petercui
    Feb 6, 2022
    3
    apply false 大概就是 引用了插件但是不应用 吧 。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1885 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 03:49 · PVG 11:49 · LAX 19:49 · JFK 22:49
    ♥ Do have faith in what you're doing.