Files
Purpur/build.gradle.kts
granny 0b95a8072a Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@5436d44 Deprecate several Keyed#getKey methods (#10357)
PaperMC/Paper@a7f1dc6 Change online mode default for Velocity configuration (#10413)
PaperMC/Paper@37db2d7 [ci skip] Update book page/char limit for book meta doc (#10415)
PaperMC/Paper@526795b Update patches to handle vineflower decompiler (#10406)
PaperMC/Paper@8fe90de [ci skip] Referenced InventoryDragEvent in documentation of InventoryClickEvent (#10395)
PaperMC/Paper@46d462b Fix StackOverflowException thrown on shutdown (Fixes #10404) (#10408)
PaperMC/Paper@f061e76 Fix hit criteria advancement triggered before changing state (#10409)
PaperMC/Paper@3263470 Add color transition and clone functions to ParticleBuilder (#10342)
PaperMC/Paper@4445d23 Deprecate ItemStack#setType & add ItemStack#withType (#10290)
2024-04-12 17:48:06 -07:00

130 lines
3.3 KiB
Kotlin

import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
java
`maven-publish`
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
id("io.papermc.paperweight.patcher") version "1.5.15"
}
allprojects {
apply(plugin = "java")
apply(plugin = "maven-publish")
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
}
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
subprojects {
tasks.withType<JavaCompile>().configureEach {
options.encoding = Charsets.UTF_8.name()
options.release = 17
}
tasks.withType<Javadoc> {
options.encoding = Charsets.UTF_8.name()
}
tasks.withType<ProcessResources> {
filteringCharset = Charsets.UTF_8.name()
}
tasks.withType<Test> {
testLogging {
showStackTraces = true
exceptionFormat = TestExceptionFormat.FULL
events(TestLogEvent.STANDARD_OUT)
}
}
repositories {
mavenCentral()
maven(paperMavenPublicUrl)
maven("https://jitpack.io")
}
}
repositories {
mavenCentral()
maven(paperMavenPublicUrl) {
content {
onlyForConfigurations(configurations.paperclip.name)
}
}
}
dependencies {
remapper("net.fabricmc:tiny-remapper:0.10.1:fat")
decompiler("org.vineflower:vineflower:1.11.0-20240412.144930-14")
paperclip("io.papermc:paperclip:3.0.3")
}
paperweight {
serverProject = project(":purpur-server")
remapRepo = paperMavenPublicUrl
decompileRepo = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
usePaperUpstream(providers.gradleProperty("paperCommit")) {
withPaperPatcher {
apiPatchDir = layout.projectDirectory.dir("patches/api")
apiOutputDir = layout.projectDirectory.dir("Purpur-API")
serverPatchDir = layout.projectDirectory.dir("patches/server")
serverOutputDir = layout.projectDirectory.dir("Purpur-Server")
}
patchTasks.register("generatedApi") {
isBareDirectory = true
upstreamDirPath = "paper-api-generator/generated"
patchDir = layout.projectDirectory.dir("patches/generated-api")
outputDir = layout.projectDirectory.dir("paper-api-generator/generated")
}
}
}
tasks.generateDevelopmentBundle {
apiCoordinates = "org.purpurmc.purpur:purpur-api"
mojangApiCoordinates = "io.papermc.paper:paper-mojangapi"
libraryRepositories = listOf(
"https://repo.maven.apache.org/maven2/",
paperMavenPublicUrl,
"https://repo.purpurmc.org/snapshots",
)
}
allprojects {
publishing {
repositories {
maven("https://repo.purpurmc.org/snapshots") {
name = "purpur"
credentials(PasswordCredentials::class)
}
}
}
}
publishing {
publications.create<MavenPublication>("devBundle") {
artifact(tasks.generateDevelopmentBundle) {
artifactId = "dev-bundle"
}
}
}
tasks.register("printMinecraftVersion") {
doLast {
println(providers.gradleProperty("mcVersion").get().trim())
}
}
tasks.register("printPurpurVersion") {
doLast {
println(project.version)
}
}