2023-01-04 14:58:09 -05:00
|
|
|
plugins {
|
|
|
|
id "java"
|
2023-06-30 18:57:19 -04:00
|
|
|
id "application"
|
2023-01-04 14:58:09 -05:00
|
|
|
id "maven-publish"
|
2023-12-25 14:23:36 -05:00
|
|
|
id "idea"
|
2024-08-06 00:53:54 -04:00
|
|
|
id "net.raphimc.class-token-replacer" version "1.1.3"
|
2024-10-29 13:22:43 -04:00
|
|
|
id "xyz.wagyourtail.jvmdowngrader" version "1.2.1"
|
2023-01-04 14:58:09 -05:00
|
|
|
}
|
|
|
|
|
2023-09-04 13:36:24 -04:00
|
|
|
base {
|
|
|
|
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
|
|
|
|
compileJava.options.encoding = compileTestJava.options.encoding = javadoc.options.encoding = "UTF-8"
|
2023-01-12 12:48:45 -05:00
|
|
|
|
2023-09-04 13:36:24 -04: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 12:48:45 -05:00
|
|
|
}
|
2023-01-04 14:58:09 -05:00
|
|
|
|
|
|
|
configurations {
|
|
|
|
include
|
2024-05-25 13:32:18 -04:00
|
|
|
includeJ8
|
2023-01-04 14:58:09 -05:00
|
|
|
|
|
|
|
implementation.extendsFrom include
|
|
|
|
api.extendsFrom include
|
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
2024-09-04 19:12:06 -04:00
|
|
|
maven {
|
|
|
|
name = "ViaVersion"
|
|
|
|
url = "https://repo.viaversion.com"
|
|
|
|
}
|
2023-01-04 14:58:09 -05:00
|
|
|
maven {
|
2023-09-05 15:29:58 -04:00
|
|
|
name = "Lenni0451"
|
2024-09-04 19:12:06 -04:00
|
|
|
url = "https://maven.lenni0451.net/everything"
|
2023-04-02 15:25:27 -04:00
|
|
|
}
|
|
|
|
maven {
|
|
|
|
name = "OpenCollab Releases"
|
2024-09-13 05:05:57 -04:00
|
|
|
url = "https://repo.opencollab.dev/maven-releases"
|
2023-04-02 15:25:27 -04:00
|
|
|
}
|
|
|
|
maven {
|
|
|
|
name = "OpenCollab Snapshots"
|
2024-09-13 05:05:57 -04:00
|
|
|
url = "https://repo.opencollab.dev/maven-snapshots"
|
2023-04-02 15:25:27 -04:00
|
|
|
}
|
2023-07-16 10:55:14 -04:00
|
|
|
maven {
|
|
|
|
name = "Minecraft Libraries"
|
2024-09-04 19:12:06 -04:00
|
|
|
url = "https://libraries.minecraft.net"
|
|
|
|
|
|
|
|
content {
|
|
|
|
includeGroup "com.mojang"
|
|
|
|
}
|
2023-07-16 10:55:14 -04:00
|
|
|
}
|
2024-09-04 18:45:12 -04:00
|
|
|
maven {
|
|
|
|
name = "Jitpack"
|
|
|
|
url = "https://jitpack.io"
|
|
|
|
|
|
|
|
content {
|
|
|
|
includeGroup "com.github.Oryxel"
|
|
|
|
}
|
|
|
|
}
|
2023-01-04 14:58:09 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2024-11-05 14:34:52 -05:00
|
|
|
include "com.viaversion:viaversion-common:5.1.2-SNAPSHOT"
|
|
|
|
include "com.viaversion:viabackwards-common:5.1.2-SNAPSHOT"
|
2024-11-11 12:57:17 -05:00
|
|
|
include "com.viaversion:viarewind-common:4.0.4-SNAPSHOT"
|
|
|
|
include "net.raphimc:ViaLegacy:3.0.6-SNAPSHOT"
|
|
|
|
include "net.raphimc:viaaprilfools-common:3.0.5-SNAPSHOT"
|
2024-11-01 15:25:46 -04:00
|
|
|
include("net.raphimc:ViaBedrock:0.0.13-SNAPSHOT") {
|
2023-11-02 17:54:37 -04:00
|
|
|
exclude group: "io.netty"
|
|
|
|
exclude group: "io.jsonwebtoken"
|
2023-04-02 15:25:27 -04:00
|
|
|
}
|
2024-11-01 15:14:44 -04:00
|
|
|
include("net.raphimc:ViaLoader:3.0.4") {
|
2023-01-04 14:58:09 -05:00
|
|
|
exclude group: "org.slf4j", module: "slf4j-api"
|
|
|
|
}
|
|
|
|
|
2024-05-20 00:56:52 -04:00
|
|
|
include "com.google.code.gson:gson:2.11.0"
|
2024-10-21 03:42:57 -04:00
|
|
|
include "com.formdev:flatlaf:3.5.2"
|
2024-10-21 03:41:34 -04:00
|
|
|
include "com.formdev:flatlaf-extras:3.5.2"
|
2024-08-30 00:09:14 -04:00
|
|
|
include "org.apache.commons:commons-lang3:3.17.0"
|
2024-09-19 04:12:20 -04:00
|
|
|
include "commons-io:commons-io:2.17.0"
|
2023-01-04 14:58:09 -05:00
|
|
|
include "net.sf.jopt-simple:jopt-simple:5.0.4"
|
2024-09-30 13:43:53 -04:00
|
|
|
include "org.apache.logging.log4j:log4j-core:2.24.1"
|
2024-09-30 13:44:43 -04:00
|
|
|
include "org.apache.logging.log4j:log4j-slf4j-impl:2.24.1"
|
2023-10-13 01:05:25 -04:00
|
|
|
include "org.fusesource.jansi:jansi:2.4.1"
|
2023-09-04 13:36:24 -04:00
|
|
|
include("com.mojang:authlib:3.16.29") {
|
|
|
|
exclude group: "org.slf4j", module: "slf4j-api"
|
|
|
|
}
|
2024-07-03 17:01:21 -04:00
|
|
|
include "net.lenni0451.classtransform:mixinstranslator:1.14.0"
|
|
|
|
include "net.lenni0451.classtransform:mixinsdummy:1.14.0"
|
|
|
|
include "net.lenni0451.classtransform:additionalclassprovider:1.14.0"
|
2024-11-04 00:52:22 -05:00
|
|
|
include "net.lenni0451:Reflect:1.4.0"
|
2024-03-29 00:23:24 -04:00
|
|
|
include "net.lenni0451:LambdaEvents:2.4.2"
|
2024-10-07 00:29:53 -04:00
|
|
|
include("net.lenni0451:MCPing:1.4.2") {
|
2023-11-30 13:01:49 -05:00
|
|
|
exclude group: "com.google.code.gson", module: "gson"
|
|
|
|
}
|
2024-10-21 03:41:44 -04:00
|
|
|
include "net.lenni0451.commons:swing:1.6.1"
|
2024-10-25 18:37:08 -04:00
|
|
|
include("net.raphimc.netminecraft:all:3.0.0") {
|
2023-11-02 17:54:37 -04:00
|
|
|
exclude group: "com.google.code.gson", module: "gson"
|
|
|
|
}
|
2024-09-25 16:27:47 -04:00
|
|
|
include("net.raphimc:MinecraftAuth:4.1.1") {
|
2023-01-05 16:42:15 -05:00
|
|
|
exclude group: "com.google.code.gson", module: "gson"
|
|
|
|
exclude group: "org.slf4j", module: "slf4j-api"
|
|
|
|
}
|
2024-04-16 10:53:58 -04:00
|
|
|
include("org.cloudburstmc.netty:netty-transport-raknet:1.0.0.CR3-SNAPSHOT") {
|
2023-11-02 17:54:37 -04:00
|
|
|
exclude group: "io.netty"
|
2023-04-02 15:25:27 -04:00
|
|
|
}
|
2024-09-24 03:25:53 -04:00
|
|
|
include "gs.mclo:api:4.1.0"
|
2024-11-17 23:57:34 -05:00
|
|
|
include "net.lenni0451:optconfig:1.1.0"
|
2024-05-25 13:32:18 -04:00
|
|
|
|
2024-10-29 13:22:43 -04:00
|
|
|
includeJ8(compileOnly("xyz.wagyourtail.jvmdowngrader:jvmdowngrader:1.2.1"))
|
|
|
|
includeJ8 "xyz.wagyourtail.jvmdowngrader:jvmdowngrader-java-api:1.2.1:downgraded-8"
|
2023-01-04 14:58:09 -05:00
|
|
|
}
|
|
|
|
|
2023-09-05 15:29:58 -04:00
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
classTokenReplacer {
|
|
|
|
property("\${version}", project.version)
|
2024-11-13 18:52:42 -05:00
|
|
|
property("\${impl_version}", "git-${project.name}-${project.version}:${project.latestCommitHash().get()}")
|
2023-09-05 15:29:58 -04:00
|
|
|
}
|
|
|
|
}
|
2023-01-04 15:54:49 -05:00
|
|
|
}
|
|
|
|
|
2023-02-23 14:35:02 -05:00
|
|
|
java {
|
|
|
|
withSourcesJar()
|
|
|
|
}
|
|
|
|
|
2023-06-30 18:57:19 -04:00
|
|
|
application {
|
|
|
|
mainClass = "net.raphimc.viaproxy.ViaProxy"
|
|
|
|
}
|
|
|
|
|
2023-01-04 14:58:09 -05: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-06-30 18:57:19 -04:00
|
|
|
"Main-Class": application.mainClass,
|
2023-01-19 12:57:38 -05:00
|
|
|
"Multi-Release": "true",
|
2023-09-04 13:36:24 -04:00
|
|
|
"Launcher-Agent-Class": application.mainClass
|
2023-01-04 14:58:09 -05:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
from("LICENSE") {
|
2023-09-04 13:36:24 -04:00
|
|
|
rename { "${it}_${project.name ?: rootProject.name}" }
|
2023-01-04 14:58:09 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
publishing {
|
|
|
|
repositories {
|
|
|
|
maven {
|
2023-05-28 12:02:09 -04:00
|
|
|
name = "Via"
|
2023-05-28 12:00:36 -04:00
|
|
|
url = "https://repo.viaversion.com/"
|
2023-06-30 17:49:19 -04:00
|
|
|
|
2023-01-04 14:58:09 -05: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 17:49:19 -04: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 14:58:09 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-09-04 13:36:24 -04:00
|
|
|
|
2023-12-25 14:23:36 -05:00
|
|
|
idea {
|
|
|
|
module {
|
|
|
|
["run"].each {
|
|
|
|
excludeDirs << file("$it")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-05-25 13:32:18 -04:00
|
|
|
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
|
2024-07-22 13:02:33 -04:00
|
|
|
ignoreWarningsIn.add("net/lenni0451/commons/httpclient/executor/HttpClientExecutor")
|
2024-05-25 13:32:18 -04:00
|
|
|
archiveClassifier = null
|
|
|
|
archiveVersion = project.version + "+java8"
|
|
|
|
}
|
|
|
|
build.finalizedBy("downgradeJar")
|
2023-10-09 06:39:56 -04:00
|
|
|
|
2024-11-13 18:52:42 -05:00
|
|
|
Provider<String> latestCommitHash() {
|
|
|
|
return providers.exec {
|
|
|
|
commandLine = ["git", "rev-parse", "--short", "HEAD"]
|
|
|
|
}.standardOutput.getAsText().map(String::trim)
|
2023-10-09 06:39:56 -04:00
|
|
|
}
|