(minor) Move the unused source sets check to the taskGraph.whenReady
This is a workaround for Android compilations being configured in an afterEvaluate callback. Issue #KT-26963 Fixed
This commit is contained in:
+2
-1
@@ -35,7 +35,8 @@ object UnusedSourceSetsChecker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun checkSourceSets(project: Project) {
|
fun checkSourceSets(project: Project) {
|
||||||
project.afterEvaluate {
|
// TODO once Android compilations are configured eagerly, move this to afterEvaluate { ... } instead of taskGraph.whenReady { ... }
|
||||||
|
project.gradle.taskGraph.whenReady { _ ->
|
||||||
val compilationsBySourceSet = compilationsBySourceSet(project)
|
val compilationsBySourceSet = compilationsBySourceSet(project)
|
||||||
val unusedSourceSets = project.kotlinExtension.sourceSets.filter {
|
val unusedSourceSets = project.kotlinExtension.sourceSets.filter {
|
||||||
compilationsBySourceSet[it]?.isEmpty() ?: true
|
compilationsBySourceSet[it]?.isEmpty() ?: true
|
||||||
|
|||||||
Reference in New Issue
Block a user