Co-authored-by: Bjarne Koll <git@lynxplay.dev>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
Co-authored-by: MiniDigger | Martin <admin@minidigger.dev>
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>
Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Co-authored-by: Shane Freeder <theboyetronic@gmail.com>
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
Co-authored-by: Tamion <70228790+notTamion@users.noreply.github.com>
Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
This commit is contained in:
Nassim Jahnke
2025-04-12 17:26:44 +02:00
parent 0767902699
commit f00727c57e
2092 changed files with 50551 additions and 48729 deletions

View File

@ -1,29 +1,36 @@
import io.papermc.paperweight.attribute.DevBundleOutput
import io.papermc.paperweight.util.*
import io.papermc.paperweight.util.data.FileEntry
import paper.libs.com.google.gson.annotations.SerializedName
import java.time.Instant
import kotlin.io.path.readText
plugins {
`java-library`
`maven-publish`
idea
id("io.papermc.paperweight.core")
}
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
dependencies {
mache("io.papermc:mache:1.21.4+build.7")
mache("io.papermc:mache:1.21.5+build.1")
paperclip("io.papermc:paperclip:3.0.3")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
paperweight {
minecraftVersion = providers.gradleProperty("mcVersion")
// macheOldPath = file("F:\\Projects\\PaperTooling\\mache\\versions\\1.21.4\\src\\main\\java")
// gitFilePatches = true
gitFilePatches = false
//updatingMinecraft {
// oldPaperCommit = "f4f275519f7c1fbe9db173b7144a4fe81440e365"
//}
spigot {
buildDataRef = "3edaf46ec1eed4115ce1b18d2846cded42577e42"
packageVersion = "v1_21_R3" // also needs to be updated in MappingEnvironment
buildDataRef = "702e1a0a5072b2c4082371d5228cb30525687efc"
packageVersion = "v1_21_R4" // also needs to be updated in MappingEnvironment
}
reobfPackagesToFix.addAll(
@ -107,6 +114,10 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
}
val alsoShade: Configuration by configurations.creating
val runtimeConfiguration by configurations.consumable("runtimeConfiguration") {
attributes.attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME))
}
// Configure mockito agent that is needed in newer java versions
val mockitoAgent = configurations.register("mockitoAgent")
abstract class MockitoAgentProvider : CommandLineArgumentProvider {
@ -124,7 +135,8 @@ dependencies {
implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+
implementation("org.jline:jline-terminal-jni:3.27.1") // fall back to jni on java 21
implementation("net.minecrell:terminalconsoleappender:1.3.0")
implementation("net.kyori:adventure-text-serializer-ansi:4.18.0") // Keep in sync with adventureVersion from Paper-API build file
implementation("io.papermc.adventure:adventure-text-serializer-ansi:4.21.0-mc1215-SNAPSHOT") // Keep in sync with adventureVersion from Paper-API build file // FIXME back to release
runtimeConfiguration(sourceSets.main.map { it.runtimeClasspath })
/*
Required to add the missing Log4j2Plugins.dat file from log4j-core
@ -213,13 +225,13 @@ tasks.compileTestJava {
options.compilerArgs.add("-parameters")
}
val scanJar = tasks.register("scanJarForBadCalls", io.papermc.paperweight.tasks.ScanJarForBadCalls::class) {
val scanJarForBadCalls by tasks.registering(io.papermc.paperweight.tasks.ScanJarForBadCalls::class) {
badAnnotations.add("Lio/papermc/paper/annotation/DoNotUse;")
jarToScan.set(tasks.jar.flatMap { it.archiveFile })
classpath.from(configurations.compileClasspath)
}
tasks.check {
dependsOn(scanJar)
dependsOn(scanJarForBadCalls)
}
// Use TCA for console improvements
@ -250,6 +262,32 @@ tasks.test {
jvmArgumentProviders.add(provider)
}
val generatedDir: java.nio.file.Path = layout.projectDirectory.dir("src/generated/java").asFile.toPath()
idea {
module {
generatedSourceDirs.add(generatedDir.toFile())
}
}
sourceSets {
main {
java {
srcDir(generatedDir)
}
}
}
if (providers.gradleProperty("updatingMinecraft").getOrElse("false").toBoolean()) {
val scanJarForOldGeneratedCode by tasks.registering(io.papermc.paperweight.tasks.ScanJarForOldGeneratedCode::class) {
mcVersion.set(providers.gradleProperty("mcVersion"))
annotation.set("Lio/papermc/paper/generated/GeneratedFrom;")
jarToScan.set(tasks.jar.flatMap { it.archiveFile })
classpath.from(configurations.compileClasspath)
}
tasks.check {
dependsOn(scanJarForOldGeneratedCode)
}
}
fun TaskContainer.registerRunTask(
name: String,
block: JavaExec.() -> Unit