在深度嵌套的目录树中定义子项目 [英] defining subprojects in a deeply nested directory tree

查看:134
本文介绍了在深度嵌套的目录树中定义子项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在嵌套目录树中定义子项目,其中子项目文件夹不是根项目的直接子项

  root 
lala
A
lulu
B



<现在我想添加A& B作为子项目。如果我这样做的话

$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $包括lala:A,lulu:B

然后lala和lulu将作为子项目添加。不过,我只想补充A& B和其他东西。

解决方案

默认情况下,Gradle假定物理目录布局遵循逻辑项目层次结构,但可以重新配置它任何你喜欢的方式。例如:

 包含A,B

项目(:A) .projectDir = file(lala / A)
project(:B)。projectDir = file(lala / B)


how do I define sub projects in a nested directory tree where the sub-project folders are not immediate children of the root project

root
  lala
    A
  lulu
    B

Now I Want to add A & B as sub projects. If I do

//settings.gradle
include "lala:A", "lulu:B"

then also "lala" and "lulu" will be added as sub projects. However I only want to add A & B and nothing else.

解决方案

By default, Gradle assumes that the physical directory layout follows the logical project hierarchy, but you can reconfigure it any way you like. For example:

include "A", "B"

project(":A").projectDir = file("lala/A")
project(":B").projectDir = file("lala/B")

这篇关于在深度嵌套的目录树中定义子项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆