aboutsummaryrefslogtreecommitdiff
path: root/buildSrc/src/main/kotlin/org/jetbrains/projectUtils.kt
blob: 46d803a5de689db583728131033a5ff57120520c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package org.jetbrains

import org.gradle.api.Project

fun Project.whenEvaluated(action: Project.() -> Unit) {
    if (state.executed) {
        action()
    } else {
        afterEvaluate { action() }
    }
}

fun Project.invokeWhenEvaluated(action: (project: Project) -> Unit) {
    whenEvaluated { action(this) }
}