2020-11-01 15:07:32 +08:00
|
|
|
/*
|
2023-03-19 03:19:01 +08:00
|
|
|
* Copyright 2019-2023 Mamoe Technologies and contributors.
|
2020-11-01 15:07:32 +08:00
|
|
|
*
|
2022-01-15 02:57:02 +08:00
|
|
|
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
|
|
|
|
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
|
2020-11-01 15:07:32 +08:00
|
|
|
*
|
2022-01-15 02:57:02 +08:00
|
|
|
* https://github.com/mamoe/mirai/blob/dev/LICENSE
|
2020-11-01 15:07:32 +08:00
|
|
|
*/
|
|
|
|
|
2022-11-03 03:28:04 +08:00
|
|
|
@file:Suppress(
|
|
|
|
"ObjectPropertyName", "ObjectPropertyName", "unused", "MemberVisibilityCanBePrivate", "RemoveRedundantBackticks"
|
|
|
|
)
|
2020-11-22 14:25:49 +08:00
|
|
|
|
2022-11-03 03:28:04 +08:00
|
|
|
import org.gradle.api.artifacts.ExternalModuleDependency
|
|
|
|
import org.gradle.api.artifacts.ModuleDependency
|
2020-11-22 14:25:49 +08:00
|
|
|
import org.gradle.api.attributes.Attribute
|
2021-10-31 05:48:37 +08:00
|
|
|
import org.gradle.kotlin.dsl.exclude
|
2021-09-01 18:51:13 +08:00
|
|
|
import org.jetbrains.kotlin.gradle.plugin.KotlinDependencyHandler
|
2020-11-22 14:25:49 +08:00
|
|
|
|
2022-06-26 16:03:15 +08:00
|
|
|
// DO NOT CHANGE FILENAME OR RELATIVE PATH TO ROOT PROJECT.
|
|
|
|
// mirai-deps-test DEPENDS ON THE PATH.
|
|
|
|
|
2020-03-24 10:01:03 +08:00
|
|
|
object Versions {
|
2022-07-02 16:10:20 +08:00
|
|
|
val project = System.getenv("mirai.build.project.version")?.takeIf { it.isNotBlank() }
|
|
|
|
?: System.getProperty("mirai.build.project.version")?.takeIf { it.isNotBlank() }
|
2023-10-10 17:33:12 +08:00
|
|
|
?: /*PROJECT_VERSION_START*/"2.16.0"/*PROJECT_VERSION_END*/
|
2022-11-23 20:53:55 +08:00
|
|
|
// DO NOT ADD SPACE BETWEEN!
|
2021-01-28 11:59:15 +08:00
|
|
|
|
2022-11-23 20:53:55 +08:00
|
|
|
val core get() = project
|
|
|
|
val console get() = project
|
2023-08-20 15:21:57 +08:00
|
|
|
val consoleIntellij get() = "232-$project-182-1" // idea-mirai-kotlin-patch
|
2022-11-23 20:53:55 +08:00
|
|
|
val consoleTerminal get() = project
|
2020-10-03 13:35:05 +08:00
|
|
|
|
2023-03-22 07:08:15 +08:00
|
|
|
const val kotlinCompiler = "1.8.10"
|
2021-11-18 11:05:50 +08:00
|
|
|
const val kotlinStdlib = kotlinCompiler
|
2023-04-25 18:35:17 +08:00
|
|
|
const val kotlinLanguageVersionForTests = "1.9" // be curious!
|
|
|
|
|
2023-03-19 03:19:01 +08:00
|
|
|
const val dokka = "1.8.10"
|
2021-01-12 18:57:42 +08:00
|
|
|
|
2023-08-20 15:21:57 +08:00
|
|
|
const val kotlinCompilerForIdeaPlugin = "1.8.20" // 232 bundles 1.8.20
|
2022-02-12 20:45:09 +08:00
|
|
|
|
2022-08-15 18:36:07 +08:00
|
|
|
const val coroutines = "1.6.4"
|
2023-03-19 03:19:01 +08:00
|
|
|
const val atomicFU = "0.20.0"
|
|
|
|
const val serialization = "1.5.0"
|
2022-11-02 20:01:56 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 注意, 不要轻易升级 ktor 版本. 阅读 [RelocationNotes], 尤其是间接依赖部分.
|
|
|
|
*/
|
2022-08-15 18:36:07 +08:00
|
|
|
const val ktor = "2.1.0"
|
2022-11-03 03:28:04 +08:00
|
|
|
const val okhttp = "4.9.3" // 需要跟 Ktor 依赖的相同, 用于 shadow 后携带到 runtime
|
|
|
|
const val okio = "3.2.0" // 需要跟 OkHttp 依赖的相同, 用于 shadow 后携带到 runtime
|
2020-10-03 13:35:05 +08:00
|
|
|
|
2021-02-24 12:15:19 +08:00
|
|
|
const val binaryValidator = "0.4.0"
|
2020-10-03 13:35:05 +08:00
|
|
|
|
2023-03-19 03:19:01 +08:00
|
|
|
const val blockingBridge = "3.0.0-180.1"
|
|
|
|
const val dynamicDelegation = "0.4.0-180.1"
|
|
|
|
const val mavenCentralPublish = "1.0.0"
|
2020-10-03 13:35:05 +08:00
|
|
|
|
2023-04-17 18:40:28 +08:00
|
|
|
const val androidGradlePlugin = "7.3.1"
|
2021-02-01 12:23:04 +08:00
|
|
|
const val android = "4.1.1.4"
|
2023-05-02 04:32:41 +08:00
|
|
|
const val androidxAnnotation = "1.6.0"
|
2020-10-03 13:35:05 +08:00
|
|
|
|
2023-03-19 03:19:01 +08:00
|
|
|
const val shadow = "8.1.0"
|
2020-10-03 13:35:05 +08:00
|
|
|
|
2022-11-11 17:53:44 +08:00
|
|
|
const val logback = "1.3.4"
|
2022-11-10 22:24:08 +08:00
|
|
|
const val slf4j = "2.0.3"
|
2022-11-11 13:35:34 +08:00
|
|
|
const val log4j = "2.19.0"
|
2022-11-08 17:49:57 +08:00
|
|
|
const val asm = "9.4"
|
2021-04-05 22:41:26 +08:00
|
|
|
const val difflib = "1.3.0"
|
2023-07-15 09:44:00 +08:00
|
|
|
const val netty = "4.1.94.Final"
|
|
|
|
const val bouncycastle = "1.70"
|
2022-01-15 20:37:26 +08:00
|
|
|
const val mavenArtifactResolver = "1.7.3"
|
|
|
|
const val mavenResolverProvider = "3.8.4"
|
2021-01-28 09:32:23 +08:00
|
|
|
|
2021-05-20 19:45:33 +08:00
|
|
|
const val junit = "5.7.2"
|
2021-01-29 07:44:22 +08:00
|
|
|
|
2022-05-17 17:21:08 +08:00
|
|
|
const val yamlkt = "0.12.0"
|
2023-08-20 15:21:57 +08:00
|
|
|
const val intellijGradlePlugin = "1.15.0"
|
2021-12-28 00:57:33 +08:00
|
|
|
|
2022-09-10 12:49:13 +08:00
|
|
|
// https://github.com/google/jimfs
|
|
|
|
// Java In Memory File System
|
|
|
|
const val jimfs = "1.2"
|
|
|
|
|
2022-11-28 03:58:28 +08:00
|
|
|
const val jline = "3.21.0"
|
|
|
|
const val jansi = "2.4.0"
|
|
|
|
|
2022-09-10 12:49:13 +08:00
|
|
|
|
2022-07-20 18:50:50 +08:00
|
|
|
// don't update easily unless you want your disk space -= 1000 MB
|
|
|
|
// (700 MB for IDEA, 150 MB for sources, 150 MB for JBR)
|
2023-08-20 15:21:57 +08:00
|
|
|
const val intellij = "2023.2"
|
2020-03-24 10:01:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
@Suppress("unused")
|
2020-03-24 18:11:14 +08:00
|
|
|
fun kotlinx(id: String, version: String) = "org.jetbrains.kotlinx:kotlinx-$id:$version"
|
2020-03-24 10:01:03 +08:00
|
|
|
|
|
|
|
@Suppress("unused")
|
2020-10-03 13:35:05 +08:00
|
|
|
fun ktor(id: String, version: String = Versions.ktor) = "io.ktor:ktor-$id:$version"
|
|
|
|
|
2022-05-17 16:43:09 +08:00
|
|
|
val `kotlinx-coroutines-core` = kotlinx("coroutines-core", Versions.coroutines)
|
2022-06-14 19:43:43 +08:00
|
|
|
val `kotlinx-coroutines-test` = kotlinx("coroutines-test", Versions.coroutines)
|
2021-01-11 18:36:04 +08:00
|
|
|
val `kotlinx-coroutines-jdk8` = kotlinx("coroutines-jdk8", Versions.coroutines)
|
2021-03-19 23:12:02 +08:00
|
|
|
val `kotlinx-coroutines-swing` = kotlinx("coroutines-swing", Versions.coroutines)
|
2021-06-08 12:25:08 +08:00
|
|
|
val `kotlinx-coroutines-debug` = kotlinx("coroutines-debug", Versions.coroutines)
|
2022-05-17 16:43:09 +08:00
|
|
|
val `kotlinx-serialization-core` = kotlinx("serialization-core", Versions.serialization)
|
|
|
|
val `kotlinx-serialization-json` = kotlinx("serialization-json", Versions.serialization)
|
|
|
|
val `kotlinx-serialization-protobuf` = kotlinx("serialization-protobuf", Versions.serialization)
|
|
|
|
const val `kotlinx-atomicfu` = "org.jetbrains.kotlinx:atomicfu:${Versions.atomicFU}"
|
2021-09-01 18:51:13 +08:00
|
|
|
|
2023-03-19 03:19:01 +08:00
|
|
|
const val `kotlin-jvm-blocking-bridge` = "me.him188:kotlin-jvm-blocking-bridge-runtime:${Versions.blockingBridge}"
|
|
|
|
const val `kotlin-dynamic-delegation` = "me.him188:kotlin-dynamic-delegation:${Versions.dynamicDelegation}"
|
|
|
|
|
2022-11-03 03:28:04 +08:00
|
|
|
/**
|
|
|
|
* @see relocateImplementation
|
|
|
|
*/
|
|
|
|
class RelocatedDependency(
|
2022-11-27 21:52:11 +08:00
|
|
|
/**
|
|
|
|
* Dependency notation, e.g. `io.ktor:ktor-io:2.1.0`
|
|
|
|
*/
|
2022-11-03 03:28:04 +08:00
|
|
|
val notation: String,
|
2022-11-27 21:52:11 +08:00
|
|
|
/**
|
|
|
|
* Kotlin packages. e.g. `io.ktor`
|
|
|
|
*/
|
2022-11-03 03:28:04 +08:00
|
|
|
vararg val packages: String,
|
2023-04-29 22:02:05 +08:00
|
|
|
/**
|
|
|
|
* Exclude them, so no transitive dependencies exposed to Maven and Kotlin JVM consumers
|
|
|
|
*/
|
|
|
|
val notationsToExcludeInPom: RelocatableDependency = MultiplatformDependency.jvm(
|
|
|
|
notation.substringBefore(":"),
|
|
|
|
notation.substringAfter(":").substringBeforeLast(":")
|
|
|
|
),
|
2022-11-03 03:28:04 +08:00
|
|
|
/**
|
|
|
|
* Additional exclusions apart from everything from `org.jetbrains.kotlin` and `org.jetbrains.kotlinx`.
|
|
|
|
*/
|
|
|
|
val exclusionAction: ExternalModuleDependency.() -> Unit = {},
|
|
|
|
)
|
2022-05-19 01:46:38 +08:00
|
|
|
|
2022-05-17 16:43:09 +08:00
|
|
|
fun KotlinDependencyHandler.implementationKotlinxIo(module: String) {
|
|
|
|
implementation(module) {
|
2021-09-01 18:51:13 +08:00
|
|
|
/*
|
|
|
|
| +--- org.jetbrains.kotlinx:kotlinx-io-jvm:0.1.16
|
|
|
|
| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.60 -> 1.5.30 (*)
|
|
|
|
| | +--- org.jetbrains.kotlinx:atomicfu:0.14.1
|
|
|
|
| | +--- org.jetbrains.kotlinx:atomicfu-common:0.14.1
|
|
|
|
| | \--- org.jetbrains.kotlinx:kotlinx-io:0.1.16
|
|
|
|
| | \--- org.jetbrains.kotlinx:atomicfu-common:0.14.1
|
|
|
|
*/
|
|
|
|
exclude("org.jetbrains.kotlinx", "kotlinx-coroutines-core-common")
|
|
|
|
exclude("org.jetbrains.kotlinx", "atomicfu")
|
|
|
|
exclude("org.jetbrains.kotlinx", "atomicfu-common")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-29 22:02:05 +08:00
|
|
|
|
|
|
|
class DependencyNotation(
|
|
|
|
val groupId: String,
|
|
|
|
val artifactId: String,
|
|
|
|
) {
|
|
|
|
fun toMap(): Map<String, String> {
|
|
|
|
return mapOf("group" to groupId, "module" to artifactId)
|
|
|
|
}
|
|
|
|
|
|
|
|
override fun toString(): String {
|
|
|
|
return "$groupId:$artifactId"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sealed interface RelocatableDependency {
|
|
|
|
fun notations(): Sequence<DependencyNotation>
|
|
|
|
}
|
|
|
|
|
|
|
|
class SinglePlatformDependency(
|
|
|
|
val groupId: String,
|
|
|
|
val artifactId: String
|
|
|
|
) : RelocatableDependency {
|
|
|
|
override fun notations(): Sequence<DependencyNotation> {
|
|
|
|
return sequenceOf(DependencyNotation(groupId, artifactId))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class CompositeDependency(
|
|
|
|
private val dependencies: List<RelocatableDependency>
|
|
|
|
) : RelocatableDependency {
|
|
|
|
constructor(vararg dependencies: RelocatableDependency) : this(dependencies.toList())
|
|
|
|
|
|
|
|
override fun notations(): Sequence<DependencyNotation> = dependencies.asSequence().flatMap { it.notations() }
|
|
|
|
}
|
|
|
|
|
2022-11-03 03:28:04 +08:00
|
|
|
class MultiplatformDependency private constructor(
|
|
|
|
private val groupId: String,
|
|
|
|
private val baseArtifactId: String,
|
|
|
|
vararg val targets: String,
|
2023-04-29 22:02:05 +08:00
|
|
|
) : RelocatableDependency {
|
|
|
|
override fun notations(): Sequence<DependencyNotation> {
|
|
|
|
return sequenceOf(DependencyNotation(groupId, baseArtifactId))
|
|
|
|
.plus(targets.asSequence().map { DependencyNotation(groupId, "$baseArtifactId-$it") })
|
2022-11-03 03:28:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
companion object {
|
|
|
|
fun jvm(groupId: String, baseArtifactId: String): MultiplatformDependency {
|
|
|
|
return MultiplatformDependency(groupId, baseArtifactId, "common", "metadata", "jvm", "jdk8", "jdk7")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fun ModuleDependency.exclude(multiplatformDependency: MultiplatformDependency) {
|
|
|
|
multiplatformDependency.notations().forEach {
|
2023-04-29 22:02:05 +08:00
|
|
|
exclude(it.toMap())
|
2022-11-03 03:28:04 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
object ExcludeProperties {
|
|
|
|
val `everything from kotlin` = exclude(groupId = "org.jetbrains.kotlin", null)
|
|
|
|
val `everything from kotlinx` = exclude(groupId = "org.jetbrains.kotlinx", null)
|
|
|
|
val `kotlin-stdlib` = multiplatformJvm(groupId = "org.jetbrains.kotlin", "kotlin-stdlib")
|
|
|
|
val `kotlinx-coroutines` = multiplatformJvm(groupId = "org.jetbrains.kotlinx", "kotlinx-coroutines")
|
|
|
|
val `ktor-io` = multiplatformJvm(groupId = "io.ktor", "ktor-io")
|
|
|
|
val `everything from slf4j` = exclude(groupId = "org.slf4j", null)
|
2023-04-17 18:40:28 +08:00
|
|
|
val `slf4j-api` = exclude(groupId = "org.slf4j", "slf4j-api")
|
2022-11-03 03:28:04 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @see org.gradle.kotlin.dsl.exclude
|
|
|
|
*/
|
|
|
|
@OptIn(ExperimentalStdlibApi::class)
|
|
|
|
private fun exclude(
|
|
|
|
groupId: String?, artifactId: String?
|
|
|
|
): Map<String, String> = buildMap {
|
|
|
|
groupId?.let { put("group", groupId) }
|
|
|
|
artifactId?.let { put("module", artifactId) }
|
|
|
|
}
|
|
|
|
|
|
|
|
private fun multiplatformJvm(
|
|
|
|
groupId: String, baseArtifactId: String
|
|
|
|
): MultiplatformDependency = MultiplatformDependency.jvm(groupId, baseArtifactId)
|
|
|
|
}
|
|
|
|
|
|
|
|
val `ktor-io` = ktor("io", Versions.ktor)
|
2023-04-29 22:02:05 +08:00
|
|
|
val `ktor-io_relocated` = RelocatedDependency(
|
|
|
|
`ktor-io`, "io.ktor.utils.io",
|
|
|
|
notationsToExcludeInPom = MultiplatformDependency.jvm("io.ktor", "ktor-io")
|
|
|
|
) {
|
2022-11-03 03:28:04 +08:00
|
|
|
exclude(ExcludeProperties.`everything from slf4j`)
|
2023-04-17 18:40:28 +08:00
|
|
|
exclude(ExcludeProperties.`slf4j-api`)
|
2022-11-03 03:28:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
val `ktor-http` = ktor("http", Versions.ktor)
|
|
|
|
val `ktor-events` = ktor("events", Versions.ktor)
|
2020-10-03 13:35:05 +08:00
|
|
|
val `ktor-serialization` = ktor("serialization", Versions.ktor)
|
2022-11-03 03:28:04 +08:00
|
|
|
val `ktor-websocket-serialization` = ktor("websocket-serialization", Versions.ktor)
|
2020-10-03 13:35:05 +08:00
|
|
|
|
2022-05-19 03:54:47 +08:00
|
|
|
val `ktor-client-core` = ktor("client-core", Versions.ktor)
|
2023-04-29 22:02:05 +08:00
|
|
|
val `ktor-client-core_relocated` = RelocatedDependency(
|
|
|
|
`ktor-client-core`, "io.ktor",
|
|
|
|
notationsToExcludeInPom = CompositeDependency(
|
|
|
|
MultiplatformDependency.jvm("io.ktor", "ktor-io"),
|
|
|
|
MultiplatformDependency.jvm("io.ktor", "ktor-client-core"),
|
|
|
|
MultiplatformDependency.jvm("io.ktor", "ktor-client-okhttp"),
|
|
|
|
MultiplatformDependency.jvm("io.ktor", "ktor-http"),
|
|
|
|
MultiplatformDependency.jvm("io.ktor", "ktor-utils"),
|
|
|
|
)
|
|
|
|
) {
|
2022-11-03 03:28:04 +08:00
|
|
|
exclude(ExcludeProperties.`ktor-io`)
|
|
|
|
exclude(ExcludeProperties.`everything from slf4j`)
|
|
|
|
}
|
|
|
|
|
2022-05-19 03:54:47 +08:00
|
|
|
val `ktor-client-cio` = ktor("client-cio", Versions.ktor)
|
2022-05-29 06:03:13 +08:00
|
|
|
val `ktor-client-mock` = ktor("client-mock", Versions.ktor)
|
|
|
|
val `ktor-client-curl` = ktor("client-curl", Versions.ktor)
|
2022-06-07 23:22:20 +08:00
|
|
|
val `ktor-client-darwin` = ktor("client-darwin", Versions.ktor)
|
2020-12-28 15:04:19 +08:00
|
|
|
val `ktor-client-okhttp` = ktor("client-okhttp", Versions.ktor)
|
2022-11-03 03:28:04 +08:00
|
|
|
val `ktor-client-okhttp_relocated` =
|
2023-04-29 22:02:05 +08:00
|
|
|
RelocatedDependency(
|
|
|
|
ktor("client-okhttp", Versions.ktor), "io.ktor", "okhttp", "okio",
|
|
|
|
notationsToExcludeInPom = CompositeDependency(
|
|
|
|
MultiplatformDependency.jvm("io.ktor", "ktor-io"),
|
|
|
|
MultiplatformDependency.jvm("io.ktor", "ktor-client-core"),
|
|
|
|
MultiplatformDependency.jvm("io.ktor", "ktor-client-okhttp"),
|
|
|
|
MultiplatformDependency.jvm("io.ktor", "ktor-http"),
|
|
|
|
MultiplatformDependency.jvm("io.ktor", "ktor-serialization"),
|
|
|
|
MultiplatformDependency.jvm("io.ktor", "ktor-utils"),
|
|
|
|
MultiplatformDependency.jvm("io.ktor", "ktor-websockets"),
|
|
|
|
MultiplatformDependency.jvm("io.ktor", "ktor-websockets-serialization"),
|
|
|
|
MultiplatformDependency.jvm("com.squareup.okhttp3", "okhttp3"),
|
|
|
|
MultiplatformDependency.jvm("com.squareup.okio", "okio"),
|
|
|
|
)
|
|
|
|
) {
|
2022-11-03 03:28:04 +08:00
|
|
|
exclude(ExcludeProperties.`ktor-io`)
|
|
|
|
exclude(ExcludeProperties.`everything from slf4j`)
|
|
|
|
}
|
|
|
|
|
|
|
|
const val `okhttp3` = "com.squareup.okhttp3:okhttp:${Versions.okhttp}"
|
|
|
|
const val `okio` = "com.squareup.okio:okio-jvm:${Versions.okio}"
|
|
|
|
|
2020-10-03 13:35:05 +08:00
|
|
|
val `ktor-client-android` = ktor("client-android", Versions.ktor)
|
2022-05-19 03:54:47 +08:00
|
|
|
val `ktor-client-logging` = ktor("client-logging", Versions.ktor)
|
2022-05-17 16:43:09 +08:00
|
|
|
val `ktor-network` = ktor("network-jvm", Versions.ktor)
|
2022-05-19 03:54:47 +08:00
|
|
|
val `ktor-client-serialization` = ktor("client-serialization", Versions.ktor)
|
2020-10-03 13:35:05 +08:00
|
|
|
|
2022-09-10 12:49:13 +08:00
|
|
|
val `ktor-server-core` = ktor("server-core", Versions.ktor)
|
|
|
|
val `ktor-server-netty` = ktor("server-netty", Versions.ktor)
|
|
|
|
const val `java-in-memory-file-system` = "com.google.jimfs:jimfs:" + Versions.jimfs
|
|
|
|
|
2021-08-09 23:45:32 +08:00
|
|
|
const val `logback-classic` = "ch.qos.logback:logback-classic:" + Versions.logback
|
|
|
|
|
2021-08-06 02:31:17 +08:00
|
|
|
const val `slf4j-api` = "org.slf4j:slf4j-api:" + Versions.slf4j
|
2021-04-17 16:13:16 +08:00
|
|
|
const val `slf4j-simple` = "org.slf4j:slf4j-simple:" + Versions.slf4j
|
2021-08-09 23:45:32 +08:00
|
|
|
|
2020-11-22 14:25:49 +08:00
|
|
|
const val `log4j-api` = "org.apache.logging.log4j:log4j-api:" + Versions.log4j
|
2021-08-06 02:31:17 +08:00
|
|
|
const val `log4j-core` = "org.apache.logging.log4j:log4j-core:" + Versions.log4j
|
2022-11-11 13:35:34 +08:00
|
|
|
const val `log4j-slf4j2-impl` = "org.apache.logging.log4j:log4j-slf4j2-impl:" + Versions.log4j
|
2021-08-09 23:45:32 +08:00
|
|
|
const val `log4j-to-slf4j` = "org.apache.logging.log4j:log4j-to-slf4j:" + Versions.log4j
|
2020-11-22 14:25:49 +08:00
|
|
|
|
2021-01-28 09:32:23 +08:00
|
|
|
val ATTRIBUTE_MIRAI_TARGET_PLATFORM: Attribute<String> = Attribute.of("mirai.target.platform", String::class.java)
|
|
|
|
|
|
|
|
|
|
|
|
const val `kotlin-compiler` = "org.jetbrains.kotlin:kotlin-compiler:${Versions.kotlinCompiler}"
|
2022-02-12 20:45:09 +08:00
|
|
|
const val `kotlin-compiler_forIdea` = "org.jetbrains.kotlin:kotlin-compiler:${Versions.kotlinCompilerForIdeaPlugin}"
|
2021-01-28 09:32:23 +08:00
|
|
|
|
2022-11-03 03:28:04 +08:00
|
|
|
const val `kotlin-stdlib` = "org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlinStdlib}"
|
2021-01-28 09:32:23 +08:00
|
|
|
const val `kotlin-stdlib-jdk8` = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${Versions.kotlinStdlib}"
|
|
|
|
const val `kotlin-reflect` = "org.jetbrains.kotlin:kotlin-reflect:${Versions.kotlinStdlib}"
|
|
|
|
const val `kotlin-test` = "org.jetbrains.kotlin:kotlin-test:${Versions.kotlinStdlib}"
|
|
|
|
const val `kotlin-test-junit5` = "org.jetbrains.kotlin:kotlin-test-junit5:${Versions.kotlinStdlib}"
|
2022-06-26 16:03:15 +08:00
|
|
|
const val `junit-jupiter-api` = "org.junit.jupiter:junit-jupiter-api:${Versions.junit}"
|
|
|
|
const val `junit-jupiter-params` = "org.junit.jupiter:junit-jupiter-params:${Versions.junit}"
|
|
|
|
const val `junit-jupiter-engine` = "org.junit.jupiter:junit-jupiter-engine:${Versions.junit}"
|
2021-01-28 09:32:23 +08:00
|
|
|
|
2021-12-06 20:34:00 +08:00
|
|
|
//const val `mirai-core-api` = "net.mamoe:mirai-core-api:${Versions.core}"
|
|
|
|
//const val `mirai-core` = "net.mamoe:mirai-core:${Versions.core}"
|
|
|
|
//const val `mirai-core-utils` = "net.mamoe:mirai-core-utils:${Versions.core}"
|
2021-01-28 09:32:23 +08:00
|
|
|
|
2022-05-17 16:43:09 +08:00
|
|
|
const val `yamlkt` = "net.mamoe.yamlkt:yamlkt:${Versions.yamlkt}"
|
2021-01-28 09:32:23 +08:00
|
|
|
|
|
|
|
const val `jetbrains-annotations` = "org.jetbrains:annotations:19.0.0"
|
|
|
|
|
|
|
|
|
2021-02-15 10:42:37 +08:00
|
|
|
const val `caller-finder` = "io.github.karlatemp:caller:1.1.1"
|
2021-02-01 12:23:04 +08:00
|
|
|
|
2023-05-02 04:32:41 +08:00
|
|
|
const val `androidx-annotation` = "androidx.annotation:annotation:${Versions.androidxAnnotation}"
|
2021-04-13 00:23:27 +08:00
|
|
|
const val `android-runtime` = "com.google.android:android:${Versions.android}"
|
2021-08-25 15:07:56 +08:00
|
|
|
const val `netty-all` = "io.netty:netty-all:${Versions.netty}"
|
2022-10-29 20:11:30 +08:00
|
|
|
const val `netty-handler` = "io.netty:netty-handler:${Versions.netty}"
|
|
|
|
const val `netty-common` = "io.netty:netty-common:${Versions.netty}"
|
|
|
|
const val `netty-transport` = "io.netty:netty-transport:${Versions.netty}"
|
|
|
|
const val `netty-buffer` = "io.netty:netty-buffer:${Versions.netty}"
|
2021-12-10 19:57:09 +08:00
|
|
|
const val `bouncycastle` = "org.bouncycastle:bcprov-jdk15on:${Versions.bouncycastle}"
|
2022-01-15 20:37:26 +08:00
|
|
|
|
2023-01-18 17:41:21 +08:00
|
|
|
const val `kt-bignum` = "com.ionspin.kotlin:bignum:0.3.7"
|
|
|
|
val `kt-bignum_relocated` = RelocatedDependency(`kt-bignum`, "com.ionspin.kotlin.bignum")
|
|
|
|
|
2022-01-15 20:37:26 +08:00
|
|
|
const val `maven-resolver-api` = "org.apache.maven.resolver:maven-resolver-api:${Versions.mavenArtifactResolver}"
|
|
|
|
const val `maven-resolver-impl` = "org.apache.maven.resolver:maven-resolver-impl:${Versions.mavenArtifactResolver}"
|
2022-06-11 19:55:25 +08:00
|
|
|
const val `maven-resolver-connector-basic` =
|
|
|
|
"org.apache.maven.resolver:maven-resolver-connector-basic:${Versions.mavenArtifactResolver}"
|
|
|
|
const val `maven-resolver-transport-http` =
|
|
|
|
"org.apache.maven.resolver:maven-resolver-transport-http:${Versions.mavenArtifactResolver}"
|
2022-01-15 20:37:26 +08:00
|
|
|
const val `maven-resolver-provider` = "org.apache.maven:maven-resolver-provider:${Versions.mavenResolverProvider}"
|
2022-11-23 20:53:55 +08:00
|
|
|
|
|
|
|
|
2022-11-28 03:58:28 +08:00
|
|
|
const val jline = "org.jline:jline:${Versions.jline}"
|
|
|
|
const val jansi = "org.fusesource.jansi:jansi:${Versions.jansi}"
|
|
|
|
|
2022-11-23 20:53:55 +08:00
|
|
|
|
|
|
|
const val DEPS_TEST_VERSION = "2.99.0-deps-test"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This does not work for this build! Changes apply only in future builds.
|
|
|
|
*/
|
|
|
|
fun setProjectVersionForFutureBuilds(newVersion: String) {
|
|
|
|
rootProject.file("buildSrc/src/main/kotlin/Versions.kt").run {
|
|
|
|
var text = readText()
|
|
|
|
val template = { version: Any? -> "/*PROJECT_VERSION_START*/\"${version}\"/*PROJECT_VERSION_END*/" }
|
|
|
|
check(text.indexOf(template(Versions.project)) != -1) { "Cannot find ${template(Versions.project)}" }
|
|
|
|
text = text.replace(template(Versions.project), template(newVersion))
|
|
|
|
writeText(text)
|
|
|
|
}
|
2023-09-03 13:38:39 +08:00
|
|
|
}
|