This commit is contained in:
Him188 2020-01-05 18:16:11 +08:00
parent 27819d7343
commit b9e00f4169
3 changed files with 43 additions and 34 deletions

View File

@ -30,8 +30,9 @@ fun ktor(id: String, version: String) = "io.ktor:ktor-$id:$version"
description = "QQ protocol library" description = "QQ protocol library"
version = rootProject.ext.get("mirai_version")!!.toString() version = rootProject.ext.get("mirai_version")!!.toString()
kotlin {
val isAndroidSDKAvailable: Boolean by project val isAndroidSDKAvailable: Boolean by project
kotlin {
if (isAndroidSDKAvailable) { if (isAndroidSDKAvailable) {
android("android") { android("android") {
publishAllLibraryVariants() publishAllLibraryVariants()
@ -96,6 +97,7 @@ kotlin {
} }
} }
if (isAndroidSDKAvailable) {
val androidMain by getting { val androidMain by getting {
dependencies { dependencies {
} }
@ -109,6 +111,7 @@ kotlin {
api(kotlin("test-common")) api(kotlin("test-common"))
} }
} }
}
val jvmMain by getting { val jvmMain by getting {
dependencies { dependencies {

View File

@ -30,8 +30,9 @@ fun ktor(id: String, version: String) = "io.ktor:ktor-$id:$version"
description = "QQ protocol library" description = "QQ protocol library"
version = rootProject.ext.get("mirai_version")!!.toString() version = rootProject.ext.get("mirai_version")!!.toString()
kotlin {
val isAndroidSDKAvailable: Boolean by project val isAndroidSDKAvailable: Boolean by project
kotlin {
if (isAndroidSDKAvailable) { if (isAndroidSDKAvailable) {
android("android") { android("android") {
publishAllLibraryVariants() publishAllLibraryVariants()
@ -95,6 +96,7 @@ kotlin {
} }
} }
if (isAndroidSDKAvailable) {
val androidMain by getting { val androidMain by getting {
dependencies { dependencies {
} }
@ -108,6 +110,7 @@ kotlin {
api(kotlin("test-common")) api(kotlin("test-common"))
} }
} }
}
val jvmMain by getting { val jvmMain by getting {
dependencies { dependencies {

View File

@ -29,8 +29,9 @@ fun ktor(id: String, version: String) = "io.ktor:ktor-$id:$version"
description = "QQ protocol library" description = "QQ protocol library"
kotlin {
val isAndroidSDKAvailable: Boolean by project val isAndroidSDKAvailable: Boolean by project
kotlin {
if (isAndroidSDKAvailable) { if (isAndroidSDKAvailable) {
android("android") { android("android") {
publishAllLibraryVariants() publishAllLibraryVariants()
@ -108,6 +109,7 @@ kotlin {
} }
} }
if (isAndroidSDKAvailable) {
val androidMain by getting { val androidMain by getting {
dependencies { dependencies {
api(kotlin("reflect", kotlinVersion)) api(kotlin("reflect", kotlinVersion))
@ -127,6 +129,7 @@ kotlin {
api(kotlin("test-common")) api(kotlin("test-common"))
} }
} }
}
val jvmMain by getting { val jvmMain by getting {
dependencies { dependencies {