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"
version = rootProject.ext.get("mirai_version")!!.toString()
val isAndroidSDKAvailable: Boolean by project
kotlin {
val isAndroidSDKAvailable: Boolean by project
if (isAndroidSDKAvailable) {
android("android") {
publishAllLibraryVariants()
@ -96,17 +97,19 @@ kotlin {
}
}
val androidMain by getting {
dependencies {
if (isAndroidSDKAvailable) {
val androidMain by getting {
dependencies {
}
}
}
val androidTest by getting {
dependencies {
api(kotlin("test", kotlinVersion))
api(kotlin("test-junit", kotlinVersion))
api(kotlin("test-annotations-common"))
api(kotlin("test-common"))
val androidTest by getting {
dependencies {
api(kotlin("test", kotlinVersion))
api(kotlin("test-junit", kotlinVersion))
api(kotlin("test-annotations-common"))
api(kotlin("test-common"))
}
}
}

View File

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

View File

@ -29,8 +29,9 @@ fun ktor(id: String, version: String) = "io.ktor:ktor-$id:$version"
description = "QQ protocol library"
val isAndroidSDKAvailable: Boolean by project
kotlin {
val isAndroidSDKAvailable: Boolean by project
if (isAndroidSDKAvailable) {
android("android") {
publishAllLibraryVariants()
@ -108,23 +109,25 @@ kotlin {
}
}
val androidMain by getting {
dependencies {
api(kotlin("reflect", kotlinVersion))
if (isAndroidSDKAvailable) {
val androidMain by getting {
dependencies {
api(kotlin("reflect", kotlinVersion))
api(kotlinx("serialization-runtime", serializationVersion))
api(kotlinx("coroutines-android", coroutinesVersion))
api(kotlinx("serialization-runtime", serializationVersion))
api(kotlinx("coroutines-android", coroutinesVersion))
api(ktor("client-android", ktorVersion))
api(ktor("client-android", ktorVersion))
}
}
}
val androidTest by getting {
dependencies {
api(kotlin("test", kotlinVersion))
api(kotlin("test-junit", kotlinVersion))
api(kotlin("test-annotations-common"))
api(kotlin("test-common"))
val androidTest by getting {
dependencies {
api(kotlin("test", kotlinVersion))
api(kotlin("test-junit", kotlinVersion))
api(kotlin("test-annotations-common"))
api(kotlin("test-common"))
}
}
}