-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.gradle.kts
106 lines (93 loc) · 2.74 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import com.diffplug.gradle.spotless.SpotlessPlugin
import de.chojo.PublishData
plugins {
java
alias(libs.plugins.spotless)
alias(libs.plugins.publishdata)
`maven-publish`
}
group = "de.eldoria"
version = "2.7.2"
var publishModules = setOf(
"schematicbrushreborn-api",
"schematicbrushreborn-core",
"schematicbrushreborn-paper",
"schematicbrushreborn-paper-legacy",
"schematicbrushreborn-spigot"
)
allprojects {
repositories {
mavenCentral()
maven("https://eldonexus.de/repository/maven-public/")
maven("https://eldonexus.de/repository/maven-proxies/")
}
apply {
plugin<SpotlessPlugin>()
plugin<JavaPlugin>()
plugin<PublishData>()
if (publishModules.contains(project.name)) {
plugin<MavenPublishPlugin>()
}
}
spotless {
java {
licenseHeaderFile(rootProject.file("HEADER.txt"))
target("**/*.java")
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
withSourcesJar()
withJavadocJar()
}
dependencies {
// This is required. https://github.com/gradle/gradle/issues/16634#issuecomment-809345790
val libs = rootProject.libs
val testlibs = rootProject.testlibs
compileOnly(libs.paper.v17)
compileOnly(libs.spigot.v16)
compileOnly(libs.jetbrains.annotations)
// Due to incompatibility by the yaml versions defined by world edit, fawe and bukkit we need to exclude it everywhere and add our own version...
compileOnly(libs.snakeyaml)
compileOnly(libs.worldedit)
compileOnly(libs.fawe.core) {
exclude("com.intellectualsites.paster")
exclude("net.kyori")
}
compileOnly(libs.fawe.bukkit)
testImplementation(platform("org.junit:junit-bom:5.11.0"))
testImplementation("org.junit.jupiter", "junit-jupiter")
testImplementation(testlibs.mockbukkit)
testImplementation(libs.worldedit) {
exclude("org.yaml")
}
testImplementation(libs.fawe.core) {
exclude("com.intellectualsites.paster")
}
testImplementation(libs.fawe.bukkit)
}
publishData {
if (project.name.contains("api")) {
useEldoNexusRepos()
} else {
useInternalEldoNexusRepos()
}
}
tasks {
compileJava {
options.encoding = "UTF-8"
}
compileTestJava {
options.encoding = "UTF-8"
}
test {
dependsOn(spotlessCheck)
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
}
}