mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-07 00:20:09 +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"
|
||||
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"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user