Yousef
06/16/2022, 4:28 PMYousef
06/16/2022, 4:29 PMplugins {
kotlin("multiplatform") version "1.7.0"
application
id("com.android.application")
id("kotlin-android-extensions")
}
group = "net.virtualcoder"
version = "1.0-SNAPSHOT"
repositories {
google()
jcenter()
mavenCentral()
maven("<https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven>")
}
kotlin {
jvm {
compilations.all {
kotlinOptions.jvmTarget = "1.8"
}
testRuns["test"].executionTask.configure {
useJUnitPlatform()
}
}
js(LEGACY) {
binaries.executable()
browser {
commonWebpackConfig {
cssSupport.enabled = true
}
}
}
android()
sourceSets {
val commonMain by getting
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
val jvmMain by getting {
dependencies {
implementation("io.ktor:ktor-server-netty:2.0.1")
implementation("io.ktor:ktor-server-html-builder-jvm:2.0.1")
implementation("org.jetbrains.kotlinx:kotlinx-html-jvm:0.7.2")
}
}
val jvmTest by getting
val jsMain by getting {
dependencies {
implementation("org.jetbrains.kotlin-wrappers:kotlin-react:18.0.0-pre.332-kotlin-1.6.21")
implementation("org.jetbrains.kotlin-wrappers:kotlin-react-dom:18.0.0-pre.332-kotlin-1.6.21")
implementation("org.jetbrains.kotlin-wrappers:kotlin-emotion:11.9.0-pre.332-kotlin-1.6.21")
}
}
val jsTest by getting
val androidMain by getting {
dependencies {
implementation("com.google.android.material:material:1.5.0")
}
}
val androidTest by getting {
dependencies {
implementation("junit:junit:4.13.2")
}
}
}
}
android {
compileSdkVersion(31)
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
applicationId = "net.virtualcoder.application"
minSdkVersion(24)
targetSdkVersion(31)
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
application {
mainClass.set("net.virtualcoder.application.ServerKt")
}
tasks.named<Copy>("jvmProcessResources") {
val jsBrowserDistribution = tasks.named("jsBrowserDistribution")
from(jsBrowserDistribution)
}
tasks.named<JavaExec>("run") {
dependsOn(tasks.named<Jar>("jvmJar"))
classpath(tasks.named<Jar>("jvmJar"))
}
ephemient
06/16/2022, 4:29 PMapplication
pluginLandry Norris
06/16/2022, 4:30 PMephemient
06/16/2022, 4:30 PMwithJava
Yousef
06/16/2022, 4:31 PMLandry Norris
06/16/2022, 4:31 PMephemient
06/16/2022, 4:31 PMwithJava
and Androidephemient
06/16/2022, 4:32 PMYousef
06/16/2022, 4:33 PMLandry Norris
06/16/2022, 4:34 PMLandry Norris
06/16/2022, 4:35 PMephemient
06/16/2022, 4:36 PMLandry Norris
06/16/2022, 4:37 PMYousef
06/16/2022, 4:37 PMStylianos Gakis
06/20/2022, 11:18 AM