-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathbuild.gradle.kts
196 lines (171 loc) · 5.39 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
import xyz.jpenilla.runpaper.task.RunServer
plugins {
java
idea
alias(libs.plugins.shadow)
alias(libs.plugins.indra.licenser.spotless)
alias(libs.plugins.runPaper)
}
group = "me.machinemaker"
version = "0.5.0"
description = "A replacement for the VanillaTweaks datapack"
repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://maven.enginehub.org/repo/")
maven("https://jitpack.io") {
mavenContent {
includeGroup("com.github.TechFortress")
}
}
}
val paperApi: Provider<String> = libs.versions.minecraft.map { "io.papermc.paper:paper-api:$it-R0.1-SNAPSHOT" }
dependencies {
compileOnly(paperApi)
implementation(libs.mm.mirror)
implementation(libs.mm.lectern) // TODO replace with configurate
implementation(libs.cloud.paper)
implementation(libs.cloud.extras) {
exclude(group = "net.kyori")
}
implementation(libs.bstats)
implementation(libs.moonshine)
implementation(libs.guice)
implementation(libs.guice.assistedInject)
implementation(libs.jackson.yaml)
implementation(libs.jackson.paramNames)
implementation(libs.jdbi.core)
implementation(libs.jdbi.sqlobject)
implementation(libs.commons.config)
implementation(libs.commons.bean)
// Native to minecraft
compileOnly(libs.slf4j)
// soft dependencies
compileOnly(libs.worldguard)
compileOnly(libs.griefprevention)
// TODO convert to libs.versions.toml
implementation("io.github.classgraph:classgraph:4.8.157")
implementation("io.leangen.geantyref:geantyref:1.3.14")
implementation("com.h2database:h2:1.4.200")
implementation("org.xerial:sqlite-jdbc:3.40.0.0")
// tests
testImplementation(paperApi)
testImplementation(libs.commons.config)
testRuntimeOnly(libs.commons.bean)
testImplementation(libs.slf4j)
testImplementation(libs.jackson.yaml)
testImplementation(libs.jackson.paramNames)
testImplementation(libs.guice)
testImplementation(libs.junit.api)
testImplementation(libs.mockito)
testRuntimeOnly(libs.junit.engine)
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
spotless {
format("javaMisc") {
target("src/**/package-info.java")
licenseHeaderFile(rootProject.file(".spotless/HEADER_misc"), "(\\/\\*\\*|@DefaultQualifier)")
.updateYearWithLatest(true)
}
}
indraSpotlessLicenser {
headerFormat {
starSlash()
property("name", "Machine_Maker")
}
licenseHeaderFile(rootProject.file(".spotless/HEADER"))
extraConfig {
spotless {
updateYearWithLatest(true)
}
}
}
idea {
module {
isDownloadJavadoc = true
isDownloadSources = true
}
}
tasks {
assemble {
dependsOn(shadowJar)
}
processResources {
filteringCharset = Charsets.UTF_8.name()
filesMatching(listOf("plugin.yml", "paper-plugin.yml")) {
expand("version" to project.version)
}
}
compileJava {
options.encoding = Charsets.UTF_8.name()
options.compilerArgs.apply {
add("-parameters")
add("-Xlint")
}
options.release.set(21)
}
test {
useJUnitPlatform()
}
jar {
manifest {
attributes(
"Implementation-Title" to "PaperTweaks",
"Implementation-Version" to project.version
)
}
}
shadowJar {
dependencies {
exclude(dependency("org.checkerframework:checker-qual"))
exclude(dependency("org.apache.commons:commons-lang3"))
listOf("guava", "errorprone", "j2objc").forEach {
exclude(dependency("com.google.$it:"))
}
exclude(dependency("com.google.code.findbugs:jsr305"))
exclude(dependency("org.slf4j:slf4j-api"))
exclude(dependency("org.yaml:snakeyaml"))
}
listOf(
"org.incendo", // cloud
"com.fasterxml.jackson", // jackson
"com.github.benmanes", // caffeine
"com.google.inject", // guice
"io.github.classgraph", // classgraph
"nonapi.io.github.classgraph", // classgraph
"io.leangen.geantyref", // geantyref
"javax.inject", // javax
"me.machinemaker.mirror", // mirror
"me.machinemaker.lectern", // lectern
"net.kyori.moonshine", // moonshine
"org.antlr", // antlr (jdbi)
"org.aopalliance", // aopalliance (guice)
"org.bstats", // bStats
"org.h2", // h2 db
"org.jdbi.v3", // jdbi v3
"org.sqlite" // sqlite db
).forEach {
relocate(it, "me.machinemaker.papertweaks.libs.$it")
}
listOf(
"beanutils",
"collections",
"configuration2",
"logging",
"text",
).map { "org.apache.commons.$it" }.forEach {
relocate(it, "me.machinemaker.papertweaks.libs.$it")
}
}
withType<RunServer> { // set for both runServer and runMojangMappedServer
systemProperty("com.mojang.eula.agree", "true")
downloadPlugins {
url("https://download.luckperms.net/1549/bukkit/loader/LuckPerms-Bukkit-5.4.134.jar")
}
}
runServer {
minecraftVersion(libs.versions.minecraft.get())
}
}