plugins { java `maven-publish` id("com.github.johnrengelman.shadow") version "8.1.1" apply false // paperweight required this original shadow id("io.github.goooler.shadow") version "8.1.7" apply false id("io.papermc.paperweight.patcher") version "1.5.12-SNAPSHOT" } 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.1:fat") decompiler("org.vineflower:vineflower:1.9.3") paperclip("io.papermc:paperclip:3.0.4-SNAPSHOT") } subprojects { apply(plugin = "java") apply(plugin = "maven-publish") java { toolchain { languageVersion.set(JavaLanguageVersion.of(21)) } } 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) maven("https://oss.sonatype.org/content/groups/public/") maven("https://ci.emc.gs/nexus/content/groups/aikar/") maven("https://repo.aikar.co/content/groups/aikar") maven("https://repo.md-5.net/content/repositories/releases/") maven("https://hub.spigotmc.org/nexus/content/groups/public/") maven("https://jitpack.io") maven("https://repo.codemc.io/repository/maven-public/") } } paperweight { serverProject.set(project(":leaf-server")) remapRepo.set("https://maven.fabricmc.net/") decompileRepo.set("https://maven.quiltmc.org/") useStandardUpstream("Gale") { url.set(github("Dreeam-qwq", "Gale")) ref.set(providers.gradleProperty("galeCommit")) withStandardPatcher { apiSourceDirPath.set("gale-api") serverSourceDirPath.set("gale-server") apiPatchDir.set(layout.projectDirectory.dir("patches/api")) apiOutputDir.set(layout.projectDirectory.dir("Leaf-API")) serverPatchDir.set(layout.projectDirectory.dir("patches/server")) serverOutputDir.set(layout.projectDirectory.dir("Leaf-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.dreeam.leaf:leaf-api" mojangApiCoordinates = "io.papermc.paper:paper-mojangapi" libraryRepositories.set( listOf( "https://repo.maven.apache.org/maven2/", paperMavenPublicUrl, ) ) } publishing { if (project.providers.gradleProperty("publishDevBundle").isPresent) { publications.create("devBundle") { artifact(tasks.generateDevelopmentBundle) { artifactId = "dev-bundle" } } } } allprojects { publishing { repositories { maven { name = "leaf" url = uri("https://maven.pkg.github.com/Winds-Studio/Leaf") credentials.username = System.getenv("GITHUB_USERNAME") credentials.password = System.getenv("GITHUB_TOKEN") } publications { register("gpr") { from(components["java"]) } } } } }