mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-08 09:10:11 +08:00
Fix NPE
This commit is contained in:
parent
27819d7343
commit
b9e00f4169
@ -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()
|
||||||
|
|
||||||
|
val isAndroidSDKAvailable: Boolean by project
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
val isAndroidSDKAvailable: Boolean by project
|
|
||||||
if (isAndroidSDKAvailable) {
|
if (isAndroidSDKAvailable) {
|
||||||
android("android") {
|
android("android") {
|
||||||
publishAllLibraryVariants()
|
publishAllLibraryVariants()
|
||||||
@ -96,17 +97,19 @@ kotlin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val androidMain by getting {
|
if (isAndroidSDKAvailable) {
|
||||||
dependencies {
|
val androidMain by getting {
|
||||||
|
dependencies {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
val androidTest by getting {
|
val androidTest by getting {
|
||||||
dependencies {
|
dependencies {
|
||||||
api(kotlin("test", kotlinVersion))
|
api(kotlin("test", kotlinVersion))
|
||||||
api(kotlin("test-junit", kotlinVersion))
|
api(kotlin("test-junit", kotlinVersion))
|
||||||
api(kotlin("test-annotations-common"))
|
api(kotlin("test-annotations-common"))
|
||||||
api(kotlin("test-common"))
|
api(kotlin("test-common"))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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()
|
||||||
|
|
||||||
|
val isAndroidSDKAvailable: Boolean by project
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
val isAndroidSDKAvailable: Boolean by project
|
|
||||||
if (isAndroidSDKAvailable) {
|
if (isAndroidSDKAvailable) {
|
||||||
android("android") {
|
android("android") {
|
||||||
publishAllLibraryVariants()
|
publishAllLibraryVariants()
|
||||||
@ -95,17 +96,19 @@ kotlin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val androidMain by getting {
|
if (isAndroidSDKAvailable) {
|
||||||
dependencies {
|
val androidMain by getting {
|
||||||
|
dependencies {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
val androidTest by getting {
|
val androidTest by getting {
|
||||||
dependencies {
|
dependencies {
|
||||||
api(kotlin("test", kotlinVersion))
|
api(kotlin("test", kotlinVersion))
|
||||||
api(kotlin("test-junit", kotlinVersion))
|
api(kotlin("test-junit", kotlinVersion))
|
||||||
api(kotlin("test-annotations-common"))
|
api(kotlin("test-annotations-common"))
|
||||||
api(kotlin("test-common"))
|
api(kotlin("test-common"))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,8 +29,9 @@ fun ktor(id: String, version: String) = "io.ktor:ktor-$id:$version"
|
|||||||
|
|
||||||
description = "QQ protocol library"
|
description = "QQ protocol library"
|
||||||
|
|
||||||
|
val isAndroidSDKAvailable: Boolean by project
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
val isAndroidSDKAvailable: Boolean by project
|
|
||||||
if (isAndroidSDKAvailable) {
|
if (isAndroidSDKAvailable) {
|
||||||
android("android") {
|
android("android") {
|
||||||
publishAllLibraryVariants()
|
publishAllLibraryVariants()
|
||||||
@ -108,23 +109,25 @@ kotlin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val androidMain by getting {
|
if (isAndroidSDKAvailable) {
|
||||||
dependencies {
|
val androidMain by getting {
|
||||||
api(kotlin("reflect", kotlinVersion))
|
dependencies {
|
||||||
|
api(kotlin("reflect", kotlinVersion))
|
||||||
|
|
||||||
api(kotlinx("serialization-runtime", serializationVersion))
|
api(kotlinx("serialization-runtime", serializationVersion))
|
||||||
api(kotlinx("coroutines-android", coroutinesVersion))
|
api(kotlinx("coroutines-android", coroutinesVersion))
|
||||||
|
|
||||||
api(ktor("client-android", ktorVersion))
|
api(ktor("client-android", ktorVersion))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
val androidTest by getting {
|
val androidTest by getting {
|
||||||
dependencies {
|
dependencies {
|
||||||
api(kotlin("test", kotlinVersion))
|
api(kotlin("test", kotlinVersion))
|
||||||
api(kotlin("test-junit", kotlinVersion))
|
api(kotlin("test-junit", kotlinVersion))
|
||||||
api(kotlin("test-annotations-common"))
|
api(kotlin("test-annotations-common"))
|
||||||
api(kotlin("test-common"))
|
api(kotlin("test-common"))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user