import io.papermc.paperweight.util.constants.* plugins { java `maven-publish` id("com.github.johnrengelman.shadow") version "8.1.1" apply false id("io.papermc.paperweight.patcher") version "1.7.4" } 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.3:fat") // Must be kept in sync with upstream decompiler("org.vineflower:vineflower:1.10.1") // Must be kept in sync with upstream paperclip("io.papermc:paperclip:3.0.3") // You probably want this to be kept in sync with upstream } 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(":slice-server")) remapRepo.set(paperMavenPublicUrl) decompileRepo.set(paperMavenPublicUrl) usePaperUpstream(providers.gradleProperty("paperRef")) { withPaperPatcher { apiPatchDir.set(layout.projectDirectory.dir("patches/api")) apiOutputDir.set(layout.projectDirectory.dir("slice-api")) serverPatchDir.set(layout.projectDirectory.dir("patches/server")) serverOutputDir.set(layout.projectDirectory.dir("slice-server")) } patchTasks { register("generatedApi") { isBareDirectory.set(true) upstreamDirPath.set("paper-api-generator/generated") patchDir.set(layout.projectDirectory.dir("patches/generatedApi")) outputDir.set(layout.projectDirectory.dir("paper-api-generator/generated")) } } } } // // Everything below here is optional if you don't care about publishing API or dev bundles to your repository // tasks.generateDevelopmentBundle { apiCoordinates.set("com.lokamc.slice:slice-api") libraryRepositories.set( listOf( "https://repo.maven.apache.org/maven2/", paperMavenPublicUrl ) ) } publishing { // Publishing dev bundle: // ./gradlew publishDevBundlePublicationTo(MavenLocal|MyRepoSnapshotsRepository) -PpublishDevBundle if (project.hasProperty("publishDevBundle")) { publications.create("devBundle") { artifact(tasks.generateDevelopmentBundle) { artifactId = "dev-bundle" } } } }