From c0b7110dfd847bc1c6b0ac14ea9a12b1ca1a80d2 Mon Sep 17 00:00:00 2001 From: Robert Stupp Date: Fri, 30 Jan 2026 13:08:38 +0100 Subject: [PATCH] Automatically adjust gradlew during Gradle Wrapper updates --- build.gradle.kts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index b5dc485e..afb09feb 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -96,3 +96,17 @@ idea.project.settings { ) } } + +tasks.named("wrapper") { + actions.addLast { + val script = scriptFile.readText() + val scriptLines = script.lines().toMutableList() + + val insertAtLine = + scriptLines.indexOf("# Use the maximum available, or set MAX_FD != -1 to use that value.") + scriptLines.add(insertAtLine, "") + scriptLines.add(insertAtLine, $$". \"${APP_HOME}/gradle/gradlew-include.sh\"") + + scriptFile.writeText(scriptLines.joinToString("\n")) + } +}