-
Notifications
You must be signed in to change notification settings - Fork 34
/
build.gradle
243 lines (211 loc) · 6.76 KB
/
build.gradle
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
plugins {
id 'fabric-loom' version '1.6-SNAPSHOT'
id 'maven-publish'
}
version = project.minecraft_version + "-" + ci_version()
group = project.maven_group
base {
archivesName = project.archives_base_name + "-launcher"
}
allprojects {
apply plugin: "fabric-loom"
repositories {
maven {
name = 'spigot'
url = 'https://hub.spigotmc.org/nexus/content/groups/public/'
}
maven {
name = 'mohist'
url = 'https://maven.mohistmc.com/'
}
maven {
name = 'mohist lib'
url = 'https://maven.mohistmc.com/libraries'
}
maven {
name = 'izzel'
url = 'https://maven.izzel.io/releases'
}
maven {
name = 'ParchmentMC'
url = 'https://maven.parchmentmc.org'
}
maven {
name = 'JitPack'
url = 'https://jitpack.io'
}
maven {
name = "Sponge"
url = 'https://repo.spongepowered.org/maven'
}
maven {
name = "Adventure"
url = 'https://jd.advntr.dev/'
}
mavenCentral()
}
dependencies {
implementation 'org.projectlombok:lombok:1.18.30'
annotationProcessor 'org.projectlombok:lombok:1.18.30'
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.layered() {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-1.20.1:2023.09.03@zip")
}
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// Make a collection of all api modules we wish to use
Set<String> apiModules = [
"fabric-api-base",
"fabric-events-interaction-v0",
"fabric-entity-events-v1",
"fabric-lifecycle-events-v1",
"fabric-transitive-access-wideners-v1",
"fabric-biome-api-v1"
]
// Add each module as a dependency
apiModules.forEach {
modImplementation(fabricApi.module(it, "${project.fabric_version}"))
}
compileOnly "org.jetbrains:annotations:21.0.1"
// banner
implementation("org.yaml:snakeyaml:2.0")
implementation("com.mohistmc:i18n:0.6")
implementation('com.mohistmc:json:0.5')
implementation('com.mohistmc:tools:0.5.1')
implementation('com.mohistmc:dynamicenum:0.3')
implementation('javax.inject:javax.inject:1')
implementation("net.sf.jopt-simple:jopt-simple:5.0.4")
// craftbukkit
implementation("org.fusesource.jansi:jansi:1.18")
implementation("jline:jline:2.14.6")
implementation("com.googlecode.json-simple:json-simple:1.1.1")
implementation("org.xerial:sqlite-jdbc:3.42.0.0")
implementation("com.mysql:mysql-connector-j:8.0.33")
implementation("org.checkerframework:checker-qual:2.0.0")
implementation("net.md-5:SpecialSource:1.11.2")
implementation("commons-codec:commons-codec:1.16.0")
// spigot
implementation("net.md-5:bungeecord-chat:1.16-R0.4")
implementation("io.izzel:tools:1.3.0")
implementation "com.google.guava:failureaccess:1.0.1"
implementation "com.google.guava:guava:31.0.1-jre"
implementation "com.google.code.gson:gson:2.10"
implementation "com.mojang:authlib:3.17.30"
implementation "com.mojang:logging:1.1.1"
implementation("commons-lang:commons-lang:2.6-mohist")
implementation "org.slf4j:slf4j-api:2.0.6"
implementation "org.apache.logging.log4j:log4j-core:2.20.0"
implementation("org.apache.logging.log4j:log4j-iostreams:2.20.0")
implementation "org.apache.logging.log4j:log4j-api:2.20.0"
implementation "org.apache.logging.log4j:log4j-slf4j2-impl:2.20.0"
implementation "org.apache.commons:commons-lang3:3.12.0"
implementation "net.sf.jopt-simple:jopt-simple:5.0.4"
implementation "net.java.dev.jna:jna-platform:5.13.0"
implementation "net.java.dev.jna:jna:5.13.0"
implementation "it.unimi.dsi:fastutil:8.5.12"
implementation "commons-io:commons-io:2.11.0"
implementation "com.mojang:javabridge:2.0.25"
implementation "com.mojang:datafixerupper:6.0.6"
implementation "com.github.oshi:oshi-core:6.4.0"
implementation "io.netty:netty-buffer:4.1.82.Final"
implementation "io.netty:netty-codec:4.1.82.Final"
implementation "io.netty:netty-common:4.1.82.Final"
implementation "io.netty:netty-handler:4.1.82.Final"
implementation "io.netty:netty-resolver:4.1.82.Final"
implementation "io.netty:netty-transport:4.1.82.Final"
implementation "io.netty:netty-transport-classes-epoll:4.1.82.Final"
implementation "io.netty:netty-transport-native-unix-common:4.1.82.Final"
//class modify
implementation("io.izzel.arclight:mixin-tools:1.2.4") { transitive = false }
annotationProcessor("io.izzel.arclight:mixin-tools:1.2.4") { transitive = false }
// mappings remapper
implementation("net.fabricmc:mapping-io:0.3.0")
}
loom.runs.configureEach {
vmArgs([
"-enableassertions",
"-Dmixin.debug.verify=true",
"-Dmixin.debug.countInjections=true"
])
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
filesMatching("plugin.yml") {
expand "version": project.version
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.compilerArgs << '-Xlint:-dep-ann' << '-Xlint:-removal' << '-Xdiags:verbose'
}
tasks.register('cleanBuild') {
doFirst {
project.file("build/libs").deleteDir()
}
doFirst {
project.file("build/devlibs").deleteDir()
}
}
}
def moduleDependencies(Project project, List<String> depNames) {
def deps = depNames.iterator().collect { project.dependencies.project(path: ":$it", configuration: "namedElements") }
depNames.iterator().forEachRemaining {
Project dependProject = findProject(":$it")
project.loom {
interfaceInjection {
interfaceInjectionSourceSets.add(dependProject.sourceSets.main)
}
}
}
project.dependencies {
deps.each {
api(implementation(it))
}
}
}
def getSubprojectVersion(project) {
return project.minecraft_version + "-" + ci_version()
}
dependencies {
include(project("banner-server"))
include(project("banner-plugin"))
include(project("banner-bootstrap"))
include("net.minecraft:server:${project.minecraft_version}")
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.compilerArgs << '-Xlint:-dep-ann' << '-Xlint:-removal' << '-Xdiags:verbose'
}
jar {
from("LICENSE")
manifest {
attributes(
'Main-Class': 'com.mohistmc.banner.BannerLauncher',
'Specification-Title' : 'Banner',
'Specification-Vendor' : 'MohistMC',
'Specification-Version' : ci_version(),
'Implementation-Title' : 'Banner',
'Implementation-Version': version,
'Implementation-Vendor' : 'MohistMC'
)
}
}
import groovy.json.JsonSlurper
static String ci_version() {
try {
def data = new JsonSlurper().parseText(new URL("https://ci.codemc.io/job/MohistMC/job/Banner-1.20.1/api/json").getText("UTF-8"))
return data.builds["number"][0]
} catch (Exception ignored) {
return "1.20.1"
}
}