diff options
author | Jason Penilla <[email protected]> | 2024-12-06 14:02:39 -0700 |
---|---|---|
committer | Nassim Jahnke <[email protected]> | 2024-12-12 11:36:44 +0100 |
commit | fe6dbf0377c5eb9da382b9fc7963261dba4b034a (patch) | |
tree | f7e57bc03799e51348fd511e835fb883a5ccb3ce | |
parent | c6233d8bcd28cfbd367ff9a518f5ca762ef32391 (diff) | |
download | Paper-fe6dbf0377c5eb9da382b9fc7963261dba4b034a.tar.gz Paper-fe6dbf0377c5eb9da382b9fc7963261dba4b034a.zip |
Move paperweight use to -server
-rw-r--r-- | build.gradle.kts | 51 | ||||
-rw-r--r-- | gradle.properties | 3 | ||||
-rw-r--r-- | paper-server/build.gradle.kts | 44 |
3 files changed, 51 insertions, 47 deletions
diff --git a/build.gradle.kts b/build.gradle.kts index b265f02abd..0252749c00 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,16 +9,14 @@ import java.util.regex.Pattern import kotlin.io.path.* plugins { - java - `maven-publish` - id("io.papermc.paperweight.core") version "2.0.0-SNAPSHOT" + id("io.papermc.paperweight.core") version "2.0.0-SNAPSHOT" apply false } -allprojects { - apply(plugin = "java") +subprojects { + apply(plugin = "java-library") apply(plugin = "maven-publish") - java { + extensions.configure<JavaPluginExtension> { toolchain { languageVersion = JavaLanguageVersion.of(21) } @@ -51,45 +49,8 @@ subprojects { mavenCentral() maven(paperMavenPublicUrl) } -} - -dependencies { - mache("io.papermc:mache:1.21.4+build.3") -} - -paperweight { - softSpoon = true - minecraftVersion = "1.21.4" - // macheOldPath = file("F:\\Projects\\PaperTooling\\mache\\versions\\1.21.4\\src\\main\\java") - // gitFilePatches = true - - paper { - paperServerDir = file("paper-server") - } - - serverProject = project(":paper-server") -} - -tasks.generateDevelopmentBundle { - apiCoordinates = "io.papermc.paper:paper-api" - libraryRepositories.addAll( - "https://repo.maven.apache.org/maven2/", - paperMavenPublicUrl, - ) -} - -publishing { - if (project.providers.gradleProperty("publishDevBundle").isPresent) { - publications.create<MavenPublication>("devBundle") { - artifact(tasks.generateDevelopmentBundle) { - artifactId = "dev-bundle" - } - } - } -} -allprojects { - publishing { + extensions.configure<PublishingExtension> { repositories { maven("https://repo.papermc.io/repository/maven-snapshots/") { name = "paperSnapshots" @@ -112,6 +73,7 @@ tasks.register("printPaperVersion") { } // see gradle.properties +/* if (providers.gradleProperty("updatingMinecraft").getOrElse("false").toBoolean()) { tasks.collectAtsFromPatches { val dir = layout.projectDirectory.dir("patches/unapplied/server") @@ -256,3 +218,4 @@ abstract class RebasePatches : BaseTask() { git("add", unappliedPatches.path.toString() + "/*").runSilently() } } + */ diff --git a/gradle.properties b/gradle.properties index 7a2b3bf89e..aeeaa7b209 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,3 +8,6 @@ updatingMinecraft=false org.gradle.caching=true org.gradle.parallel=true org.gradle.vfs.watch=false + +# TODO: this should be removed when we move things to forked JVMs +org.gradle.jvmargs=-Xmx2G diff --git a/paper-server/build.gradle.kts b/paper-server/build.gradle.kts index 56f9075087..4634193258 100644 --- a/paper-server/build.gradle.kts +++ b/paper-server/build.gradle.kts @@ -2,8 +2,46 @@ import io.papermc.paperweight.util.* import java.time.Instant plugins { - java + `java-library` `maven-publish` + id("io.papermc.paperweight.core") +} + +val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/" + +dependencies { + mache("io.papermc:mache:1.21.4+build.5") +} + +paperweight { + softSpoon = true + minecraftVersion = "1.21.4" + // macheOldPath = file("F:\\Projects\\PaperTooling\\mache\\versions\\1.21.4\\src\\main\\java") + // gitFilePatches = true + + paper { + paperServerDir = file("./") + } + + serverProject = project(":paper-server") +} + +tasks.generateDevelopmentBundle { + apiCoordinates = "io.papermc.paper:paper-api" + libraryRepositories.addAll( + "https://repo.maven.apache.org/maven2/", + paperMavenPublicUrl, + ) +} + +publishing { + if (project.providers.gradleProperty("publishDevBundle").isPresent) { + publications.create<MavenPublication>("devBundle") { + artifact(tasks.generateDevelopmentBundle) { + artifactId = "dev-bundle" + } + } + } } val log4jPlugins = sourceSets.create("log4jPlugins") @@ -225,7 +263,7 @@ tasks.registerRunTask("runDevServer") { tasks.registerRunTask("runBundler") { description = "Spin up a test server from the Mojang mapped bundler jar" - classpath(rootProject.tasks.named<io.papermc.paperweight.tasks.CreateBundlerJar>("createMojmapBundlerJar").flatMap { it.outputZip }) + classpath(tasks.named<io.papermc.paperweight.tasks.CreateBundlerJar>("createMojmapBundlerJar").flatMap { it.outputZip }) mainClass.set(null as String?) } // tasks.registerRunTask("runReobfBundler") { @@ -235,7 +273,7 @@ tasks.registerRunTask("runBundler") { // } tasks.registerRunTask("runPaperclip") { description = "Spin up a test server from the Mojang mapped Paperclip jar" - classpath(rootProject.tasks.named<io.papermc.paperweight.tasks.CreatePaperclipJar>("createMojmapPaperclipJar").flatMap { it.outputZip }) + classpath(tasks.named<io.papermc.paperweight.tasks.CreatePaperclipJar>("createMojmapPaperclipJar").flatMap { it.outputZip }) mainClass.set(null as String?) } // tasks.registerRunTask("runReobfPaperclip") { |