Mirror von
https://github.com/ViaVersion/ViaBackwards.git
synchronisiert 2024-12-25 15:50:12 +01:00
Update gradle build files
Co-authored-by: jmp <jasonpenilla2@me.com>
Dieser Commit ist enthalten in:
Ursprung
49d507dfad
Commit
fad65e5b81
3
.github/workflows/gradle.yml
vendored
3
.github/workflows/gradle.yml
vendored
@ -13,8 +13,9 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v1
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: 'adopt'
|
||||
java-version: 11
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew build
|
||||
|
@ -3,6 +3,7 @@ import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
|
||||
plugins {
|
||||
`java-library`
|
||||
`maven-publish`
|
||||
id("net.kyori.blossom") version "1.2.0" apply false
|
||||
}
|
||||
|
||||
allprojects {
|
||||
@ -33,27 +34,13 @@ subprojects {
|
||||
}
|
||||
}
|
||||
|
||||
val platforms = listOf(
|
||||
"bukkit",
|
||||
"bungee",
|
||||
"sponge",
|
||||
"velocity",
|
||||
"fabric"
|
||||
).map { "viabackwards-$it" }
|
||||
if (platforms.contains(project.name)) {
|
||||
configureShadowJar()
|
||||
}
|
||||
if (project.name == "viabackwards") {
|
||||
apply<ShadowPlugin>()
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven("https://repo.viaversion.com")
|
||||
maven("https://papermc.io/repo/repository/maven-public/")
|
||||
maven("https://oss.sonatype.org/content/repositories/snapshots/")
|
||||
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots")
|
||||
maven("https://nexus.velocitypowered.com/repository/velocity-artifacts-snapshots/")
|
||||
maven("https://repo.spongepowered.org/maven")
|
||||
maven("https://repo.maven.apache.org/maven2/")
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
java {
|
||||
@ -88,6 +75,16 @@ subprojects {
|
||||
}
|
||||
}
|
||||
|
||||
sequenceOf(
|
||||
projects.viabackwardsBukkit,
|
||||
projects.viabackwardsBungee,
|
||||
projects.viabackwardsFabric,
|
||||
projects.viabackwardsSponge,
|
||||
projects.viabackwardsVelocity
|
||||
).map { it.dependencyProject }.forEach { project ->
|
||||
project.configureShadowJar()
|
||||
}
|
||||
|
||||
tasks {
|
||||
withType<Jar> {
|
||||
onlyIf { false }
|
||||
|
@ -1,17 +0,0 @@
|
||||
object Versions {
|
||||
// ViaVersion
|
||||
const val viaversion = "3.3.0-21w14a"
|
||||
|
||||
// Common
|
||||
const val netty = "4.0.20.Final"
|
||||
const val guava = "17.0"
|
||||
const val fabricLoader = "0.4.8+build.154"
|
||||
const val log4j = "2.8.1"
|
||||
const val checkerQual = "3.12.0"
|
||||
|
||||
// Platforms
|
||||
const val spigot = "1.16.5-R0.1-SNAPSHOT"
|
||||
const val bungee = "1.16-R0.5-SNAPSHOT"
|
||||
const val sponge = "5.0.0-SNAPSHOT"
|
||||
const val velocity = "1.1.0-SNAPSHOT"
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
dependencies {
|
||||
implementation(project(":viabackwards-common"))
|
||||
compileOnly("org.spigotmc", "spigot-api", Versions.spigot) {
|
||||
implementation(projects.viabackwardsCommon)
|
||||
compileOnly(libs.paper) {
|
||||
exclude("com.google.code.gson", "gson")
|
||||
exclude("javax.persistence", "persistence-api")
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
dependencies {
|
||||
implementation(project(":viabackwards-common"))
|
||||
compileOnly("net.md-5", "bungeecord-api", Versions.bungee)
|
||||
implementation(projects.viabackwardsCommon)
|
||||
compileOnly(libs.bungee)
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id("net.kyori.blossom") version "1.2.0"
|
||||
id("net.kyori.blossom")
|
||||
}
|
||||
|
||||
blossom {
|
||||
@ -8,8 +8,8 @@ blossom {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("io.netty", "netty-all", Versions.netty)
|
||||
compileOnlyApi("us.myles", "viaversion", Versions.viaversion)
|
||||
compileOnlyApi("com.google.guava", "guava", Versions.guava)
|
||||
compileOnlyApi("org.checkerframework", "checker-qual", Versions.checkerQual)
|
||||
compileOnlyApi(libs.viaver)
|
||||
compileOnlyApi(libs.netty)
|
||||
compileOnlyApi(libs.guava)
|
||||
compileOnlyApi(libs.checkerQual)
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
dependencies {
|
||||
implementation(project(":viabackwards-common"))
|
||||
compileOnly("net.fabricmc", "fabric-loader", Versions.fabricLoader)
|
||||
compileOnly("org.apache.logging.log4j", "log4j-api", Versions.log4j)
|
||||
implementation(projects.viabackwardsCommon)
|
||||
compileOnly(libs.fabricLoader)
|
||||
compileOnly(libs.log4j)
|
||||
}
|
||||
|
37
gradle/libs.versions.toml
Normale Datei
37
gradle/libs.versions.toml
Normale Datei
@ -0,0 +1,37 @@
|
||||
metadata.format.version = "1.0"
|
||||
|
||||
[versions]
|
||||
|
||||
# ViaVersion
|
||||
viaver = "3.3.0-21w14a"
|
||||
|
||||
# Common provided
|
||||
netty = "4.0.20.Final"
|
||||
guava = "17.0"
|
||||
log4j = "2.8.1"
|
||||
|
||||
checkerQual = "3.12.0"
|
||||
|
||||
# Platforms
|
||||
paper = "1.16.5-R0.1-SNAPSHOT"
|
||||
bungee = "1.16-R0.5-SNAPSHOT"
|
||||
sponge = "5.0.0"
|
||||
velocity = "1.1.0-SNAPSHOT"
|
||||
fabricLoader = "0.4.8+build.154"
|
||||
|
||||
|
||||
[libraries]
|
||||
|
||||
viaver = { group = "us.myles", name = "viaversion", version.ref = "viaver" }
|
||||
|
||||
netty = { group = "io.netty", name = "netty-all", version.ref = "netty" }
|
||||
guava = { group = "com.google.guava", name = "guava", version.ref = "guava" }
|
||||
log4j = { group = "org.apache.logging.log4j", name = "log4j-api", version.ref = "log4j" }
|
||||
|
||||
checkerQual = { group = "org.checkerframework", name = "checker-qual", version.ref = "checkerQual" }
|
||||
|
||||
paper = { group = "com.destroystokyo.paper", name = "paper-api", version.ref = "paper" }
|
||||
bungee = { group = "net.md-5", name = "bungeecord-api", version.ref = "bungee" }
|
||||
sponge = { group = "org.spongepowered", name = "spongeapi", version.ref = "sponge" }
|
||||
velocity = { group = "com.velocitypowered", name = "velocity-api", version.ref = "velocity" }
|
||||
fabricLoader = { group = "net.fabricmc", name = "fabric-loader", version.ref = "fabricLoader" }
|
@ -1,5 +1,8 @@
|
||||
rootProject.name = "viabackwards-parent"
|
||||
|
||||
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
|
||||
enableFeaturePreview("VERSION_CATALOGS")
|
||||
|
||||
setupViaSubproject("common")
|
||||
setupViaSubproject("bukkit")
|
||||
setupViaSubproject("bungee")
|
||||
|
@ -1,5 +1,5 @@
|
||||
dependencies {
|
||||
implementation(project(":viabackwards-common"))
|
||||
compileOnly("org.spongepowered","spongeapi", Versions.sponge)
|
||||
annotationProcessor("org.spongepowered","spongeapi", Versions.sponge)
|
||||
implementation(projects.viabackwardsCommon)
|
||||
compileOnly(libs.sponge)
|
||||
annotationProcessor(libs.sponge)
|
||||
}
|
||||
|
@ -1,22 +1,26 @@
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
|
||||
plugins {
|
||||
id("com.github.johnrengelman.shadow")
|
||||
}
|
||||
|
||||
tasks {
|
||||
withType<ShadowJar> {
|
||||
archiveClassifier.set("")
|
||||
archiveFileName.set("ViaBackwards-${project.version}.jar")
|
||||
destinationDirectory.set(rootProject.projectDir.resolve("build/libs"))
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
arrayOf(
|
||||
"bukkit",
|
||||
"bungee",
|
||||
"sponge",
|
||||
"velocity",
|
||||
"fabric"
|
||||
).forEach {
|
||||
val subProject = rootProject.project(":viabackwards-$it")
|
||||
val shadowJarTask = subProject.tasks.getByName("shadowJar")
|
||||
from(zipTree(shadowJarTask.outputs.files.singleFile))
|
||||
sequenceOf(
|
||||
rootProject.projects.viabackwardsBukkit,
|
||||
rootProject.projects.viabackwardsBungee,
|
||||
rootProject.projects.viabackwardsFabric,
|
||||
rootProject.projects.viabackwardsSponge,
|
||||
rootProject.projects.viabackwardsVelocity,
|
||||
).map { it.dependencyProject }.forEach { subproject ->
|
||||
val shadowJarTask = subproject.tasks.getByName("shadowJar", ShadowJar::class)
|
||||
dependsOn(shadowJarTask)
|
||||
dependsOn(subproject.tasks.withType<Jar>())
|
||||
from(zipTree(shadowJarTask.archiveFile))
|
||||
}
|
||||
}
|
||||
build {
|
||||
|
@ -1,5 +1,5 @@
|
||||
dependencies {
|
||||
implementation(project(":viabackwards-common"))
|
||||
compileOnly("com.velocitypowered", "velocity-api", Versions.velocity)
|
||||
annotationProcessor("com.velocitypowered", "velocity-api", Versions.velocity)
|
||||
implementation(projects.viabackwardsCommon)
|
||||
compileOnly(libs.velocity)
|
||||
annotationProcessor(libs.velocity)
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren