forked from ViaVersion/ViaProxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
234 lines (210 loc) · 6.74 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
plugins {
id "java"
id "application"
id "maven-publish"
id "idea"
id "net.raphimc.class-token-replacer" version "1.1.3"
id "xyz.wagyourtail.jvmdowngrader" version "1.1.3"
}
base {
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
compileJava.options.encoding = compileTestJava.options.encoding = javadoc.options.encoding = "UTF-8"
group = project.maven_group ?: rootProject.maven_group
archivesName = project.maven_name ?: rootProject.maven_name
version = project.maven_version ?: rootProject.maven_version
}
configurations {
include
includeJ8
implementation.extendsFrom include
api.extendsFrom include
}
repositories {
mavenCentral()
maven {
name = "ViaVersion"
url = "https://repo.viaversion.com"
}
maven {
name = "Lenni0451"
url = "https://maven.lenni0451.net/everything"
}
maven {
name = "OpenCollab Releases"
url = "https://repo.opencollab.dev/maven-releases"
}
maven {
name = "OpenCollab Snapshots"
url = "https://repo.opencollab.dev/maven-snapshots"
}
maven {
name = "Minecraft Libraries"
url = "https://libraries.minecraft.net"
content {
includeGroup "com.mojang"
}
}
maven {
name = "Jitpack"
url = "https://jitpack.io"
content {
includeGroup "com.github.Oryxel"
}
}
}
dependencies {
include "com.viaversion:viaversion-common:5.0.4-SNAPSHOT"
include "com.viaversion:viabackwards-common:5.0.4-SNAPSHOT"
include "com.viaversion:viarewind-common:4.0.3-SNAPSHOT"
include "net.raphimc:ViaLegacy:3.0.3-SNAPSHOT"
include "net.raphimc:viaaprilfools-common:3.0.2-SNAPSHOT"
include("net.raphimc:ViaBedrock:0.0.12-SNAPSHOT") {
exclude group: "io.netty"
exclude group: "io.jsonwebtoken"
}
include("net.raphimc:ViaLoader:3.0.3-SNAPSHOT") {
exclude group: "org.slf4j", module: "slf4j-api"
}
include "com.google.code.gson:gson:2.11.0"
include "com.formdev:flatlaf:3.5.1"
include "com.formdev:flatlaf-extras:3.5.1"
include "org.apache.commons:commons-lang3:3.17.0"
include "commons-io:commons-io:2.17.0"
include "net.sf.jopt-simple:jopt-simple:5.0.4"
include "org.apache.logging.log4j:log4j-core:2.24.1"
include "org.apache.logging.log4j:log4j-slf4j-impl:2.24.1"
include "org.fusesource.jansi:jansi:2.4.1"
include("com.mojang:authlib:3.16.29") {
exclude group: "org.slf4j", module: "slf4j-api"
}
include "net.lenni0451.classtransform:mixinstranslator:1.14.0"
include "net.lenni0451.classtransform:mixinsdummy:1.14.0"
include "net.lenni0451.classtransform:additionalclassprovider:1.14.0"
include "net.lenni0451:Reflect:1.3.4"
include "net.lenni0451:LambdaEvents:2.4.2"
include("net.lenni0451:MCPing:1.4.2") {
exclude group: "com.google.code.gson", module: "gson"
}
include "net.lenni0451.commons:swing:1.6.0"
include("net.raphimc.netminecraft:all:3.0.0-SNAPSHOT") {
exclude group: "com.google.code.gson", module: "gson"
}
include("net.raphimc:MinecraftAuth:4.1.1") {
exclude group: "com.google.code.gson", module: "gson"
exclude group: "org.slf4j", module: "slf4j-api"
}
include("org.cloudburstmc.netty:netty-transport-raknet:1.0.0.CR3-SNAPSHOT") {
exclude group: "io.netty"
}
include "gs.mclo:api:4.1.0"
include "net.lenni0451:optconfig:1.0.0"
includeJ8(compileOnly("xyz.wagyourtail.jvmdowngrader:jvmdowngrader:1.1.3"))
includeJ8 "xyz.wagyourtail.jvmdowngrader:jvmdowngrader-java-api:1.1.3:downgraded-8"
}
sourceSets {
main {
classTokenReplacer {
property("\${version}", project.version)
property("\${impl_version}", "git-${project.name}-${project.version}:${project.latestCommitHash()}")
}
}
}
java {
withSourcesJar()
}
application {
mainClass = "net.raphimc.viaproxy.ViaProxy"
}
jar {
dependsOn configurations.include
from {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
configurations.include.collect {
zipTree(it)
}
} {
exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA"
}
manifest {
attributes(
"Main-Class": application.mainClass,
"Multi-Release": "true",
"Launcher-Agent-Class": application.mainClass
)
}
from("LICENSE") {
rename { "${it}_${project.name ?: rootProject.name}" }
}
}
publishing {
repositories {
maven {
name = "Via"
url = "https://repo.viaversion.com/"
credentials(PasswordCredentials)
authentication {
basic(BasicAuthentication)
}
}
}
publications {
maven(MavenPublication) {
groupId = project.maven_group
artifactId = project.maven_name
version = project.maven_version
from components.java
pom {
name = "ViaProxy"
description = "Standalone proxy which allows players to join EVERY Minecraft server version (Classic, Alpha, Beta, Release, Bedrock)"
url = "https://github.com/ViaVersion/ViaProxy"
licenses {
license {
name = "GPL-3.0 License"
url = "https://github.com/ViaVersion/ViaProxy/blob/main/LICENSE"
}
}
developers {
developer {
id = "RK_01"
}
}
scm {
connection = "scm:git:git://github.com/ViaVersion/ViaProxy.git"
developerConnection = "scm:git:ssh://github.com/ViaVersion/ViaProxy.git"
url = "https://github.com/ViaVersion/ViaProxy.git"
}
}
}
}
}
idea {
module {
["run"].each {
excludeDirs << file("$it")
}
}
}
downgradeJar {
dependsOn configurations.includeJ8
from {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
configurations.includeJ8.collect {
zipTree(it)
}
} {
exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA"
}
downgradeTo = JavaVersion.VERSION_1_8
ignoreWarningsIn.add("net/lenni0451/commons/httpclient/executor/HttpClientExecutor")
archiveClassifier = null
archiveVersion = project.version + "+java8"
}
build.finalizedBy("downgradeJar")
String latestCommitHash() {
def stdout = new ByteArrayOutputStream()
exec {
commandLine "git", "rev-parse", "--short", "HEAD"
standardOutput = stdout
}
return stdout.toString().trim()
}