1
像This Other Question其他地方將有一個jacocoTestReport任務取決於testDebug。哪些工作。Android的Jacoco測試與Gradle dependsOn與compileDebugSources和compileDebugTestSources的訂單
task jacocoTestReport(type: JacocoReport, dependsOn: "testDebug") {
...
}
然而,在我的情況,我需要還取決於Android的任務compileDebugSources和compileDebugTestSources除了testDebug。所以,我希望下面將工作
task jacocoTestReport(type: JacocoReport, dependsOn: ["compileDebugSources", "compileDebugTestSources", "testDebug"]) {
...
}
然而,當我使用dependsOn屬性或方法,如搖籃指出這些依賴的順序不能保證。所以我想做一些類似下面的任務
testDebug.mustRunAfter compileDebugSources
testDebug.mustRunAfter compileDebugTestSources
之外,但我得到上述彙編的問題是,testDebug或compileDebugSources或compileDebugTestSources被標記爲「找不到屬性「testDebug/compileDebugSources/compileDebugTestSources'「在項目上:app
我想知道我需要做什麼才能在gradle中爲我現有的jacocoTestReport任務添加這些任務的順序。