使一个源集依赖于另一个源集 [英] Make one source set dependent on another
本文介绍了使一个源集依赖于另一个源集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
integrationTestClasses.dependsOn'classes'
这样做,还是有办法设置源集的依赖关系,这样会自动发生?在我的配置中
块我已经有
integrationTestCompile {extendsFrom testCompile}
integrationTestRuntime {extendsFrom integrationTestCompile,testRuntime}
解决方案
缺少的是:
依赖项{
integrationTestCompile sourceSets.main.output
}
有了这一点,应该自动建立任务依赖关系。
I have an integration test source set in gradle, and it is dependent on my main classes being compiled. I set that up by doing
integrationTestClasses.dependsOn 'classes'
Is this the way to do it, or is there a way to setup dependencies on source sets so this happens automatically? In my configurations
block I already have
integrationTestCompile { extendsFrom testCompile }
integrationTestRuntime { extendsFrom integrationTestCompile, testRuntime }
解决方案
What's missing is:
dependencies {
integrationTestCompile sourceSets.main.output
}
With this in place, task dependencies should be established automatically.
这篇关于使一个源集依赖于另一个源集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文