-
-
Notifications
You must be signed in to change notification settings - Fork 35
/
build.gradle.kts
189 lines (162 loc) · 5 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
plugins {
`java-library`
id("io.papermc.paperweight.userdev") version "1.7.7"
id("xyz.jpenilla.run-paper") version "2.3.1" // Adds runServer and runMojangMappedServer tasks for testing
}
dependencies {
paperweight.paperDevBundle("1.21.4-R0.1-SNAPSHOT")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
// We don't need to generate an empty `vane.jar`
tasks.withType<Jar> {
enabled = false
}
// Common settings to all subprojects.
subprojects {
apply(plugin = "java-library")
apply(plugin = "java")
group = "org.oddlama.vane"
version = "1.17.2"
repositories {
mavenLocal()
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://repo.dmulloy2.net/repository/public/")
maven("https://repo.mikeprimm.com/")
maven("https://repo.codemc.org/repository/maven-public/")
maven("https://jitpack.io")
maven("https://api.modrinth.com/maven")
maven("https://repo.bluecolored.de/releases")
}
tasks.withType<JavaCompile> {
options.compilerArgs.addAll(arrayOf("-Xlint:all", "-Xlint:-processing", "-Xdiags:verbose"))
options.encoding = "UTF-8"
}
dependencies {
compileOnly(group = "org.jetbrains", name = "annotations", version = "26.0.1")
annotationProcessor("org.jetbrains:annotations:26.0.1")
}
}
// All Paper Plugins + Annotations.
configure(subprojects.filter {
!listOf("vane-velocity", "vane-proxy-core").contains(it.name)
}) {
apply(plugin = "io.papermc.paperweight.userdev")
tasks.withType<JavaCompile> {
options.compilerArgs.addAll(arrayOf("-Xlint:-this-escape"))
}
dependencies {
paperweight.paperDevBundle("1.21.4-R0.1-SNAPSHOT")
}
}
// All Projects with jar shadow
configure(subprojects.filter {
listOf("vane-regions", "vane-core", "vane-portals", "vane-regions").contains(it.name)
}) {
tasks.create<Copy>("copyJar") {
evaluationDependsOn(project.path)
from(tasks.findByPath("shadowJar"))
into("${project.rootProject.projectDir}/target")
rename("(.+)-dev-all.jar", "$1.jar")
}
}
// All Projects without jar shadow
configure(subprojects.filter {
listOf("vane-admin", "vane-bedtime", "vane-enchantments", "vane-permissions", "vane-trifles").contains(it.name)
}) {
tasks.create<Copy>("copyJar") {
from(tasks.jar)
into("${project.rootProject.projectDir}/target")
rename("(.+)-dev.jar", "$1.jar")
}
}
// All Projects except proxies and annotations.
configure(subprojects.filter {
!listOf("vane-annotations", "vane-velocity", "vane-proxy-core").contains(it.name)
}) {
tasks {
build {
dependsOn("copyJar")
}
processResources {
filesMatching("**/*plugin.yml") {
expand(project.properties)
}
}
}
dependencies {
implementation(group = "com.comphenix.protocol", name = "ProtocolLib", version = "5.3.0")
compileOnly(project(":vane-annotations"))
annotationProcessor(project(path = ":vane-annotations", configuration = "reobf"))
}
rootProject.tasks.runMojangMappedServer {
// the input to reobf, is the mojmapped jars.
pluginJars(tasks.named<io.papermc.paperweight.tasks.RemapJar>("reobfJar").flatMap { it.inputJar })
}
rootProject.tasks.runServer {
// the output is the obfuscated jars.
pluginJars(tasks.named<io.papermc.paperweight.tasks.RemapJar>("reobfJar").flatMap { it.outputJar })
}
}
// All paper plugins except core.
configure(subprojects.filter {
!listOf("vane-annotations", "vane-core", "vane-velocity", "vane-proxy-core").contains(it.name)
}) {
dependencies {
// https://imperceptiblethoughts.com/shadow/multi-project/#depending-on-the-shadow-jar-from-another-project
// In a multi-project build, there may be one project that applies Shadow and another that requires the shadowed
// JAR as a dependency. In this case, use Gradle's normal dependency declaration mechanism to depend on the
// shadow configuration of the shadowed project.
implementation(project(path = ":vane-core", configuration = "shadow"))
// But also depend on core itself.
implementation(project(path = ":vane-core"))
}
}
// All plugins with map integration
configure(subprojects.filter {
listOf("vane-bedtime", "vane-portals", "vane-regions").contains(it.name)
}) {
dependencies {
implementation(group = "us.dynmap", name = "DynmapCoreAPI", version = "3.7-beta-6")
implementation(group = "de.bluecolored", name = "bluemap-api", version = "2.7.3")
}
}
runPaper {
disablePluginJarDetection()
}
tasks.create<Delete>("cleanVaneRuntimeTranslations") {
group = "run paper"
delete(fileTree("run").matching {
include("plugins/vane-*/lang-*.yml")
})
}
tasks.create<Delete>("cleanVaneConfigurations") {
group = "run paper"
delete(fileTree("run").matching {
include("plugins/vane-*/config.yml")
})
}
tasks.create<Delete>("cleanVaneStorage") {
group = "run paper"
delete(fileTree("run").matching {
include("plugins/vane-*/storage.json")
})
}
tasks.create<Delete>("cleanVane") {
group = "run paper"
delete(fileTree("run").matching {
include("plugins/vane-*/")
})
}
tasks.create<Delete>("cleanWorld") {
group = "run paper"
delete(fileTree("run").matching {
include(
"world",
"world_nether",
"world_the_end"
)
})
}