import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestLogEvent plugins { java // TODO java launcher tasks id("io.papermc.paperweight.patcher") version "2.0.0-beta.17" } paperweight { upstreams.register("folia") { repo = github("PaperMC", "Folia") ref = providers.gradleProperty("foliaRef") patchFile { path = "folia-server/build.gradle.kts" outputFile = file("luminol-server/build.gradle.kts") patchFile = file("luminol-server/build.gradle.kts.patch") } patchFile { path = "folia-api/build.gradle.kts" outputFile = file("luminol-api/build.gradle.kts") patchFile = file("luminol-api/build.gradle.kts.patch") } patchRepo("paperApi") { upstreamPath = "paper-api" patchesDir = file("luminol-api/paper-patches") outputDir = file("paper-api") } patchDir("foliaApi") { upstreamPath = "folia-api" excludes = listOf("build.gradle.kts", "build.gradle.kts.patch", "paper-patches") patchesDir = file("luminol-api/folia-patches") outputDir = file("folia-api") } } } val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/" subprojects { apply(plugin = "java-library") apply(plugin = "maven-publish") extensions.configure { toolchain { languageVersion = JavaLanguageVersion.of(21) } } repositories { mavenCentral() maven(paperMavenPublicUrl) } dependencies { "testRuntimeOnly"("org.junit.platform:junit-platform-launcher") } tasks.withType().configureEach { isPreserveFileTimestamps = false isReproducibleFileOrder = true } tasks.withType { options.encoding = Charsets.UTF_8.name() options.release = 21 options.isFork = true options.forkOptions.memoryMaximumSize = "6g" // Prevent OOM during building } 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) } } extensions.configure { repositories { maven("https://repo.menthamc.com/repository/maven-snapshots/") { name = "MenthaMC" credentials(PasswordCredentials::class) { username = System.getenv("PRIVATE_MAVEN_REPO_USERNAME") password = System.getenv("PRIVATE_MAVEN_REPO_PASSWORD") } } } } tasks.withType { options { (this as StandardJavadocDocletOptions).apply { addStringOption("-add-modules", "jdk.incubator.vector") addStringOption("Xdoclint:none", "-quiet") } } } }