-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathbuild.gradle
199 lines (171 loc) · 5.79 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
plugins {
id 'fabric-loom' version '1.9-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}"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:$project.fabric_version"
mappings loom.layered() {
officialMojangMappings()
}
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.1')
// jansi support
implementation("org.jline:jline-reader:3.21.0")
implementation("org.jline:jline-terminal:3.21.0")
implementation("org.jline:jline-terminal-jansi:3.21.0")
implementation("net.minecrell:terminalconsoleappender:1.4.0")
// 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.46.0.0"
implementation 'com.mysql:mysql-connector-j:8.4.0'
implementation "net.md-5:SpecialSource:1.11.2"
// spigot
implementation "net.md-5:bungeecord-chat:1.20-R0.2"
implementation "io.izzel:tools:1.3.0"
implementation("org.apache.logging.log4j:log4j-iostreams:2.20.0")
//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.6.1")
// mohist lib
implementation("com.mohistmc:librariesvault:1.20.2")
}
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(21)
}
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
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"))
}
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.21.1/api/json").getText("UTF-8"))
return data.builds["number"][0]
} catch (Exception ignored) {
return "1.21.1"
}
}