mirai/mirai-api-http/build.gradle.kts

76 lines
2.4 KiB
Plaintext
Raw Normal View History

2019-11-21 21:31:05 +08:00
@file:Suppress("UNUSED_VARIABLE")
2019-12-02 17:57:14 +08:00
import org.jetbrains.kotlin.gradle.plugin.KotlinDependencyHandler
2019-11-21 21:31:05 +08:00
plugins {
id("kotlinx-atomicfu")
kotlin("jvm")
id("kotlinx-serialization")
}
group = "net.mamoe.mirai"
2019-11-23 22:34:57 +08:00
version = rootProject.ext["mirai_version"].toString()
2019-11-21 21:31:05 +08:00
description = "Mirai Http Api"
val kotlinVersion: String by rootProject.ext
val atomicFuVersion: String by rootProject.ext
val coroutinesVersion: String by rootProject.ext
val kotlinXIoVersion: String by rootProject.ext
val coroutinesIoVersion: String by rootProject.ext
val klockVersion: String by rootProject.ext
val ktorVersion: String by rootProject.ext
val serializationVersion: String by rootProject.ext
2019-12-02 17:57:14 +08:00
fun KotlinDependencyHandler.kotlinx(id: String, version: String) = "org.jetbrains.kotlinx:kotlinx-$id:$version"
2019-11-21 21:31:05 +08:00
2019-12-02 17:57:14 +08:00
fun KotlinDependencyHandler.ktor(id: String, version: String = ktorVersion) = "io.ktor:ktor-$id:$version"
2019-11-21 21:31:05 +08:00
kotlin {
sourceSets["main"].apply {
dependencies {
2020-02-02 23:20:34 +08:00
implementation(project(":mirai-core-qqandroid"))
2019-11-21 21:31:05 +08:00
2019-12-02 17:57:14 +08:00
implementation(kotlin("stdlib-jdk8", kotlinVersion))
implementation(kotlin("stdlib-jdk7", kotlinVersion))
implementation(kotlin("reflect", kotlinVersion))
2019-11-21 21:31:05 +08:00
2019-12-02 17:57:14 +08:00
implementation(ktor("server-cio"))
implementation(kotlinx("io-jvm", kotlinXIoVersion))
implementation(ktor("http-jvm"))
2020-02-03 03:12:44 +08:00
implementation("org.slf4j:slf4j-simple:1.7.26")
2019-11-21 21:31:05 +08:00
}
}
sourceSets["test"].apply {
dependencies {
}
kotlin.outputDir = file("build/classes/kotlin/jvm/test")
kotlin.setSrcDirs(listOf("src/$name/kotlin"))
}
sourceSets.all {
languageSettings.enableLanguageFeature("InlineClasses")
2019-11-21 21:31:05 +08:00
languageSettings.useExperimentalAnnotation("kotlin.Experimental")
dependencies {
2019-12-02 17:57:14 +08:00
implementation(kotlin("stdlib", kotlinVersion))
implementation(kotlin("serialization", kotlinVersion))
implementation("org.jetbrains.kotlinx:atomicfu:$atomicFuVersion")
implementation(kotlinx("io", kotlinXIoVersion))
implementation(kotlinx("coroutines-io", coroutinesIoVersion))
implementation(kotlinx("coroutines-core", coroutinesVersion))
implementation(kotlinx("serialization-runtime", serializationVersion))
implementation(ktor("server-core"))
implementation(ktor("http"))
2019-11-21 21:31:05 +08:00
}
}
}