90 lines
2.4 KiB
Kotlin
90 lines
2.4 KiB
Kotlin
plugins {
|
|
java
|
|
id("xyz.jpenilla.run-paper") version "2.3.1"
|
|
jacoco
|
|
checkstyle
|
|
}
|
|
|
|
group = "com.loki"
|
|
version = "1.5.5-1.21.x"
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
maven("https://repo.papermc.io/repository/maven-public/")
|
|
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
|
|
maven("https://repo.rosewooddev.io/repository/public/")
|
|
maven("https://jitpack.io")
|
|
maven("https://nexus.skinsrestorer.net/repository/maven-public/")
|
|
}
|
|
|
|
dependencies {
|
|
compileOnly("io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT")
|
|
compileOnly("me.clip:placeholderapi:2.11.6")
|
|
compileOnly("org.black_ixx:playerpoints:3.2.7")
|
|
compileOnly("net.luckperms:api:5.4")
|
|
implementation("com.google.code.gson:gson:2.10.1")
|
|
|
|
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.0")
|
|
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.10.0")
|
|
testImplementation("org.mockito:mockito-core:5.11.0")
|
|
testImplementation("io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT")
|
|
testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.10.0")
|
|
}
|
|
|
|
checkstyle {
|
|
toolVersion = "10.21.4"
|
|
configFile = file("config/checkstyle/checkstyle.xml")
|
|
isIgnoreFailures = false
|
|
maxErrors = 0
|
|
maxWarnings = 0
|
|
}
|
|
|
|
tasks.withType<Checkstyle>().configureEach {
|
|
reports {
|
|
xml.required.set(true)
|
|
html.required.set(true)
|
|
}
|
|
}
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion.set(JavaLanguageVersion.of(21))
|
|
}
|
|
}
|
|
|
|
tasks.withType<JavaCompile> {
|
|
options.encoding = "UTF-8"
|
|
options.compilerArgs.addAll(listOf("-Xlint:all", "-Xlint:-processing"))
|
|
options.isFork = true
|
|
options.forkOptions.jvmArgs = listOf("-XX:+UseParallelGC")
|
|
}
|
|
|
|
tasks.test {
|
|
useJUnitPlatform()
|
|
maxParallelForks = Runtime.getRuntime().availableProcessors()
|
|
setForkEvery(100)
|
|
finalizedBy(tasks.jacocoTestReport)
|
|
}
|
|
|
|
tasks.jacocoTestReport {
|
|
dependsOn(tasks.test)
|
|
reports {
|
|
xml.required.set(true)
|
|
html.required.set(true)
|
|
}
|
|
}
|
|
|
|
jacoco {
|
|
toolVersion = "0.8.11"
|
|
}
|
|
|
|
tasks.jar {
|
|
archiveFileName.set("LoChat-${project.version}.jar")
|
|
from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
|
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
|
}
|
|
|
|
// Локальный Paper для тестов: .\gradlew.bat runServer
|
|
tasks.runServer {
|
|
minecraftVersion("1.21.4") // lowest supported; runs on any 1.21.x Paper server
|
|
}
|