Files
Paper/build.gradle.kts

97 lines
2.8 KiB
Kotlin

import io.papermc.paperweight.checkstyle.PaperCheckstyleExt
import io.papermc.paperweight.checkstyle.tasks.PaperCheckstyleTask
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.24" apply false
}
subprojects {
apply {
plugin("java-library")
plugin("maven-publish")
}
extensions.configure<JavaPluginExtension> {
toolchain {
languageVersion = JavaLanguageVersion.of(25)
}
}
val tempDisabled = setOf("paper-server", "paper-generator", "test-plugin")
if (name !in tempDisabled) {
apply { plugin("io.papermc.paperweight.paper-checkstyle") }
extensions.configure<PaperCheckstyleExt> {
typeUseAnnotationsFile.set(rootProject.layout.projectDirectory.file(".checkstyle/type_use_annotations.txt"))
}
/*tasks.withType<PaperCheckstyleTask>().configureEach {
configDirectory = rootProject.layout.projectDirectory.dir(".checkstyle")
// configFile = layout.projectDirectory.file(".checkstyle/checkstyle.xml").asFile // use the base file if not overwritten
maxHeapSize = "2g"
reports {
xml.required = true
html.required = true
}
}*/
dependencies {
"checkstyle"(project(":paper-checkstyle"))
}
}
}
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
subprojects {
tasks.withType<JavaCompile>().configureEach {
options.encoding = Charsets.UTF_8.name()
options.release = 25
options.isFork = true
options.compilerArgs.addAll(listOf("-Xlint:-deprecation", "-Xlint:-removal"))
}
tasks.withType<Javadoc>().configureEach {
options.encoding = Charsets.UTF_8.name()
}
tasks.withType<ProcessResources>().configureEach {
filteringCharset = Charsets.UTF_8.name()
}
tasks.withType<Test>().configureEach {
testLogging {
showStackTraces = true
exceptionFormat = TestExceptionFormat.FULL
events(TestLogEvent.STANDARD_OUT)
}
}
repositories {
mavenCentral()
maven(paperMavenPublicUrl)
}
extensions.configure<PublishingExtension> {
repositories {
maven("https://artifactory.papermc.io/artifactory/releases/") {
name = "paperReleases"
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())
}
}