ViaProxy/build.gradle
2023-09-21 18:22:28 +02:00

214 lines
6.4 KiB
Groovy

import net.raphimc.javadowngrader.gradle.task.DowngradeJarTask
buildscript {
repositories {
maven {
name = "Lenni0451"
url "https://maven.lenni0451.net/everything"
}
}
dependencies {
classpath "net.raphimc.javadowngrader:gradle-plugin:1.0.1-SNAPSHOT"
}
}
plugins {
id "java"
id "application"
id "maven-publish"
id "net.raphimc.class-token-replacer" version "1.0.0"
}
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
implementation.extendsFrom include
api.extendsFrom include
}
repositories {
mavenCentral()
maven {
name = "Jitpack"
url = "https://jitpack.io"
}
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 = "ViaVersion"
url "https://repo.viaversion.com"
}
maven {
name = "Minecraft Libraries"
url "https://libraries.minecraft.net"
}
}
dependencies {
include "com.viaversion:viaversion:4.8.0"
include("com.viaversion:viabackwards-common:4.8.0") {
exclude group: "com.viaversion", module: "viaversion"
exclude group: "io.netty", module: "netty-all"
exclude group: "com.google.guava", module: "guava"
}
include "com.viaversion:viarewind-common:3.0.0"
include "net.raphimc:ViaLegacy:2.2.19"
include "net.raphimc:ViaAprilFools:2.0.9"
include("net.raphimc:ViaBedrock:0.0.3-SNAPSHOT") {
exclude group: "io.netty", module: "netty-codec-http"
exclude group: "io.jsonwebtoken", module: "jjwt-impl"
exclude group: "io.jsonwebtoken", module: "jjwt-gson"
}
include("net.raphimc:ViaLoader:2.2.9") {
exclude group: "org.slf4j", module: "slf4j-api"
}
include "com.google.code.gson:gson:2.10.1"
include "com.formdev:flatlaf:3.2.1"
include "com.google.guava:guava:32.1.2-jre"
include "org.apache.commons:commons-lang3:3.13.0"
include "commons-io:commons-io:2.13.0"
include "net.sf.jopt-simple:jopt-simple:5.0.4"
include "org.apache.logging.log4j:log4j-core:2.20.0"
include "org.apache.logging.log4j:log4j-slf4j-impl:2.20.0"
include "org.fusesource.jansi:jansi:2.4.0"
include("com.mojang:authlib:3.16.29") {
exclude group: "org.slf4j", module: "slf4j-api"
}
include "net.lenni0451.classtransform:mixinstranslator:1.11.0"
include "net.lenni0451.classtransform:mixinsdummy:1.11.0"
include "net.lenni0451.classtransform:additionalclassprovider:1.11.0"
include "net.lenni0451:Reflect:1.2.4"
include "net.lenni0451:LambdaEvents:2.2.0"
include "net.raphimc.netminecraft:all:2.3.7-SNAPSHOT"
include("net.raphimc:MinecraftAuth:2.1.6-SNAPSHOT") {
exclude group: "com.google.code.gson", module: "gson"
exclude group: "org.slf4j", module: "slf4j-api"
}
include("net.raphimc.javadowngrader:impl-classtransform:1.0.1-SNAPSHOT") {
exclude group: "org.ow2.asm", module: "asm-commons"
exclude group: "net.lenni0451.classtransform", module: "additionalclassprovider"
}
include("org.cloudburstmc.netty:netty-transport-raknet:1.0.0.CR1-SNAPSHOT") {
exclude group: "io.netty", module: "netty-common"
exclude group: "io.netty", module: "netty-buffer"
exclude group: "io.netty", module: "netty-codec"
exclude group: "io.netty", module: "netty-transport"
}
include "gs.mclo:api:3.0.1"
include "org.swinglabs:swingx:1.6.1"
}
sourceSets {
main {
classTokenReplacer {
property("\${version}", project.version)
}
}
}
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"
}
}
}
}
}
tasks.register("java8Jar", DowngradeJarTask) {
input = tasks.jar.archiveFile.get().asFile
outputSuffix = "+java8"
compileClassPath = sourceSets.main.compileClasspath
copyRuntimeClasses = false
}.get().dependsOn("build")
build.finalizedBy("java8Jar")