import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestLogEvent plugins { id("io.papermc.paperweight.core") version "2.0.0-beta.16" apply false } subprojects { apply(plugin = "java-library") apply(plugin = "maven-publish") extensions.configure { toolchain { languageVersion = JavaLanguageVersion.of(21) } } tasks.withType().configureEach { isPreserveFileTimestamps = false isReproducibleFileOrder = true } } val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/" subprojects { tasks.withType { options.encoding = Charsets.UTF_8.name() options.release = 21 options.isFork = true options.compilerArgs.addAll(listOf("-Xlint:-deprecation", "-Xlint:-removal")) } tasks.withType { options.encoding = Charsets.UTF_8.name() } tasks.withType { filteringCharset = Charsets.UTF_8.name() } tasks.withType { testLogging { showStackTraces = true exceptionFormat = TestExceptionFormat.FULL events(TestLogEvent.STANDARD_OUT) } } repositories { mavenCentral() maven(paperMavenPublicUrl) } extensions.configure { repositories { maven("https://repo.papermc.io/repository/maven-snapshots/") { name = "paperSnapshots" credentials(PasswordCredentials::class) } } } } tasks.register("printMinecraftVersion") { val mcVersion = providers.gradleProperty("mcVersion") doLast { println(mcVersion.get().trim()) } } tasks.register("printPaperVersion") { val paperVersion = provider { project.version } doLast { println(paperVersion.get()) } }