gpt4 book ai didi

build - 为什么在指定-b 时不使用settings.gradle 文件?

转载 作者:行者123 更新时间:2023-12-01 08:12:47 27 4
gpt4 key购买 nike

来自 Gradle User Guide我们可以读到

You can use the -b option to select another build file. If you use -b option then settings.gradle file is not used.

那么让我们:

-Example      #Project root --src   --main   --test --build.gradle --second.gradle #Second build script --settings.gradle 

What is the purpose of this? If I want to try something different with my multiproject build I create another script file - second.gradle and put it in the same directory. But want old settings.gradle file to include my subprojects.

If I execute my gradle comands when I am in the root directory of Example project for ex:

gradle  -b second.gradle clean build

为什么 Gradle 不使用 settings.gradle 文件?当指定的构建文件不在同一目录中时保护自己,因为 Gradle 将在 build.gradle 文件的目录中查找 settings.gradle,然后在父目录中查找。但是它们可以是空的还是可以来自另一个项目?

最佳答案

-b 允许为单个项目构建传递不同的构建脚本。它不适用于多项目构建,其中 settings.gradle 单独确定构建脚本的位置。

关于build - 为什么在指定-b 时不使用settings.gradle 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21336106/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com