From 616dacc6253dc6e659adb13fd36037fc74ee8f95 Mon Sep 17 00:00:00 2001 From: Him188 Date: Fri, 6 Dec 2019 23:50:54 +0800 Subject: [PATCH] Load kotlin multiplatform plugin first --- mirai-core/build.gradle.kts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/mirai-core/build.gradle.kts b/mirai-core/build.gradle.kts index 6a9748161..942ba47fa 100644 --- a/mirai-core/build.gradle.kts +++ b/mirai-core/build.gradle.kts @@ -1,8 +1,8 @@ @file:Suppress("UNUSED_VARIABLE") plugins { - id("kotlinx-atomicfu") kotlin("multiplatform") + id("kotlinx-atomicfu") id("com.android.library") id("kotlinx-serialization") `maven-publish` @@ -81,12 +81,16 @@ kotlin { api(ktor("client-core", ktorVersion)) api(ktor("network", ktorVersion)) //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 { dependencies { api(kotlin("test-annotations-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")) } @@ -111,18 +115,19 @@ kotlin { api(ktor("client-core-jvm", ktorVersion)) api(kotlinx("io-jvm", kotlinXIoVersion)) api(kotlinx("serialization-runtime", serializationVersion)) + + runtimeOnly(files("build/classes/kotlin/jvm/main")) // classpath is not properly set by IDE } } val jvmTest by getting { dependencies { api(kotlin("test", kotlinVersion)) - api(kotlin("test-annotations-common", kotlinVersion)) - api(kotlin("test-junit5", kotlinVersion)) - api("org.junit.jupiter:junit-jupiter-api:5.5.2") + api(kotlin("test-junit", kotlinVersion)) + implementation("org.pcap4j:pcap4j-distribution:1.8.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")) } } } \ No newline at end of file