cah
12/27/2021, 12:00 AMBig Chungus
12/27/2021, 12:33 AMcah
12/27/2021, 12:39 AMimplementation("io.ktor:ktor-client-core:$ktor_version")
implementation("io.ktor:ktor-client-cio:$ktor_version")
implementation("io.ktor:ktor-server-core:$ktor_version")
implementation("io.ktor:ktor-server-netty:$ktor_version")
Aleksei Tirman [JB]
12/27/2021, 9:48 AMcah
12/27/2021, 12:33 PMCannot access class 'io.ktor.util.pipeline.PipelineContext'. Check your module classpath for missing or conflicting dependencies
Cannot access class 'kotlin.Pair'. Check your module classpath for missing or conflicting dependencies
Big Chungus
12/27/2021, 12:35 PMcah
12/27/2021, 12:36 PMBig Chungus
12/27/2021, 12:36 PMcah
12/27/2021, 12:37 PMimport org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpack
plugins {
kotlin("multiplatform") version "1.6.10"
id("org.jetbrains.compose") version "1.0.1"
application
}
group = "com.redacted"
version = "1.0"
val ktor_version = "2.0.0-beta-1"
val koin_version = "3.1.4"
val coroutines_version = "1.0.0"
val logback_version = "1.0.0"
repositories {
google()
mavenCentral()
maven("<https://maven.pkg.jetbrains.space/public/p/compose/dev>")
}
kotlin {
jvm {
withJava()
}
js(IR) {
browser()
binaries.executable()
}
sourceSets {
val commonMain by getting {
dependencies {
//compose
implementation(compose.runtime)
//ktor
implementation("io.ktor:ktor-client-core:$ktor_version")
//coroutines
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
}
}
val commonTest by getting
val jsMain by getting {
dependencies {
//compose
implementation(compose.web.core)
//ktor
implementation("io.ktor:ktor-client-js:$ktor_version")
}
}
val jsTest by getting {
dependencies {
implementation(kotlin("test-js"))
}
}
val jvmMain by getting {
dependencies {
//koin
implementation("io.insert-koin:koin-core:$koin_version")
implementation("io.insert-koin:koin-ktor:$koin_version")
//ktor
implementation("io.ktor:ktor-client-cio:$ktor_version")
implementation("io.ktor:ktor-client-websockets:$ktor_version")
implementation("io.ktor:ktor-server-core:$ktor_version")
implementation("io.ktor:ktor-server-netty:$ktor_version")
//logback
implementation("ch.qos.logback:logback-classic:$logback_version")
}
}
val jvmTest by getting
}
}
application {
mainClass.set("com.redacted.server.ServerKt")
}
// include JS artifacts in any JAR we generate
tasks.getByName<Jar>("jvmJar") {
val taskName = if (project.hasProperty("isProduction")
|| project.gradle.startParameter.taskNames.contains("installDist")
) {
"jsBrowserProductionWebpack"
} else {
"jsBrowserDevelopmentWebpack"
}
val webpackTask = tasks.getByName<KotlinWebpack>(taskName)
dependsOn(webpackTask) // make sure JS gets compiled first
from(File(webpackTask.destinationDirectory, webpackTask.outputFileName)) // bring output file along into the JAR
}
tasks.getByName<JavaExec>("run") {
classpath(tasks.getByName<Jar>("jvmJar")) // so that the JS artifacts generated by `jvmJar` can be found and served
}
Big Chungus
12/27/2021, 12:38 PMcah
12/27/2021, 12:41 PMCannot access class 'io.ktor.http.ContentType'. Check your module classpath for missing or conflicting dependencies
Cannot access class 'io.ktor.http.HttpStatusCode'. Check your module classpath for missing or conflicting dependencies
Big Chungus
12/27/2021, 12:41 PMcah
12/27/2021, 12:42 PMBig Chungus
12/27/2021, 12:43 PMcah
12/27/2021, 12:43 PMBig Chungus
12/27/2021, 12:44 PMcah
12/27/2021, 12:44 PMAleksei Tirman [JB]
12/27/2021, 12:52 PMcah
12/27/2021, 1:45 PMAleksei Tirman [JB]
12/27/2021, 2:42 PMcah
12/27/2021, 2:58 PM