refactor(build): Typen in Gradle-Skript explizit hinzugefügt
Signed-off-by: Stefan Mogeritsch <stefan.mo.co@gmail.com>
This commit is contained in:
+10
-10
@@ -38,7 +38,7 @@ plugins {
|
|||||||
// ### ALLPROJECTS CONFIGURATION ###
|
// ### ALLPROJECTS CONFIGURATION ###
|
||||||
// ##################################################################
|
// ##################################################################
|
||||||
|
|
||||||
val isWasmEnabled = findProperty("enableWasm")?.toString()?.toBoolean() ?: false
|
val isWasmEnabled: Boolean = findProperty("enableWasm")?.toString()?.toBoolean() ?: false
|
||||||
|
|
||||||
// ---------------------------------------------------------------
|
// ---------------------------------------------------------------
|
||||||
// Zentrale Versionierung — liest version.properties (SemVer)
|
// Zentrale Versionierung — liest version.properties (SemVer)
|
||||||
@@ -47,10 +47,10 @@ val versionProps =
|
|||||||
java.util.Properties().also { props ->
|
java.util.Properties().also { props ->
|
||||||
rootProject.file("version.properties").inputStream().use { props.load(it) }
|
rootProject.file("version.properties").inputStream().use { props.load(it) }
|
||||||
}
|
}
|
||||||
val vMajor = versionProps.getProperty("VERSION_MAJOR", "1")
|
val vMajor: String = versionProps.getProperty("VERSION_MAJOR", "1")
|
||||||
val vMinor = versionProps.getProperty("VERSION_MINOR", "0")
|
val vMinor: String = versionProps.getProperty("VERSION_MINOR", "0")
|
||||||
val vPatch = versionProps.getProperty("VERSION_PATCH", "0")
|
val vPatch: String = versionProps.getProperty("VERSION_PATCH", "0")
|
||||||
val vQualifier = versionProps.getProperty("VERSION_QUALIFIER", "").trim()
|
val vQualifier: String = versionProps.getProperty("VERSION_QUALIFIER", "").trim()
|
||||||
val semVer = if (vQualifier.isBlank()) "$vMajor.$vMinor.$vPatch" else "$vMajor.$vMinor.$vPatch-$vQualifier"
|
val semVer = if (vQualifier.isBlank()) "$vMajor.$vMinor.$vPatch" else "$vMajor.$vMinor.$vPatch-$vQualifier"
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
@@ -113,7 +113,7 @@ subprojects {
|
|||||||
// (A) Source map configuration is handled via `gradle.properties` (global Kotlin/JS settings)
|
// (A) Source map configuration is handled via `gradle.properties` (global Kotlin/JS settings)
|
||||||
// to avoid compiler-flag incompatibilities across toolchains.
|
// 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.
|
// This significantly reduces build times during Desktop development.
|
||||||
// Flag is defined at the beginning of the script.
|
// 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)
|
// Applies to all Exec-based tasks (covers Yarn/NPM invocations used by Kotlin JS plugin)
|
||||||
tasks.withType<Exec>().configureEach {
|
tasks.withType<Exec>().configureEach {
|
||||||
// Merge existing NODE_OPTIONS with --no-deprecation
|
// Merge existing NODE_OPTIONS with --no-deprecation
|
||||||
val current = (environment["NODE_OPTIONS"] as String?) ?: System.getenv("NODE_OPTIONS")
|
val current: String? = (environment["NODE_OPTIONS"] as String?) ?: System.getenv("NODE_OPTIONS")
|
||||||
val merged = if (current.isNullOrBlank()) "--no-deprecation" else "$current --no-deprecation"
|
val merged: String = if (current.isNullOrBlank()) "--no-deprecation" else "$current --no-deprecation"
|
||||||
environment("NODE_OPTIONS", merged)
|
environment("NODE_OPTIONS", merged)
|
||||||
// Also set the legacy switch to silence warnings entirely
|
// Also set the legacy switch to silence warnings entirely
|
||||||
environment("NODE_NO_WARNINGS", "1")
|
environment("NODE_NO_WARNINGS", "1")
|
||||||
@@ -469,8 +469,8 @@ tasks.register("docs") {
|
|||||||
// Apply Node warning suppression on root project Exec tasks as well
|
// 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
|
// Ensures aggregated Kotlin/JS tasks created at root (e.g., kotlinNpmInstall) inherit the env
|
||||||
tasks.withType<Exec>().configureEach {
|
tasks.withType<Exec>().configureEach {
|
||||||
val current = (environment["NODE_OPTIONS"] as String?) ?: System.getenv("NODE_OPTIONS")
|
val current: String? = (environment["NODE_OPTIONS"] as String?) ?: System.getenv("NODE_OPTIONS")
|
||||||
val merged = if (current.isNullOrBlank()) "--no-deprecation" else "$current --no-deprecation"
|
val merged: String = if (current.isNullOrBlank()) "--no-deprecation" else "$current --no-deprecation"
|
||||||
environment("NODE_OPTIONS", merged)
|
environment("NODE_OPTIONS", merged)
|
||||||
environment("NODE_NO_WARNINGS", "1")
|
environment("NODE_NO_WARNINGS", "1")
|
||||||
// Set a Chrome binary path to avoid snap permission issues
|
// Set a Chrome binary path to avoid snap permission issues
|
||||||
|
|||||||
Reference in New Issue
Block a user