From c25ef17a4aa643292780efa90895c09829e7ba94 Mon Sep 17 00:00:00 2001 From: Stefan Mogeritsch Date: Tue, 12 May 2026 15:23:49 +0200 Subject: [PATCH] =?UTF-8?q?refactor(build):=20Typen=20in=20Gradle-Skript?= =?UTF-8?q?=20explizit=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stefan Mogeritsch --- build.gradle.kts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 7941f7a7..5a4c9c76 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -38,7 +38,7 @@ plugins { // ### ALLPROJECTS CONFIGURATION ### // ################################################################## -val isWasmEnabled = findProperty("enableWasm")?.toString()?.toBoolean() ?: false +val isWasmEnabled: Boolean = findProperty("enableWasm")?.toString()?.toBoolean() ?: false // --------------------------------------------------------------- // Zentrale Versionierung — liest version.properties (SemVer) @@ -47,10 +47,10 @@ val versionProps = java.util.Properties().also { props -> rootProject.file("version.properties").inputStream().use { props.load(it) } } -val vMajor = versionProps.getProperty("VERSION_MAJOR", "1") -val vMinor = versionProps.getProperty("VERSION_MINOR", "0") -val vPatch = versionProps.getProperty("VERSION_PATCH", "0") -val vQualifier = versionProps.getProperty("VERSION_QUALIFIER", "").trim() +val vMajor: String = versionProps.getProperty("VERSION_MAJOR", "1") +val vMinor: String = versionProps.getProperty("VERSION_MINOR", "0") +val vPatch: String = versionProps.getProperty("VERSION_PATCH", "0") +val vQualifier: String = versionProps.getProperty("VERSION_QUALIFIER", "").trim() val semVer = if (vQualifier.isBlank()) "$vMajor.$vMinor.$vPatch" else "$vMajor.$vMinor.$vPatch-$vQualifier" allprojects { @@ -113,7 +113,7 @@ subprojects { // (A) Source map configuration is handled via `gradle.properties` (global Kotlin/JS settings) // to avoid compiler-flag incompatibilities across toolchains. - // (B) Conditional Wasm/JS Target handling based on `enableWasm` property + // (B) Conditional Wasm/JS Target handling based on the ` enableWasm ` property // This significantly reduces build times during Desktop development. // Flag is defined at the beginning of the script. @@ -176,8 +176,8 @@ subprojects { // Applies to all Exec-based tasks (covers Yarn/NPM invocations used by Kotlin JS plugin) tasks.withType().configureEach { // Merge existing NODE_OPTIONS with --no-deprecation - val current = (environment["NODE_OPTIONS"] as String?) ?: System.getenv("NODE_OPTIONS") - val merged = if (current.isNullOrBlank()) "--no-deprecation" else "$current --no-deprecation" + val current: String? = (environment["NODE_OPTIONS"] as String?) ?: System.getenv("NODE_OPTIONS") + val merged: String = if (current.isNullOrBlank()) "--no-deprecation" else "$current --no-deprecation" environment("NODE_OPTIONS", merged) // Also set the legacy switch to silence warnings entirely environment("NODE_NO_WARNINGS", "1") @@ -469,8 +469,8 @@ tasks.register("docs") { // Apply Node warning suppression on root project Exec tasks as well // Ensures aggregated Kotlin/JS tasks created at root (e.g., kotlinNpmInstall) inherit the env tasks.withType().configureEach { - val current = (environment["NODE_OPTIONS"] as String?) ?: System.getenv("NODE_OPTIONS") - val merged = if (current.isNullOrBlank()) "--no-deprecation" else "$current --no-deprecation" + val current: String? = (environment["NODE_OPTIONS"] as String?) ?: System.getenv("NODE_OPTIONS") + val merged: String = if (current.isNullOrBlank()) "--no-deprecation" else "$current --no-deprecation" environment("NODE_OPTIONS", merged) environment("NODE_NO_WARNINGS", "1") // Set a Chrome binary path to avoid snap permission issues