我有一个包含项目projectA
和projectB
的多模块项目。
// project A build.gradle
task tarTask(type:Tar) {
// some configuration here
}
sourceSets {
main {
output.dir( "someOutputDir", builtBy: tarTask)
}
}
// project B build.gradle
task someOtherTask {
doLast {
// do something that refers to the output of :projectA:tarTask
}
}
dependencies {
runtimeOnly project(':projectA')
}
如何配置projectB
,使projectA:tarTask
作为projectB:someOtherTask
的依赖项运行?
我尝试遵循文档here中的指导,但无法获得projectB
来识别第一个项目:
./gradlew :projectB:someOtherTask
...
...
A problem occurred evaluating root project 'projectB'.
> Project with path ':projectA' could not be found in root project 'projectB'.