Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions alchemist-web-renderer/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ kotlin {
js(IR) {
browser {
binaries.executable()
testTask {
useKarma {
useChromeHeadless()
}
}
}
}
sourceSets {
Expand Down
65 changes: 28 additions & 37 deletions alchemist-webgui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down Expand Up @@ -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()
}
}
Expand Down Expand Up @@ -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")
Expand All @@ -138,15 +127,17 @@ fun PatternFilterable.excludeGenerated() = exclude { "build${File.separator}gene
tasks.withType<Detekt>().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<Detekt>().configureEach {
dependsOn("kspCommonMainKotlinMetadata")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

/**
Expand Down
3 changes: 2 additions & 1 deletion alchemist-webgui/src/commonMain/kotlin/utils/SimState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down