mirror of
https://github.com/layue13/MoonBridge.git
synced 2026-10-25 18:46:18 +00:00
- 根任务 release:build/release/ 下收集服务器包、后端插件 JAR 与客户端 mod (经 client-mod 自身 wrapper 构建,-PskipClientMod 可跳过),附安装位置说明 docs/release-layout.md - verify.yml:-Pluckperms check,并新增 client-mod 构建测试 job; ci.yml:-Pluckperms check release,上传 build/release/,发布带 -Pluckperms - gradlew 加可执行位 - README、CLAUDE.md、架构/发布/测试/权限/后端接入文档与 smoke 脚本改用新模块、 新坐标与发行包 backend/ 目录 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GGL9BudzWm4dUQgBsQw4Qr
57 lines
2.3 KiB
Kotlin
57 lines
2.3 KiB
Kotlin
plugins {
|
|
id("moonbridge.java-library-conventions") apply false
|
|
id("moonbridge.application-conventions") apply false
|
|
}
|
|
|
|
val releaseVersion = providers.gradleProperty("releaseVersion").orElse("0.1.0-SNAPSHOT").get()
|
|
|
|
allprojects {
|
|
group = "uk.potatolab.moonbridge"
|
|
version = releaseVersion
|
|
}
|
|
|
|
val luckPerms = findProject(":luckperms-moonbridge")
|
|
val published = listOfNotNull(":proxy-plugin-api", ":messaging", ":backend", luckPerms?.path)
|
|
|
|
tasks.register("check") {
|
|
group = "verification"
|
|
description = "Runs every module's checks (add -Pluckperms to include the LuckPerms plugin)."
|
|
dependsOn(subprojects.map { "${it.path}:check" })
|
|
}
|
|
|
|
tasks.register("publish") {
|
|
group = "publishing"
|
|
description = "Publishes the Maven modules (CI passes -Pluckperms so the LuckPerms plugin is included)."
|
|
dependsOn(published.map { "$it:publish" })
|
|
}
|
|
|
|
// client-mod/ is a separate Gradle build (GTNH toolchain for Minecraft 1.7.10); release runs it through its
|
|
// own wrapper. Pass -PskipClientMod to leave it out, e.g. where the Minecraft toolchain cannot be downloaded.
|
|
val skipClientMod = providers.gradleProperty("skipClientMod").map { it != "false" }.getOrElse(false)
|
|
val windows = System.getProperty("os.name").lowercase().contains("windows")
|
|
|
|
val buildClientMod = tasks.register<Exec>("buildClientMod") {
|
|
group = "build"
|
|
description = "Builds the 1.7.10 Forge WebSocket client mod in client-mod/."
|
|
workingDir = file("client-mod")
|
|
// clean: the jar name carries the git version, so older jars would otherwise be collected too.
|
|
val gradle = if (windows) listOf("cmd", "/c", "gradlew.bat") else listOf("bash", "./gradlew")
|
|
commandLine(gradle + listOf("clean", "build"))
|
|
}
|
|
|
|
tasks.register<Sync>("release") {
|
|
group = "distribution"
|
|
description = "Collects everything a deployment needs into build/release (see docs/release-layout.md)."
|
|
into(layout.buildDirectory.dir("release"))
|
|
from(file("docs/release-layout.md")) { rename { "README.md" } }
|
|
from(project(":proxy-core").tasks.named("distZip")) { into("server") }
|
|
from(project(":backend").tasks.named("jar")) { into("backend") }
|
|
if (!skipClientMod) {
|
|
dependsOn(buildClientMod)
|
|
from(fileTree("client-mod/build/libs") {
|
|
include("moonbridgews-*.jar")
|
|
exclude("*-dev.jar", "*-sources.jar")
|
|
}) { into("client") }
|
|
}
|
|
}
|