import io.papermc.paperweight.tasks.RebuildGitPatches plugins { java `maven-publish` id("io.papermc.paperweight.patcher") version "1.7.1" } val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/" repositories { mavenCentral() maven(paperMavenPublicUrl) { content { onlyForConfigurations(configurations.paperclip.name) } } } dependencies { remapper("net.fabricmc:tiny-remapper:0.10.2:fat") decompiler("org.vineflower:vineflower:1.10.1") paperclip("io.papermc:paperclip:3.0.3") } allprojects { apply(plugin = "java") apply(plugin = "maven-publish") java { toolchain { languageVersion.set(JavaLanguageVersion.of(21)) } } } subprojects { tasks.withType { options.encoding = Charsets.UTF_8.name() options.release.set(21) } tasks.withType { options.encoding = Charsets.UTF_8.name() } tasks.withType { filteringCharset = Charsets.UTF_8.name() } repositories { mavenCentral() maven(paperMavenPublicUrl) } } paperweight { serverProject.set(project(":folia-server")) remapRepo.set(paperMavenPublicUrl) decompileRepo.set(paperMavenPublicUrl) usePaperUpstream(providers.gradleProperty("paperRef")) { withPaperPatcher { apiPatchDir.set(layout.projectDirectory.dir("patches/api")) apiOutputDir.set(layout.projectDirectory.dir("Folia-API")) serverPatchDir.set(layout.projectDirectory.dir("patches/server")) serverOutputDir.set(layout.projectDirectory.dir("Folia-Server")) } patchTasks.register("generatedApi") { isBareDirectory = true upstreamDirPath = "paper-api-generator/generated" patchDir = layout.projectDirectory.dir("patches/generatedApi") outputDir = layout.projectDirectory.dir("paper-api-generator/generated") } } } tasks.generateDevelopmentBundle { apiCoordinates.set("dev.folia:folia-api") libraryRepositories.addAll( "https://repo.maven.apache.org/maven2/", paperMavenPublicUrl, ) } allprojects { publishing { repositories { maven("https://repo.papermc.io/repository/maven-snapshots/") { name = "paperSnapshots" credentials(PasswordCredentials::class) } } } } publishing { if (project.hasProperty("publishDevBundle")) { publications.create("devBundle") { artifact(tasks.generateDevelopmentBundle) { artifactId = "dev-bundle" } } } } tasks.withType { filterPatches.set(false) } tasks.register("printMinecraftVersion") { doLast { println(providers.gradleProperty("mcVersion").get().trim()) } } tasks.register("printPaperVersion") { doLast { println(project.version) } }