forked from MohistMC/Banner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
219 lines (189 loc) · 6.49 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
plugins {
id 'fabric-loom' version '1.3-SNAPSHOT'
id 'maven-publish'
id 'org.ajoberstar.grgit' version '5.2.0'
}
version = project.minecraft_version + "-" + ci_version()
group = project.maven_group
base {
archivesName = project.archives_base_name
}
repositories {
maven {
name = 'spigot'
url = 'https://hub.spigotmc.org/nexus/content/groups/public/'
}
maven {
name = 'mohist'
url = 'https://maven.mohistmc.com/'
}
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.26'
annotationProcessor 'org.projectlombok:lombok:1.18.26'
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.layered() {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-1.20.1:2023.06.26@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"
]
// Add each module as a dependency
apiModules.forEach {
modImplementation(fabricApi.module(it, "${project.fabric_version}"))
}
// bukkit
implementation(include("org.yaml:snakeyaml:1.33"))
// LibraryLoader start
implementation "org.apache.maven:maven-resolver-provider:3.8.5"
implementation "org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3"
implementation "org.apache.maven.resolver:maven-resolver-transport-http:1.7.3"
implementation "org.apache.maven:maven-artifact:3.8.5"
implementation "org.apache.maven:maven-builder-support:3.8.5"
implementation "org.apache.maven:maven-model:3.8.5"
implementation "org.apache.maven:maven-model-builder:3.8.5"
implementation "org.apache.maven:maven-repository-metadata:3.8.5"
compileOnly "org.jetbrains:annotations:21.0.1"
implementation(include("com.mohistmc:i18n:0.2"))
// 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 "net.md-5:SpecialSource:1.11.2"
// 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"
compileOnly "commons-lang:commons-lang:2.6"
implementation "org.slf4j:slf4j-api:2.0.6"
implementation "org.apache.logging.log4j:log4j-core:2.20.0"
implementation(include("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.mojang:brigadier:1.0.18"
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"
// jansi support
implementation(include("org.jline:jline-terminal:3.21.0"))
implementation(include("org.jline:jline-terminal-jansi:3.21.0"))
implementation(include("net.minecrell:terminalconsoleappender:1.4.0"))
//class modify
modImplementation(include("com.github.wdog5:mixin-tools:1.0.1"))
include(implementation(annotationProcessor("com.github.llamalad7.mixinextras:mixinextras-fabric:0.2.0-beta.9")))
annotationProcessor 'com.github.wdog5:mixin-tools:1.0.1'
// mappings remapper
implementation(include("net.fabricmc:mapping-io:0.3.0"))
// Kyori
implementation(include("net.kyori:adventure-platform-fabric:5.9.0"))
}
loom {
accessWidenerPath = file("src/main/resources/banner.accesswidener")
log4jConfigs.from(file("src/main/resources/log4j2_banner.xml"))
serverOnlyMinecraftJar()
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.compilerArgs << '-Xlint:-dep-ann' << '-Xlint:-removal'
}
jar {
from("LICENSE")
manifest {
attributes(
'Main-Class': 'com.mohistmc.banner.BannerGUI',
'Specification-Title' : 'Banner',
'Specification-Vendor' : 'MohistMC',
'Specification-Version' : ci_version(),
'Implementation-Title' : 'Banner',
'Implementation-Version': version,
'Implementation-Vendor' : 'MohistMC'
)
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
repositories {
}
}
import groovy.json.JsonSlurper
static String ci_version() {
try {
def conn = new URL("https://ci.codemc.io/job/MohistMC/job/Banner-1.20/api/json").openConnection()
conn.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36")
conn.connect()
def root = conn.content.text
def jsonSluper = new JsonSlurper()
String data = jsonSluper.parseText(root)
def number = data.substring(data.indexOf("number")).split(",")
return Integer.valueOf(number[0].replace("number=", "")).intValue()
} catch (Exception ignored) {
return "1.20.1"
}
}