-
-
Notifications
You must be signed in to change notification settings - Fork 32
/
build.gradle.kts
171 lines (145 loc) · 4.38 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
plugins {
`java-library`
id("io.papermc.paperweight.userdev") version "1.5.11"
id("xyz.jpenilla.run-paper") version "2.2.0" // Adds runServer and runMojangMappedServer tasks for testing
}
dependencies {
paperDevBundle("1.20.4-R0.1-SNAPSHOT")
}
java {
sourceCompatibility = JavaVersion.VERSION_17
}
// 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.14.0"
repositories() {
mavenCentral()
maven("https://papermc.io/repo/repository/maven-public/")
//maven("https://repo.dmulloy2.net/nexus/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")
}
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 = "24.0.1")
annotationProcessor("org.jetbrains:annotations:24.0.1")
}
}
// All Paper Plugins + Annotations.
configure(subprojects.filter {
!listOf("vane-waterfall", "vane-velocity", "vane-proxy-core").contains(it.name)
}) {
apply(plugin = "io.papermc.paperweight.userdev")
dependencies {
paperDevBundle("1.20.4-R0.1-SNAPSHOT")
}
tasks {
build {
dependsOn("reobfJar")
}
}
}
// All Projects except proxies and annotations.
configure(subprojects.filter {
!listOf("vane-annotations", "vane-waterfall", "vane-velocity", "vane-proxy-core").contains(it.name)
}) {
tasks.create<Copy>("copyJar") {
from(tasks.reobfJar)
into("${project.rootProject.projectDir}/target")
}
tasks {
build {
dependsOn("copyJar")
}
processResources {
filesMatching("**/plugin.yml") {
expand(project.properties)
}
}
}
dependencies {
implementation(group = "com.comphenix.protocol", name = "ProtocolLib", version = "5.0.0-SNAPSHOT")
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-waterfall", "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 = "dynmap-api", version = "3.2-SNAPSHOT")
implementation(group = "com.github.BlueMap-Minecraft", name = "BlueMapAPI", version = "v2.3.0")
}
}
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"
)
})
}