(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:
Sergey Igushkin
2018-10-23 16:06:38 +03:00
parent 834de23f39
commit 5ee6a6037d
@@ -35,7 +35,8 @@ object UnusedSourceSetsChecker {
}
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 unusedSourceSets = project.kotlinExtension.sourceSets.filter {
compilationsBySourceSet[it]?.isEmpty() ?: true