0
settings.gradle
是:如何在Gradle子項目中指定配置順序?
rootProject.name = 'snth'
include 'snth-proto-definition'
include 'snth-server'
include 'snth-client-guice'
snth-server/build.gradle
有:
sourceSets {
main {
java {
srcDir "${project(':snth-proto-definition').protobuf.generatedFilesBaseDir}/server/java"
}
}
}
snth-client/build.gradle
有:
sourceSets {
main {
java {
srcDir "${project(':snth-proto-definition').protobuf.generatedFilesBaseDir}/client/java"
}
}
}
不過,雖然snth-server-guice/build.gradle
得到處理精細,snth-client-guice/build.gradle
錯誤有:
FAILURE: Build failed with an exception.
* Where:
Build file 'snth/snth-client-guice/build.gradle' line: 14
* What went wrong:
A problem occurred evaluating project ':snth-client-guice'.
> Could not find property 'protobuf' on project ':snth-proto-definition'.
我如何確保project(':snth-proto-definition').protobuf
在使用前已定義?