-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.gradle.kts
68 lines (57 loc) · 1.82 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import com.diffplug.gradle.spotless.SpotlessExtension
import com.diffplug.gradle.spotless.SpotlessPlugin
import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import xyz.jpenilla.runpaper.task.RunServer
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
alias(libs.plugins.run.paper) apply false
// Kotlin plugin prefers to be applied to parent when it's used in multiple sub-modules.
kotlin("jvm") version "2.1.10" apply false
alias(libs.plugins.spotless)
}
val javaVersion: Int = 21
allprojects {
group = "com.noxcrew.interfaces"
version = "1.4.0-SNAPSHOT"
tasks.withType<JavaCompile> {
sourceCompatibility = javaVersion.toString()
targetCompatibility = javaVersion.toString()
}
}
subprojects {
apply(plugin = "kotlin")
apply<SpotlessPlugin>()
repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
}
configure<SpotlessExtension> {
kotlin {
ktlint("1.5.0")
suppressLintsFor {
step = "ktlint"
shortCode = "standard:package-name"
}
suppressLintsFor {
step = "ktlint"
shortCode = "standard:annotation"
}
suppressLintsFor {
step = "ktlint"
shortCode = "standard:property-naming"
}
}
}
// Configure any existing RunServerTasks
tasks.withType<RunServer> {
minecraftVersion("1.21.4")
jvmArgs("-Dio.papermc.paper.suppress.sout.nags=true")
}
tasks.withType<KotlinCompile> {
explicitApiMode.set(ExplicitApiMode.Strict)
compilerOptions {
jvmTarget.set(JvmTarget.fromTarget(javaVersion.toString()))
}
}
}