35bca103eb
In this project it's required to declare stdlib dependency explicitly, but now it can be a single line in commonMain
77 lines
2.3 KiB
Kotlin
77 lines
2.3 KiB
Kotlin
import org.jetbrains.kotlin.gradle.dsl.JsModuleKind.MODULE_COMMONJS
|
|
import org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrLink
|
|
|
|
buildscript {
|
|
val rootBuildDirectory by extra(file("../.."))
|
|
|
|
java.util.Properties().also {
|
|
it.load(java.io.FileReader(project.file("$rootBuildDirectory/../gradle.properties")))
|
|
}.forEach { k, v ->
|
|
val key = k as String
|
|
val value = project.findProperty(key) ?: v
|
|
extra[key] = value
|
|
}
|
|
|
|
extra["withoutEmbedabble"] = true
|
|
extra["defaultSnapshotVersion"] = kotlinBuildProperties.defaultSnapshotVersion
|
|
extra["kotlinVersion"] = findProperty("kotlinVersion")
|
|
val bootstrapKotlinVersion: String by extra(project.bootstrapKotlinVersion)
|
|
val kotlinVersion: String by extra(bootstrapKotlinVersion)
|
|
|
|
apply(from = "$rootBuildDirectory/gradle/loadRootProperties.gradle")
|
|
apply(from = "$rootBuildDirectory/gradle/kotlinGradlePlugin.gradle")
|
|
}
|
|
|
|
plugins {
|
|
kotlin("multiplatform")
|
|
}
|
|
|
|
val kotlinVersion: String by extra(bootstrapKotlinVersion)
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
kotlin {
|
|
sourceSets {
|
|
val commonMain by getting {
|
|
dependencies {
|
|
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
|
|
}
|
|
kotlin.srcDir("../benchmarks/shared/src")
|
|
}
|
|
val jsMain by creating {
|
|
dependencies {
|
|
implementation(npm("body-parser", "~1.20.0"))
|
|
implementation(npm("debug", "~4.3.4"))
|
|
implementation(npm("ejs", "~3.1.7"))
|
|
implementation(npm("express", "~4.18.1"))
|
|
implementation(npm("kotlin", "~1.6.20"))
|
|
implementation(npm("node-fetch", "~2.6.6"))
|
|
}
|
|
kotlin {
|
|
srcDir("src/main/kotlin")
|
|
srcDir("src/main/kotlin-js")
|
|
srcDir("shared/src/main/kotlin")
|
|
}
|
|
}
|
|
}
|
|
|
|
targets {
|
|
js {
|
|
moduleName = "app"
|
|
nodejs()
|
|
compilations.all {
|
|
compilerOptions.configure {
|
|
moduleKind.set(MODULE_COMMONJS)
|
|
sourceMap.set(true)
|
|
}
|
|
}
|
|
binaries.executable()
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.withType<KotlinJsIrLink> {
|
|
destinationDirectory.set(project.file("server"))
|
|
} |