作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想将我的第一个项目“Component1-1-1”包含在我的第二个项目“Component1-1”中,我在我的setting.gradle文件中添加了以下语法:
include ':Component1-1-1'
project(':Component1-1-1').projectDir = new File(settingsDir, '../Component1-1-1')
earlib project(':Component1-1-1')
include 'Component1-1-1'
project(':Component1-1-1').projectDir = new File(settingsDir, '../Component1-1-1')
earlib project(':Component1-1-1')
最佳答案
在project()
函数内的gradle中引用项目时,需要限定项目名称,分隔符为':'。与linux中的'/'相同。
但是,当您使用include()
定义一个新项目时,您只需传递该项目的相对文件路径,所以不能使用':'。
Gradle只是在include ':Component1-1-1'
中丢弃冒号。
请参见https://github.com/gradle/gradle/blob/master/subprojects/core/src/main/java/org/gradle/initialization/DefaultSettings.java中的包含定义
以及实际上应称为“removeLeadingColon”的方法“removeTrailingColon”。
关于gradle - 如何在Gradle中创建一个多项目?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51044578/
我是一名优秀的程序员,十分优秀!