How does Gradle know whether to do a single or multiproject build?
来源:互联网 发布:项目数据分析报告范文 编辑:程序博客网 时间:2024/04/30 03:39
How does Gradle know whether to do a single or multiproject build?
If you trigger a multiproject build from a directory with a settings file, things are easy. But Gradle also allows you to execute the build from within any subproject taking part in the build. [10] If you execute Gradle from within a project with no settings.gradle
file, Gradle looks for a settings.gradle
file in the following way:
It looks in a directory called
master
which has the same nesting level as the current dir.If not found yet, it searches parent directories.
If not found yet, the build is executed as a single project build.
If a
settings.gradle
file is found, Gradle checks if the current project is part of the multiproject hierarchy defined in the foundsettings.gradle
file. If not, the build is executed as a single project build. Otherwise a multiproject build is executed.
What is the purpose of this behavior? Gradle needs to determine whether the project you are in is a subproject of a multiproject build or not. Of course, if it is a subproject, only the subproject and its dependent projects are built, but Gradle needs to create the build configuration for the whole multiproject build (see Chapter 25, Multi-project Builds). You can use the -u
command line option to tell Gradle not to look in the parent hierarchy for a settings.gradle
file. The current project is then always built as a single project build. If the current project contains a settings.gradle
file, the -u
option has no meaning. Such a build is always executed as:
a single project build, if the
settings.gradle
file does not define a multiproject hierarchya multiproject build, if the
settings.gradle
file does define a multiproject hierarchy.
The automatic search for a settings.gradle
file only works for multi-project builds with a physical hierarchical or flat layout. For a flat layout you must additionally follow the naming convention described above (“master
”). Gradle supports arbitrary physical layouts for a multiproject build, but for such arbitrary layouts you need to execute the build from the directory where the settings file is located. For information on how to run partial builds from the root see Section 25.4, “Running tasks by their absolute path”.
Gradle creates a Project object for every project taking part in the build. For a multi-project build these are the projects specified in the Settings object (plus the root project). Each project object has by default a name equal to the name of its top level directory, and every project except the root project has a parent project. Any project may have child projects.
- How does Gradle know whether to do a single or multiproject build?
- How to know whether a connection leak occured in weblogic8.1
- how to know whether an element has an class
- how to know whether one string is english string
- How to build multiple targets from a single Xcode Project
- How to detect whether a module is managed code or not
- How much math does a GIS Analyst need to know?(转)
- How to Check Whether API Server is up or Down
- How to know whether the attribute belongs to one types of productin Magento?
- 在VC++6.0中出现failed to (or don't know how to) build 原因及解决方法
- How do I upgrade a single MongoDB node to sharding mode?
- How do you build a database?
- How do you build a database?
- How To Build a Yacc
- How To Build a Yacc
- How to "Build" a Computer
- How to Build a PREEMPT_RTkernel
- How to Build a House
- ROS Navigation-----costmap_2d之range_sensor_layer简介
- 数据库
- java读取properties文件的几种方法
- 爬虫_for_python
- Java学习笔记(二)——标识符、关键字
- How does Gradle know whether to do a single or multiproject build?
- 第十四周-C语言 oj上机题目(数组逆序)
- iOS之AVPlayer的简单应用
- JDBC
- PTA 4-2 奇数值结点链表 (50分)
- 第十四周 OJ 输入一个数插入一个数列
- Flip Game(POJ 1753)
- 读记-tomcat与java web开发技术详解
- 收集的一些免费linux教程