aboutsummaryrefslogtreecommitdiff
path: root/build-logic/src/main/kotlin/org/jetbrains/projectUtils.kt
diff options
context:
space:
mode:
authorGoooler <wangzongler@gmail.com>2023-03-13 21:51:31 +0800
committerGitHub <noreply@github.com>2023-03-13 14:51:31 +0100
commit3ea414251d32108dab8b14d41a672e9834824690 (patch)
tree5f7a62f60e3d90ee97989cff8e5d748b180d091b /build-logic/src/main/kotlin/org/jetbrains/projectUtils.kt
parent7a46cd329ac6ccbdb10195310197289947ee4104 (diff)
downloaddokka-3ea414251d32108dab8b14d41a672e9834824690.tar.gz
dokka-3ea414251d32108dab8b14d41a672e9834824690.tar.bz2
dokka-3ea414251d32108dab8b14d41a672e9834824690.zip
Migrate buildSrc to composite build (#2912)
Diffstat (limited to 'build-logic/src/main/kotlin/org/jetbrains/projectUtils.kt')
-rw-r--r--build-logic/src/main/kotlin/org/jetbrains/projectUtils.kt16
1 files changed, 16 insertions, 0 deletions
diff --git a/build-logic/src/main/kotlin/org/jetbrains/projectUtils.kt b/build-logic/src/main/kotlin/org/jetbrains/projectUtils.kt
new file mode 100644
index 00000000..46d803a5
--- /dev/null
+++ b/build-logic/src/main/kotlin/org/jetbrains/projectUtils.kt
@@ -0,0 +1,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) }
+}
+