Load kotlin multiplatform plugin first

This commit is contained in:
Him188 2019-12-06 23:50:54 +08:00
parent 9572b896ce
commit 616dacc625

View File

@ -1,8 +1,8 @@
@file:Suppress("UNUSED_VARIABLE") @file:Suppress("UNUSED_VARIABLE")
plugins { plugins {
id("kotlinx-atomicfu")
kotlin("multiplatform") kotlin("multiplatform")
id("kotlinx-atomicfu")
id("com.android.library") id("com.android.library")
id("kotlinx-serialization") id("kotlinx-serialization")
`maven-publish` `maven-publish`
@ -81,12 +81,16 @@ kotlin {
api(ktor("client-core", ktorVersion)) api(ktor("client-core", ktorVersion))
api(ktor("network", ktorVersion)) api(ktor("network", ktorVersion))
//implementation("io.ktor:ktor-io:1.3.0-beta-1") //implementation("io.ktor:ktor-io:1.3.0-beta-1")
runtimeOnly(files("build/classes/kotlin/metadata/main")) // classpath is not properly set by IDE
} }
} }
commonTest { commonTest {
dependencies { dependencies {
api(kotlin("test-annotations-common")) api(kotlin("test-annotations-common"))
api(kotlin("test-common")) api(kotlin("test-common"))
runtimeOnly(files("build/classes/kotlin/metadata/test")) // classpath is not properly set by IDE
} }
kotlin.setSrcDirs(listOf("src/$name/kotlin")) kotlin.setSrcDirs(listOf("src/$name/kotlin"))
} }
@ -111,18 +115,19 @@ kotlin {
api(ktor("client-core-jvm", ktorVersion)) api(ktor("client-core-jvm", ktorVersion))
api(kotlinx("io-jvm", kotlinXIoVersion)) api(kotlinx("io-jvm", kotlinXIoVersion))
api(kotlinx("serialization-runtime", serializationVersion)) api(kotlinx("serialization-runtime", serializationVersion))
runtimeOnly(files("build/classes/kotlin/jvm/main")) // classpath is not properly set by IDE
} }
} }
val jvmTest by getting { val jvmTest by getting {
dependencies { dependencies {
api(kotlin("test", kotlinVersion)) api(kotlin("test", kotlinVersion))
api(kotlin("test-annotations-common", kotlinVersion)) api(kotlin("test-junit", kotlinVersion))
api(kotlin("test-junit5", kotlinVersion)) implementation("org.pcap4j:pcap4j-distribution:1.8.2")
api("org.junit.jupiter:junit-jupiter-api:5.5.2")
} runtimeOnly(files("build/classes/kotlin/jvm/test")) // classpath is not properly set by IDE
kotlin.outputDir = file("build/classes/kotlin/jvm/test") }
kotlin.setSrcDirs(listOf("src/$name/kotlin"))
} }
} }
} }