2023-09-04 19:36:24 +02:00
|
|
|
import net.raphimc.javadowngrader.gradle.task.DowngradeJarTask
|
|
|
|
|
2023-01-04 20:58:09 +01:00
|
|
|
plugins {
|
|
|
|
id "java"
|
2023-07-01 00:57:19 +02:00
|
|
|
id "application"
|
2023-01-04 20:58:09 +01:00
|
|
|
id "maven-publish"
|
2023-12-25 20:23:36 +01:00
|
|
|
id "idea"
|
2023-09-05 21:29:58 +02:00
|
|
|
id "net.raphimc.class-token-replacer" version "1.0.0"
|
2023-10-16 06:44:10 +02:00
|
|
|
id "net.raphimc.java-downgrader" version "1.1.1"
|
2023-01-04 20:58:09 +01:00
|
|
|
}
|
|
|
|
|
2023-09-04 19:36:24 +02:00
|
|
|
base {
|
|
|
|
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
|
|
|
|
compileJava.options.encoding = compileTestJava.options.encoding = javadoc.options.encoding = "UTF-8"
|
2023-01-12 18:48:45 +01:00
|
|
|
|
2023-09-04 19:36:24 +02:00
|
|
|
group = project.maven_group ?: rootProject.maven_group
|
|
|
|
archivesName = project.maven_name ?: rootProject.maven_name
|
|
|
|
version = project.maven_version ?: rootProject.maven_version
|
2023-01-12 18:48:45 +01:00
|
|
|
}
|
2023-01-04 20:58:09 +01:00
|
|
|
|
|
|
|
configurations {
|
|
|
|
include
|
|
|
|
|
|
|
|
implementation.extendsFrom include
|
|
|
|
api.extendsFrom include
|
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
maven {
|
|
|
|
name = "Jitpack"
|
|
|
|
url = "https://jitpack.io"
|
|
|
|
}
|
|
|
|
maven {
|
2023-09-05 21:29:58 +02:00
|
|
|
name = "Lenni0451"
|
|
|
|
url "https://maven.lenni0451.net/everything"
|
2023-04-02 21:25:27 +02:00
|
|
|
}
|
|
|
|
maven {
|
|
|
|
name = "OpenCollab Releases"
|
|
|
|
url = "https://repo.opencollab.dev/maven-releases/"
|
|
|
|
}
|
|
|
|
maven {
|
|
|
|
name = "OpenCollab Snapshots"
|
|
|
|
url = "https://repo.opencollab.dev/maven-snapshots/"
|
|
|
|
}
|
2023-01-04 20:58:09 +01:00
|
|
|
maven {
|
|
|
|
name = "ViaVersion"
|
|
|
|
url "https://repo.viaversion.com"
|
|
|
|
}
|
2023-07-16 16:55:14 +02:00
|
|
|
maven {
|
|
|
|
name = "Minecraft Libraries"
|
|
|
|
url "https://libraries.minecraft.net"
|
|
|
|
}
|
2023-01-04 20:58:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2023-12-19 00:42:15 +01:00
|
|
|
include "com.viaversion:viaversion-common:4.10.0-23w51b-SNAPSHOT"
|
|
|
|
include "com.viaversion:viabackwards-common:4.10.0-23w51b-SNAPSHOT"
|
2024-01-13 18:32:30 +01:00
|
|
|
include "com.viaversion:viarewind-common:3.0.6-20240113.054016-14"
|
2023-12-27 20:37:11 +01:00
|
|
|
include "net.raphimc:ViaLegacy:2.2.22-SNAPSHOT"
|
2024-01-13 18:32:30 +01:00
|
|
|
include "net.raphimc:ViaAprilFools:2.0.11-SNAPSHOT"
|
2023-12-08 00:44:20 +01:00
|
|
|
include("net.raphimc:ViaBedrock:0.0.4-SNAPSHOT") {
|
2023-11-02 22:54:37 +01:00
|
|
|
exclude group: "io.netty"
|
|
|
|
exclude group: "io.jsonwebtoken"
|
2023-04-02 21:25:27 +02:00
|
|
|
}
|
2023-12-19 00:42:15 +01:00
|
|
|
include("net.raphimc:ViaLoader:2.2.13-SNAPSHOT") {
|
2023-01-04 20:58:09 +01:00
|
|
|
exclude group: "org.slf4j", module: "slf4j-api"
|
|
|
|
}
|
|
|
|
|
2023-01-09 05:26:55 +01:00
|
|
|
include "com.google.code.gson:gson:2.10.1"
|
2024-01-12 05:11:20 +01:00
|
|
|
include "com.formdev:flatlaf:3.3"
|
|
|
|
include "com.formdev:flatlaf-extras:3.3"
|
2023-11-22 05:58:10 +01:00
|
|
|
include "org.apache.commons:commons-lang3:3.14.0"
|
2023-11-30 05:58:24 +01:00
|
|
|
include "commons-io:commons-io:2.15.1"
|
2023-01-04 20:58:09 +01:00
|
|
|
include "net.sf.jopt-simple:jopt-simple:5.0.4"
|
2023-12-28 05:32:41 +01:00
|
|
|
include "org.apache.logging.log4j:log4j-core:2.22.1"
|
2023-12-28 15:21:22 +01:00
|
|
|
include "org.apache.logging.log4j:log4j-slf4j-impl:2.22.1"
|
2023-10-13 07:05:25 +02:00
|
|
|
include "org.fusesource.jansi:jansi:2.4.1"
|
2023-09-04 19:36:24 +02:00
|
|
|
include("com.mojang:authlib:3.16.29") {
|
|
|
|
exclude group: "org.slf4j", module: "slf4j-api"
|
|
|
|
}
|
2023-12-22 01:47:43 +01:00
|
|
|
include "net.lenni0451.classtransform:mixinstranslator:1.13.0"
|
|
|
|
include "net.lenni0451.classtransform:mixinsdummy:1.13.0"
|
|
|
|
include "net.lenni0451.classtransform:additionalclassprovider:1.13.0"
|
2023-12-18 05:25:15 +01:00
|
|
|
include "net.lenni0451:Reflect:1.3.2"
|
2023-12-03 20:58:21 +01:00
|
|
|
include "net.lenni0451:LambdaEvents:2.4.0"
|
2023-12-22 01:47:43 +01:00
|
|
|
include("net.lenni0451:MCPing:1.4.0") {
|
2023-11-30 19:01:49 +01:00
|
|
|
exclude group: "com.google.code.gson", module: "gson"
|
|
|
|
}
|
2024-01-08 18:47:41 +01:00
|
|
|
include "net.lenni0451.commons:swing:1.4.0"
|
2023-12-17 21:20:48 +01:00
|
|
|
include("net.raphimc.netminecraft:all:2.4.0-SNAPSHOT") {
|
2023-11-02 22:54:37 +01:00
|
|
|
exclude group: "com.google.code.gson", module: "gson"
|
|
|
|
}
|
2024-01-08 05:14:37 +01:00
|
|
|
include("net.raphimc:MinecraftAuth:3.1.0") {
|
2023-01-05 22:42:15 +01:00
|
|
|
exclude group: "com.google.code.gson", module: "gson"
|
|
|
|
exclude group: "org.slf4j", module: "slf4j-api"
|
|
|
|
}
|
2023-10-16 06:44:03 +02:00
|
|
|
include("net.raphimc.javadowngrader:impl-classtransform:1.1.1") {
|
2023-05-17 18:08:31 +02:00
|
|
|
exclude group: "org.ow2.asm", module: "asm-commons"
|
2023-09-15 17:44:19 +02:00
|
|
|
exclude group: "net.lenni0451.classtransform", module: "additionalclassprovider"
|
2023-05-17 18:08:31 +02:00
|
|
|
}
|
2023-04-02 21:25:27 +02:00
|
|
|
include("org.cloudburstmc.netty:netty-transport-raknet:1.0.0.CR1-SNAPSHOT") {
|
2023-11-02 22:54:37 +01:00
|
|
|
exclude group: "io.netty"
|
2023-04-02 21:25:27 +02:00
|
|
|
}
|
2023-06-14 16:04:28 +02:00
|
|
|
include "gs.mclo:api:3.0.1"
|
2023-01-04 20:58:09 +01:00
|
|
|
}
|
|
|
|
|
2023-09-05 21:29:58 +02:00
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
classTokenReplacer {
|
|
|
|
property("\${version}", project.version)
|
2023-10-09 12:39:56 +02:00
|
|
|
property("\${impl_version}", "git-${project.name}-${project.version}:${project.latestCommitHash()}")
|
2023-09-05 21:29:58 +02:00
|
|
|
}
|
|
|
|
}
|
2023-01-04 21:54:49 +01:00
|
|
|
}
|
|
|
|
|
2023-02-23 20:35:02 +01:00
|
|
|
java {
|
|
|
|
withSourcesJar()
|
|
|
|
}
|
|
|
|
|
2023-07-01 00:57:19 +02:00
|
|
|
application {
|
|
|
|
mainClass = "net.raphimc.viaproxy.ViaProxy"
|
|
|
|
}
|
|
|
|
|
2023-01-04 20:58:09 +01:00
|
|
|
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(
|
2023-07-01 00:57:19 +02:00
|
|
|
"Main-Class": application.mainClass,
|
2023-01-19 18:57:38 +01:00
|
|
|
"Multi-Release": "true",
|
2023-09-04 19:36:24 +02:00
|
|
|
"Launcher-Agent-Class": application.mainClass
|
2023-01-04 20:58:09 +01:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
from("LICENSE") {
|
2023-09-04 19:36:24 +02:00
|
|
|
rename { "${it}_${project.name ?: rootProject.name}" }
|
2023-01-04 20:58:09 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
publishing {
|
|
|
|
repositories {
|
|
|
|
maven {
|
2023-05-28 18:02:09 +02:00
|
|
|
name = "Via"
|
2023-05-28 18:00:36 +02:00
|
|
|
url = "https://repo.viaversion.com/"
|
2023-06-30 23:49:19 +02:00
|
|
|
|
2023-01-04 20:58:09 +01:00
|
|
|
credentials(PasswordCredentials)
|
|
|
|
authentication {
|
|
|
|
basic(BasicAuthentication)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
publications {
|
|
|
|
maven(MavenPublication) {
|
|
|
|
groupId = project.maven_group
|
|
|
|
artifactId = project.maven_name
|
|
|
|
version = project.maven_version
|
|
|
|
|
|
|
|
from components.java
|
2023-06-30 23:49:19 +02:00
|
|
|
|
|
|
|
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"
|
|
|
|
}
|
|
|
|
}
|
2023-01-04 20:58:09 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-09-04 19:36:24 +02:00
|
|
|
|
2023-12-25 20:23:36 +01:00
|
|
|
idea {
|
|
|
|
module {
|
|
|
|
["run"].each {
|
|
|
|
excludeDirs << file("$it")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-09-04 19:36:24 +02:00
|
|
|
tasks.register("java8Jar", DowngradeJarTask) {
|
|
|
|
input = tasks.jar.archiveFile.get().asFile
|
|
|
|
outputSuffix = "+java8"
|
|
|
|
compileClassPath = sourceSets.main.compileClasspath
|
|
|
|
copyRuntimeClasses = false
|
|
|
|
}.get().dependsOn("build")
|
|
|
|
build.finalizedBy("java8Jar")
|
2023-10-09 12:39:56 +02:00
|
|
|
|
|
|
|
String latestCommitHash() {
|
|
|
|
def stdout = new ByteArrayOutputStream()
|
|
|
|
exec {
|
|
|
|
commandLine "git", "rev-parse", "--short", "HEAD"
|
|
|
|
standardOutput = stdout
|
|
|
|
}
|
|
|
|
return stdout.toString().trim()
|
|
|
|
}
|