mirai/mirai-core-all/build.gradle.kts

61 lines
2.1 KiB
Plaintext
Raw Normal View History

2020-11-01 15:07:32 +08:00
/*
* Copyright 2019-2023 Mamoe Technologies and contributors.
2020-11-01 15:07:32 +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
*
* https://github.com/mamoe/mirai/blob/dev/LICENSE
2020-11-01 15:07:32 +08:00
*/
2020-09-22 18:56:27 +08:00
@file:Suppress("UnusedImport")
import shadow.configureRelocatedShadowJarForJvmProject
import shadow.relocateImplementation
2020-09-22 18:56:27 +08:00
plugins {
kotlin("jvm")
kotlin("plugin.serialization")
`maven-publish`
id("me.him188.kotlin-jvm-blocking-bridge")
2020-09-22 18:56:27 +08:00
}
2020-10-03 13:35:05 +08:00
version = Versions.project
2020-09-22 18:56:27 +08:00
description = "Mirai core shadowed"
dependencies {
api(project(":mirai-core"))
api(project(":mirai-core-api"))
api(project(":mirai-core-utils"))
implementation(`slf4j-api`) // Required by mirai-console
2022-11-03 03:28:04 +08:00
relocateImplementation(project, `kt-bignum_relocated`)
2022-11-03 03:28:04 +08:00
relocateImplementation(project, `ktor-client-core_relocated`)
relocateImplementation(project, `ktor-client-okhttp_relocated`)
relocateImplementation(project, `ktor-io_relocated`)
2020-09-22 18:56:27 +08:00
}
2022-11-03 03:28:04 +08:00
val shadow = configureRelocatedShadowJarForJvmProject(kotlin)
if (System.getenv("MIRAI_IS_SNAPSHOTS_PUBLISHING")?.toBoolean() != true) {
// Do not publish `-all` jars to snapshot server since they are too large.
2022-11-03 03:28:04 +08:00
2022-11-29 02:37:41 +08:00
configurePublishing("mirai-core-all", addShadowJar = false)
2022-11-03 03:28:04 +08:00
publications {
getByName("mavenJava", MavenPublication::class) {
artifact(shadow)
}
}
tasks.getByName("publishMavenJavaPublicationToMavenLocal").dependsOn(shadow)
tasks.findByName("publishMavenJavaPublicationToMavenCentralRepository")?.dependsOn(shadow)
}
2022-11-03 03:28:04 +08:00
//
//// WARNING: You must also consider relocating transitive dependencies.
//// Otherwise, user will get NoClassDefFound error when using mirai as a classpath dependency. See #2263.
//
//val includeInRuntime = true
//relocateAllFromGroupId("io.ktor", includeInRuntime, "io.ktor")
//relocateAllFromGroupId("com.squareup.okhttp3", includeInRuntime, listOf("okhttp3"))
//relocateAllFromGroupId("com.squareup.okio", includeInRuntime, listOf("okio"))