build: 设置了发布小仓库的配置.

目前处于 alpha 版本, 所以构建就不发到 Maven 中央仓库了.
如需使用, 可以看 https://github.com/LamGC/maven-repository 获取引用方式.
This commit is contained in:
LamGC 2022-02-21 15:42:07 +08:00
parent 6ea36a1129
commit 3d5a009c7c
Signed by: LamGC
GPG Key ID: 6C5AE2A913941E1D

View File

@ -35,12 +35,24 @@ tasks.withType<KotlinCompile> {
publishing { publishing {
repositories { repositories {
maven { val repoRootKey = "maven.repo.local.root"
credentials { val snapshot = project.version.toString().endsWith("-SNAPSHOT")
val repoRoot = System.getProperty(repoRootKey)?.trim()
if (repoRoot == null || repoRoot.isEmpty()) {
logger.warn(
"\"$repoRootKey\" configuration item is not specified, " +
"please add start parameter \"-D$repoRootKey {localPublishRepo}\"" +
" (if you are not currently executing the publish task, " +
"you can ignore this information)"
)
return@repositories
} }
url = uri("") val repoUri = if (snapshot) {
uri("$repoRoot/snapshots")
} else {
uri("$repoRoot/releases")
} }
maven(repoUri)
} }
publications { publications {
@ -70,7 +82,7 @@ publishing {
} }
scm { scm {
connection.set("scm:git:https://github.com/LamGC/ScalaBot.git") connection.set("scm:git:https://github.com/LamGC/ScalaBot.git")
developerConnection.set("scm:git:ssh://git@github.com:LamGC/ScalaBot.git") developerConnection.set("scm:git:https://github.com/LamGC/ScalaBot.git")
url.set("https://github.com/LamGC/ScalaBot") url.set("https://github.com/LamGC/ScalaBot")
} }
issueManagement { issueManagement {