如何从Gradle中的另一个子项目配置引用文件集 [英] How to reference the fileset from another subprojects configuration in gradle
本文介绍了如何从Gradle中的另一个子项目配置引用文件集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想要这样的东西(注意:sub是对子项目的引用)
I would like something like this(notice the :sub is a reference to a subproject)
task deleteJars(type: Delete) {
ext.collection = files { genLibDir.listFiles() }
delete ext.collection
}
task copyJars(type: Copy) {
from(:sub.configurations.compile) {}
from(fixedLibDir) {}
into genLibDir
}
copyJars.dependsOn('deleteJars')
classes.dependsOn('copyJars')
但是不会编译.对于playframework,我需要将其他项目配置中的jars放入我的lib目录中,以启动playframework.我该如何解决以上代码?
This doesn't compile however. For playframework, I need to get the jars in that other projects configuration into my lib directory for playframework to startup. How can I fix the above code?
谢谢, 院长
推荐答案
应该是这样的:
project(":sub").configurations.compile
?
这篇关于如何从Gradle中的另一个子项目配置引用文件集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文