thanksforallthefish
04/22/2021, 1:17 PMcommonMain
I have
package ...
class HateoasObjectImpl(val any: Map<String, *>) : HateoasObject {
override fun getLink(name: String): Link {
TODO("Not yet implemented")
}
override fun getHint(name: String): Hint {
TODO("Not yet implemented")
}
override fun getLinkAndHint(name: String): Pair<Link, Hint> {
TODO("Not yet implemented")
}
}
in jsTest
can I somehow reference this code in a js
file? or that is not possible, since js code is generated when running gradle?Anton Lakotka [JB]
04/29/2021, 8:57 AMthanksforallthefish
04/29/2021, 12:43 PMplugins {
kotlin("multiplatform") version "1.4.32"
kotlin("plugin.serialization") version "1.4.32"
id("maven-publish")
}
version = "1.0-SNAPSHOT"
val ktor_version = "1.5.3"
repositories {
mavenCentral()
}
dependencies {
}
kotlin {
jvm {
compilations.all {
kotlinOptions.jvmTarget = "11"
}
testRuns["test"].executionTask.configure {
useJUnit()
}
}
js(IR) {
useCommonJs()
browser {
commonWebpackConfig {
cssSupport.enabled = true
}
}
}
val hostOs = System.getProperty("os.name")
val isMingwX64 = hostOs.startsWith("Windows")
val nativeTarget = when {
hostOs == "Mac OS X" -> macosX64("native")
hostOs == "Linux" -> linuxX64("native")
isMingwX64 -> mingwX64("native")
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
}
sourceSets {
val commonMain by getting {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.1.0")
implementation("io.ktor:ktor-client-core:$ktor_version")
implementation("io.ktor:ktor-client-serialization:$ktor_version")
// implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3")
// implementation("org.springframework.hateoas:spring-hateoas:1.3.0")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
implementation("io.ktor:ktor-client-mock:$ktor_version")
}
}
val jvmMain by getting {
dependencies {
implementation(kotlin("reflect"))
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.11.4")
implementation("io.ktor:ktor-client-cio:$ktor_version")
implementation("io.ktor:ktor-client-jackson:$ktor_version")
}
}
val jvmTest by getting {
dependencies {
implementation(kotlin("test-junit"))
implementation("com.github.tomakehurst:wiremock-jre8:2.27.2")
}
}
val jsMain by getting {
dependencies {
implementation("io.ktor:ktor-client-js:$ktor_version")
}
}
val jsTest by getting {
dependencies {
implementation(kotlin("test-js"))
}
}
val nativeMain by getting
val nativeTest by getting
}
}
Anton Lakotka [JB]
04/29/2021, 3:51 PM