diff --git a/build.gradle.kts b/build.gradle.kts index 3d8830b0db..c75b3bcc68 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,11 +1,13 @@ plugins { java + `maven-publish` id("com.github.johnrengelman.shadow") version "7.0.0" apply false - id("io.papermc.paperweight.core") version "1.1.9" + id("io.papermc.paperweight.core") version "1.1.10" } allprojects { apply(plugin = "java") + apply(plugin = "maven-publish") java { toolchain { @@ -15,9 +17,6 @@ allprojects { } subprojects { - apply(plugin = "java") - apply(plugin = "maven-publish") - tasks.withType { options.encoding = Charsets.UTF_8.name() options.release.set(16) @@ -29,16 +28,6 @@ subprojects { filteringCharset = Charsets.UTF_8.name() } - configure { - repositories { - maven { - name = "paperSnapshots" - url = uri("https://papermc.io/repo/repository/maven-snapshots/") - credentials(PasswordCredentials::class) - } - } - } - if (name == "Paper-MojangAPI") { return@subprojects } @@ -62,21 +51,11 @@ repositories { onlyForConfigurations("paperclip") } } - maven("https://maven.quiltmc.org/repository/release/") { - content { - onlyForConfigurations("paramMappings", "remapper") - } - } - maven("https://files.minecraftforge.net/maven/") { - content { - onlyForConfigurations("decompiler") - } - } } dependencies { paramMappings("org.quiltmc:yarn:1.17.1+build.1:mergedv2") - remapper("org.quiltmc:tiny-remapper:0.4.1") + remapper("org.quiltmc:tiny-remapper:0.4.3:fat") decompiler("net.minecraftforge:forgeflower:1.5.498.12") paperclip("io.papermc:paperclip:2.0.1") } @@ -89,6 +68,10 @@ paperweight { spigotApiPatchDir.set(layout.projectDirectory.dir("patches/api")) spigotServerPatchDir.set(layout.projectDirectory.dir("patches/server")) + paramMappingsRepo.set("https://maven.quiltmc.org/repository/release/") + remapRepo.set("https://maven.quiltmc.org/repository/release/") + decompileRepo.set("https://files.minecraftforge.net/maven/") + mappingsPatch.set(layout.projectDirectory.file("build-data/mappings-patch.tiny")) reobfMappingsPatch.set(layout.projectDirectory.file("build-data/reobf-mappings-patch.tiny")) @@ -108,6 +91,42 @@ paperweight { } } +tasks.generateDevelopmentBundle { + apiCoordinates.set("io.papermc.paper:paper-api") + mojangApiCoordinates.set("io.papermc.paper:paper-mojangapi") + libraryRepositories.set( + listOf( + "https://libraries.minecraft.net/", + "https://maven.quiltmc.org/repository/release/", + "https://repo.aikar.co/content/groups/aikar", + "https://ci.emc.gs/nexus/content/groups/aikar/", + "https://papermc.io/repo/repository/maven-public/" + ) + ) +} + +publishing { + if (project.hasProperty("publishDevBundle")) { + publications.create("devBundle") { + artifact(tasks.generateDevelopmentBundle) { + artifactId = "dev-bundle" + } + } + } +} + +allprojects { + publishing { + repositories { + maven { + name = "paperSnapshots" + url = uri("https://papermc.io/repo/repository/maven-snapshots/") + credentials(PasswordCredentials::class) + } + } + } +} + tasks.register("printMinecraftVersion") { doLast { println(providers.gradleProperty("mcVersion").get().trim()) diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e708b1c023..7454180f2a 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 69a9715077..ffed3a254e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 4f906e0c81..744e882ed5 100755 --- a/gradlew +++ b/gradlew @@ -72,7 +72,7 @@ case "`uname`" in Darwin* ) darwin=true ;; - MINGW* ) + MSYS* | MINGW* ) msys=true ;; NONSTOP* ) diff --git a/patches/server/Build-system-changes.patch b/patches/server/Build-system-changes.patch index f092f6ff24..5444097a2e 100644 --- a/patches/server/Build-system-changes.patch +++ b/patches/server/Build-system-changes.patch @@ -45,7 +45,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 ) for (tld in setOf("net", "com", "org")) { attributes("$tld/bukkit", "Sealed" to true) -@@ -0,0 +0,0 @@ publishing { +@@ -0,0 +0,0 @@ relocation { + "org.jline:jline-terminal-jansi" to "jline", + "commons-codec:commons-codec" to "org.apache.commons.codec", + "commons-io:commons-io" to "org.apache.commons.io", +- "it.unimi.dsi:fastutil" to "it.unimi", ++ //"it.unimi.dsi:fastutil" to "it.unimi", // Paper - don't relocate fastutil + "org.apache.commons:commons-lang3" to "org.apache.commons.lang3", + "org.ow2.asm:asm" to "org.objectweb.asm" + ).forEach { (owner, pack) -> +@@ -0,0 +0,0 @@ relocation { } } @@ -60,16 +69,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + rename { "pom.xml" } + } + - val packageVersion = "1_17_R1" - relocate("org.bukkit.craftbukkit", "org.bukkit.craftbukkit.v$packageVersion") { - exclude("org.bukkit.craftbukkit.Main*") - } - listOf( -- "jline", "it.unimi", "org.apache.commons.codec", "org.apache.commons.io", -+ "jline", "org.apache.commons.codec", "org.apache.commons.io", // Paper - don't relocate fastutil - "org.apache.commons.lang3", "org.apache.http", "org.apache.maven", "org.codehaus.plexus", - "org.eclipse.aether", "org.eclipse.sisu", "org.objectweb.asm" - ).forEach { pack -> + for (relocation in relocation.relocations.get()) { + relocate(relocation.fromPackage, relocation.toPackage) { + for (exclude in relocation.excludes) { diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java diff --git a/patches/server/Setup-Gradle-project.patch b/patches/server/Setup-Gradle-project.patch index 09ad85bcd7..04254bda2a 100644 --- a/patches/server/Setup-Gradle-project.patch +++ b/patches/server/Setup-Gradle-project.patch @@ -104,19 +104,47 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } +} + ++relocation { ++ fun cb(pack: String) = "org.bukkit.craftbukkit.libs.$pack" ++ ++ sequenceOf( ++ "org.jline:jline-terminal-jansi" to "jline", ++ "commons-codec:commons-codec" to "org.apache.commons.codec", ++ "commons-io:commons-io" to "org.apache.commons.io", ++ "it.unimi.dsi:fastutil" to "it.unimi", ++ "org.apache.commons:commons-lang3" to "org.apache.commons.lang3", ++ "org.ow2.asm:asm" to "org.objectweb.asm" ++ ).forEach { (owner, pack) -> ++ relocate(owner, pack to cb(pack)) ++ } ++ ++ // runtimeOnly dependencies don't need an owner attached ++ // owner is used for dev bundle generation, runtimeOnly deps are not included in dev bundle ++ sequenceOf( ++ "org.apache.http", ++ "org.apache.maven", ++ "org.codehaus.plexus", ++ "org.eclipse.aether", ++ "org.eclipse.sisu" ++ ).forEach { pack -> ++ relocate(pack to cb(pack)) ++ } ++ ++ val packageVersion = "1_17_R1" ++ relocate("org.bukkit.craftbukkit" to "org.bukkit.craftbukkit.v$packageVersion") { ++ exclude("org.bukkit.craftbukkit.Main*") ++ } ++} ++ +tasks.shadowJar { + archiveClassifier.set("mojang-mapped") + -+ val packageVersion = "1_17_R1" -+ relocate("org.bukkit.craftbukkit", "org.bukkit.craftbukkit.v$packageVersion") { -+ exclude("org.bukkit.craftbukkit.Main*") -+ } -+ listOf( -+ "jline", "it.unimi", "org.apache.commons.codec", "org.apache.commons.io", -+ "org.apache.commons.lang3", "org.apache.http", "org.apache.maven", "org.codehaus.plexus", -+ "org.eclipse.aether", "org.eclipse.sisu", "org.objectweb.asm" -+ ).forEach { pack -> -+ relocate(pack, "org.bukkit.craftbukkit.libs.$pack") ++ for (relocation in relocation.relocations.get()) { ++ relocate(relocation.fromPackage, relocation.toPackage) { ++ for (exclude in relocation.excludes) { ++ exclude(exclude) ++ } ++ } + } + mergeServiceFiles() + transform(ModifiedLog4j2PluginsCacheFileTransformer::class.java)