104 lines
3.1 KiB
Plaintext
104 lines
3.1 KiB
Plaintext
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<JavaPluginExtension> {
|
|
toolchain {
|
|
languageVersion = JavaLanguageVersion.of(21)
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
maven(paperMavenPublicUrl)
|
|
}
|
|
|
|
dependencies {
|
|
"testRuntimeOnly"("org.junit.platform:junit-platform-launcher")
|
|
}
|
|
|
|
tasks.withType<AbstractArchiveTask>().configureEach {
|
|
isPreserveFileTimestamps = false
|
|
isReproducibleFileOrder = true
|
|
}
|
|
tasks.withType<JavaCompile> {
|
|
options.encoding = Charsets.UTF_8.name()
|
|
options.release = 21
|
|
options.isFork = true
|
|
options.forkOptions.memoryMaximumSize = "6g" // Prevent OOM during building
|
|
}
|
|
tasks.withType<Javadoc> {
|
|
options.encoding = Charsets.UTF_8.name()
|
|
}
|
|
tasks.withType<ProcessResources> {
|
|
filteringCharset = Charsets.UTF_8.name()
|
|
}
|
|
tasks.withType<Test> {
|
|
testLogging {
|
|
showStackTraces = true
|
|
exceptionFormat = TestExceptionFormat.FULL
|
|
events(TestLogEvent.STANDARD_OUT)
|
|
}
|
|
}
|
|
|
|
extensions.configure<PublishingExtension> {
|
|
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<Javadoc> {
|
|
options {
|
|
(this as StandardJavadocDocletOptions).apply {
|
|
addStringOption("-add-modules", "jdk.incubator.vector")
|
|
addStringOption("Xdoclint:none", "-quiet")
|
|
}
|
|
}
|
|
}
|
|
}
|