我不确定这是否得到fileTree的支持。我搜索了文档和所有使用具体(绝对路径或相对路径)的示例。这就是我想做的。
ext {
externalProjectRoot "c:/AnotherProject"
}
implementation fileTree(dir: ${externalProjectRoot}/lib', include: '*.jar')如果我做了以下操作,它就能工作了。
implementation fileTree(dir: 'c:/AnotherProject/lib', include: '*.jar')因此,我怀疑fileTree函数不支持dir属性的变量。如果没有,我还有其他选择吗?
谢谢!
发布于 2018-10-24 17:11:54
您需要使用"而不是':
替换
implementation fileTree(dir: '${externalProjectRoot}/lib', include: '*.jar')使用
implementation fileTree(dir: "${externalProjectRoot}/lib", include: '*.jar')在这个答案中,请参阅关于“和”之间的区别的更多解释:Gradle Single vs Double Quotes:
Gradle构建脚本是用Groovy编写的。Groovy有双引号和单引号字符串文本。主要区别在于,双引号字符串文字支持字符串内插。
https://stackoverflow.com/questions/52973144
复制相似问题