91 lines
3.8 KiB
Diff
91 lines
3.8 KiB
Diff
--- a/paper-server/build.gradle.kts
|
|
+++ b/paper-server/build.gradle.kts
|
|
@@ -22,6 +_,17 @@
|
|
minecraftVersion = providers.gradleProperty("mcVersion")
|
|
gitFilePatches = false
|
|
|
|
+ // Infstar:在 Paper 的服务端源码上应用自有补丁。
|
|
+ val infstar = forks.register("infstar") {
|
|
+ upstream.patchDir("paperServer") {
|
|
+ upstreamPath = "paper-server"
|
|
+ excludes = setOf("src/minecraft", "patches", "build.gradle.kts")
|
|
+ patchesDir = rootDirectory.dir("infstar-server/paper-patches")
|
|
+ outputDir = rootDirectory.dir("paper-server")
|
|
+ }
|
|
+ }
|
|
+ activeFork = infstar
|
|
+
|
|
updatingMinecraft {
|
|
//oldPaperCommit = "e5fe71723e2ffde7cc9fafc085ac3bb73e63175e"
|
|
}
|
|
@@ -86,7 +_,24 @@
|
|
}
|
|
}
|
|
|
|
-val log4jPlugins = sourceSets.create("log4jPlugins")
|
|
+// Infstar:编译生成后的 Paper 源码,而不是空的模块目录。
|
|
+sourceSets {
|
|
+ main {
|
|
+ java {
|
|
+ srcDir("../paper-server/src/main/java")
|
|
+ srcDir("../paper-server/src/generated/java")
|
|
+ }
|
|
+ resources { srcDir("../paper-server/src/main/resources") }
|
|
+ }
|
|
+ test {
|
|
+ java { srcDir("../paper-server/src/test/java") }
|
|
+ resources { srcDir("../paper-server/src/test/resources") }
|
|
+ }
|
|
+}
|
|
+
|
|
+val log4jPlugins = sourceSets.create("log4jPlugins") {
|
|
+ java { srcDir("../paper-server/src/log4jPlugins/java") }
|
|
+}
|
|
configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
|
extendsFrom(configurations.compileClasspath.get())
|
|
}
|
|
@@ -109,7 +_,7 @@
|
|
}
|
|
|
|
dependencies {
|
|
- implementation(project(":paper-api"))
|
|
+ implementation(project(":infstar-api"))
|
|
implementation(platform("ca.spottedleaf.leafpile:bom:1.2.4"))
|
|
implementation("ca.spottedleaf.leafpile:common")
|
|
implementation("ca.spottedleaf.leafpile:concurrentutil")
|
|
@@ -163,23 +_,21 @@
|
|
manifest {
|
|
val git = Git(rootProject.layout.projectDirectory.path)
|
|
val mcVersion = rootProject.providers.gradleProperty("mcVersion").get()
|
|
- val build = System.getenv("BUILD_NUMBER") ?: null
|
|
val buildTime = providers.environmentVariable("BUILD_STARTED_AT").map(Instant::parse).orElse(Instant.EPOCH).get()
|
|
- val gitHash = git.exec(providers, "rev-parse", "--short=7", "HEAD").get().trim()
|
|
- val implementationVersion = "$mcVersion-${build ?: "DEV"}-$gitHash"
|
|
- val date = git.exec(providers, "show", "-s", "--format=%ci", gitHash).get().trim()
|
|
- val gitBranch = git.exec(providers, "rev-parse", "--abbrev-ref", "HEAD").get().trim()
|
|
+ val buildVersion = project.version.toString()
|
|
+ val gitHash = buildVersion.substringAfterLast('-')
|
|
+ val gitBranch = runCatching { git.exec(providers, "rev-parse", "--abbrev-ref", "HEAD").get().trim() }.getOrDefault("unknown")
|
|
attributes(
|
|
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
|
- "Implementation-Title" to "Paper",
|
|
- "Implementation-Version" to implementationVersion,
|
|
- "Implementation-Vendor" to date,
|
|
- "Specification-Title" to "Paper",
|
|
+ "Implementation-Title" to "Infstar",
|
|
+ "Implementation-Version" to buildVersion,
|
|
+ "Implementation-Vendor" to "Infstar",
|
|
+ "Specification-Title" to "Infstar",
|
|
"Specification-Version" to project.version,
|
|
- "Specification-Vendor" to "Paper Team",
|
|
- "Brand-Id" to "papermc:paper",
|
|
- "Brand-Name" to "Paper",
|
|
- "Build-Number" to (build ?: ""),
|
|
+ "Specification-Vendor" to "Infstar",
|
|
+ "Brand-Id" to "infstarmc:infstar",
|
|
+ "Brand-Name" to "Infstar",
|
|
+ "Build-Number" to "",
|
|
"Build-Time" to buildTime.toString(),
|
|
"Git-Branch" to gitBranch,
|
|
"Git-Commit" to gitHash,
|