diff --git a/alchemist-web-renderer/build.gradle.kts b/alchemist-web-renderer/build.gradle.kts index 29169577b4..dae75b6b6f 100644 --- a/alchemist-web-renderer/build.gradle.kts +++ b/alchemist-web-renderer/build.gradle.kts @@ -22,6 +22,11 @@ kotlin { js(IR) { browser { binaries.executable() + testTask { + useKarma { + useChromeHeadless() + } + } } } sourceSets { diff --git a/alchemist-webgui/build.gradle.kts b/alchemist-webgui/build.gradle.kts index a58777bdae..47c7f1b8b4 100644 --- a/alchemist-webgui/build.gradle.kts +++ b/alchemist-webgui/build.gradle.kts @@ -14,7 +14,6 @@ plugins { alias(libs.plugins.kotlin.serialization) alias(libs.plugins.graphql.server) alias(libs.plugins.graphql.client) - id("io.kvision") version "7.3.1" } @@ -52,36 +51,27 @@ kotlin { } js(IR) { browser { - runTask( - Action { - mainOutputFileName = "alchemist-webgui.js" - sourceMaps = false - devServer = KotlinWebpackConfig.DevServer( - open = false, - port = 3000, - proxy = mutableMapOf( - "/kv/*" to "http://localhost:8080", - "/kvws/*" to mapOf("target" to "ws://localhost:8080", "ws" to true), - ), - static = mutableListOf("${layout.buildDirectory.asFile.get()}/processedResources/js/main"), - ) - }, - ) - - webpackTask( - Action { - mainOutputFileName = "alchemist-webgui.js" - }, - ) - - testTask( - Action { - useKarma { - useChromeHeadless() - } - }, - ) - + runTask { + mainOutputFileName = "alchemist-webgui.js" + sourceMaps = false + devServer = KotlinWebpackConfig.DevServer( + open = false, + port = 3000, + proxy = mutableMapOf( + "/kv/*" to "http://localhost:8080", + "/kvws/*" to mapOf("target" to "ws://localhost:8080", "ws" to true), + ), + static = mutableListOf("${layout.buildDirectory.asFile.get()}/processedResources/js/main"), + ) + } + webpackTask { + mainOutputFileName = "alchemist-webgui.js" + } + testTask { + useKarma { + useChromeHeadless() + } + } binaries.executable() } } @@ -116,7 +106,6 @@ kotlin { implementation(libs.apollo.runtime) implementation(libs.bundles.ktor.client) implementation(libs.bundles.kotlin.react) - implementation("io.kvision:kvision:$kvisionVersion") implementation("io.kvision:kvision-bootstrap:$kvisionVersion") implementation("io.kvision:kvision-richtext:$kvisionVersion") @@ -138,15 +127,17 @@ fun PatternFilterable.excludeGenerated() = exclude { "build${File.separator}gene tasks.withType().configureEach { excludeGenerated() } ktlint { filter { excludeGenerated() } } -tasks.named("runKtlintFormatOverCommonMainSourceSet").configure { - dependsOn(tasks.named("kspCommonMainKotlinMetadata")) +listOf("Check", "Format").forEach { + tasks.named("runKtlint${it}OverCommonMainSourceSet").configure { + dependsOn(tasks.named("kspCommonMainKotlinMetadata")) + } } -tasks.named("runKtlintCheckOverCommonMainSourceSet").configure { - dependsOn(tasks.named("kspCommonMainKotlinMetadata")) +tasks.named("sourcesJar").configure { + dependsOn("kspCommonMainKotlinMetadata") } -tasks.named("sourcesJar").configure { +tasks.withType().configureEach { dependsOn("kspCommonMainKotlinMetadata") } diff --git a/alchemist-webgui/src/commonMain/kotlin/graphql/api/EnvironmentApi.kt b/alchemist-webgui/src/commonMain/kotlin/graphql/api/EnvironmentApi.kt index 2cd71355f7..80e3cbe2a6 100644 --- a/alchemist-webgui/src/commonMain/kotlin/graphql/api/EnvironmentApi.kt +++ b/alchemist-webgui/src/commonMain/kotlin/graphql/api/EnvironmentApi.kt @@ -20,6 +20,9 @@ import kotlinx.coroutines.async import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.flow.Flow +/** + * Provides a set of functions to interact with the environment API. + */ object EnvironmentApi { /** diff --git a/alchemist-webgui/src/commonMain/kotlin/graphql/api/SimulationControlApi.kt b/alchemist-webgui/src/commonMain/kotlin/graphql/api/SimulationControlApi.kt index e30de6544f..c8be8b0d6a 100644 --- a/alchemist-webgui/src/commonMain/kotlin/graphql/api/SimulationControlApi.kt +++ b/alchemist-webgui/src/commonMain/kotlin/graphql/api/SimulationControlApi.kt @@ -18,6 +18,9 @@ import kotlinx.coroutines.Deferred import kotlinx.coroutines.async import kotlinx.coroutines.coroutineScope +/** + * Provides a set of functions to interact with the simulation control API. + */ object SimulationControlApi { /** diff --git a/alchemist-webgui/src/commonMain/kotlin/utils/SimState.kt b/alchemist-webgui/src/commonMain/kotlin/utils/SimState.kt index ca7cbe9b65..9f9c153caa 100644 --- a/alchemist-webgui/src/commonMain/kotlin/utils/SimState.kt +++ b/alchemist-webgui/src/commonMain/kotlin/utils/SimState.kt @@ -46,7 +46,8 @@ enum class SimState { * Converts a string representation of a simulation status to the corresponding SimState enum value. * * @param value the string representation of the simulation status - * @return the SimState enum value corresponding to the input string, or SimState.TERMINATED if the input is invalid + * @return the SimState enum value corresponding to the input string, or [SimState.TERMINATED] if the input is + * invalid. */ fun toSimStatus(value: String?): SimState { return when (value) {