feat: füge Wasm/JS-Feature-Toggle hinzu, optimiere Gradle-Build-Zeit durch bedingte Task-Deaktivierung
Signed-off-by: StefanMoCoAt <stefan.mo.co@gmail.com>
This commit is contained in:
+25
-2
@@ -38,6 +38,8 @@ plugins {
|
||||
// ### ALLPROJECTS CONFIGURATION ###
|
||||
// ##################################################################
|
||||
|
||||
val isWasmEnabled = findProperty("enableWasm")?.toString()?.toBoolean() ?: false
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// Zentrale Versionierung — liest version.properties (SemVer)
|
||||
// ---------------------------------------------------------------
|
||||
@@ -92,7 +94,7 @@ subprojects {
|
||||
minHeapSize = "512m"
|
||||
maxHeapSize = "2g"
|
||||
// Parallel test execution for better performance
|
||||
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
|
||||
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 4).coerceAtLeast(1)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -111,7 +113,28 @@ subprojects {
|
||||
// (A) Source map configuration is handled via `gradle.properties` (global Kotlin/JS settings)
|
||||
// to avoid compiler-flag incompatibilities across toolchains.
|
||||
|
||||
// (B) JS test executable compilation/sync is currently very noisy (duplicate resource copying from jsMain + jsTest).
|
||||
// (B) Conditional Wasm/JS Target handling based on `enableWasm` property
|
||||
// This significantly reduces build times during Desktop development.
|
||||
// Flag is defined at the beginning of the script.
|
||||
|
||||
// If Wasm is disabled, we skip the intensive JS/WASM compilation tasks
|
||||
// for modules that are not strictly JVM-only.
|
||||
if (!isWasmEnabled) {
|
||||
tasks.matching {
|
||||
val n = it.name
|
||||
n.contains("wasmJs", ignoreCase = true) ||
|
||||
n.contains("KotlinJs", ignoreCase = true) ||
|
||||
n.contains("JsIr", ignoreCase = true) ||
|
||||
n.contains("packageJsUpper", ignoreCase = true) ||
|
||||
n.contains("jsProcessResources", ignoreCase = true) ||
|
||||
n.contains("wasmJsProcessResources", ignoreCase = true)
|
||||
}.configureEach {
|
||||
enabled = false
|
||||
group = "disabled"
|
||||
}
|
||||
}
|
||||
|
||||
// (C) JS test executable compilation/sync is currently very noisy (duplicate resource copying from jsMain + jsTest).
|
||||
// We disable JS/WASM JS test executables in CI/build to keep output warning-free.
|
||||
tasks.matching {
|
||||
val n = it.name
|
||||
|
||||
Reference in New Issue
Block a user