Move paperweight use to -server

This commit is contained in:
Jason Penilla 2024-12-06 14:02:39 -07:00 committed by Nassim Jahnke
parent c6233d8bcd
commit fe6dbf0377
No known key found for this signature in database
GPG key ID: EF6771C01F6EF02F
3 changed files with 51 additions and 47 deletions

View file

@ -9,16 +9,14 @@ import java.util.regex.Pattern
import kotlin.io.path.* import kotlin.io.path.*
plugins { plugins {
java id("io.papermc.paperweight.core") version "2.0.0-SNAPSHOT" apply false
`maven-publish`
id("io.papermc.paperweight.core") version "2.0.0-SNAPSHOT"
} }
allprojects { subprojects {
apply(plugin = "java") apply(plugin = "java-library")
apply(plugin = "maven-publish") apply(plugin = "maven-publish")
java { extensions.configure<JavaPluginExtension> {
toolchain { toolchain {
languageVersion = JavaLanguageVersion.of(21) languageVersion = JavaLanguageVersion.of(21)
} }
@ -51,45 +49,8 @@ subprojects {
mavenCentral() mavenCentral()
maven(paperMavenPublicUrl) maven(paperMavenPublicUrl)
} }
}
dependencies { extensions.configure<PublishingExtension> {
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 {
repositories { repositories {
maven("https://repo.papermc.io/repository/maven-snapshots/") { maven("https://repo.papermc.io/repository/maven-snapshots/") {
name = "paperSnapshots" name = "paperSnapshots"
@ -112,6 +73,7 @@ tasks.register("printPaperVersion") {
} }
// see gradle.properties // see gradle.properties
/*
if (providers.gradleProperty("updatingMinecraft").getOrElse("false").toBoolean()) { if (providers.gradleProperty("updatingMinecraft").getOrElse("false").toBoolean()) {
tasks.collectAtsFromPatches { tasks.collectAtsFromPatches {
val dir = layout.projectDirectory.dir("patches/unapplied/server") val dir = layout.projectDirectory.dir("patches/unapplied/server")
@ -256,3 +218,4 @@ abstract class RebasePatches : BaseTask() {
git("add", unappliedPatches.path.toString() + "/*").runSilently() git("add", unappliedPatches.path.toString() + "/*").runSilently()
} }
} }
*/

View file

@ -8,3 +8,6 @@ updatingMinecraft=false
org.gradle.caching=true org.gradle.caching=true
org.gradle.parallel=true org.gradle.parallel=true
org.gradle.vfs.watch=false org.gradle.vfs.watch=false
# TODO: this should be removed when we move things to forked JVMs
org.gradle.jvmargs=-Xmx2G

View file

@ -2,8 +2,46 @@ import io.papermc.paperweight.util.*
import java.time.Instant import java.time.Instant
plugins { plugins {
java `java-library`
`maven-publish` `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") val log4jPlugins = sourceSets.create("log4jPlugins")
@ -225,7 +263,7 @@ tasks.registerRunTask("runDevServer") {
tasks.registerRunTask("runBundler") { tasks.registerRunTask("runBundler") {
description = "Spin up a test server from the Mojang mapped bundler jar" 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?) mainClass.set(null as String?)
} }
// tasks.registerRunTask("runReobfBundler") { // tasks.registerRunTask("runReobfBundler") {
@ -235,7 +273,7 @@ tasks.registerRunTask("runBundler") {
// } // }
tasks.registerRunTask("runPaperclip") { tasks.registerRunTask("runPaperclip") {
description = "Spin up a test server from the Mojang mapped Paperclip jar" 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?) mainClass.set(null as String?)
} }
// tasks.registerRunTask("runReobfPaperclip") { // tasks.registerRunTask("runReobfPaperclip") {