3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-11-20 06:50:10 +01:00

Update gradle build files

Co-authored-by: jmp <jasonpenilla2@me.com>
Dieser Commit ist enthalten in:
KennyTV 2021-04-14 13:58:59 +02:00
Ursprung 49d507dfad
Commit fad65e5b81
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B
12 geänderte Dateien mit 87 neuen und 62 gelöschten Zeilen

Datei anzeigen

@ -13,8 +13,9 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up JDK 11 - name: Set up JDK 11
uses: actions/setup-java@v1 uses: actions/setup-java@v2
with: with:
distribution: 'adopt'
java-version: 11 java-version: 11
- name: Build with Gradle - name: Build with Gradle
run: ./gradlew build run: ./gradlew build

Datei anzeigen

@ -3,6 +3,7 @@ import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
plugins { plugins {
`java-library` `java-library`
`maven-publish` `maven-publish`
id("net.kyori.blossom") version "1.2.0" apply false
} }
allprojects { 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 { repositories {
maven("https://repo.viaversion.com") maven("https://repo.viaversion.com")
maven("https://papermc.io/repo/repository/maven-public/")
maven("https://oss.sonatype.org/content/repositories/snapshots/") 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://nexus.velocitypowered.com/repository/velocity-artifacts-snapshots/")
maven("https://repo.spongepowered.org/maven") maven("https://repo.spongepowered.org/maven")
maven("https://repo.maven.apache.org/maven2/") mavenCentral()
} }
java { 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 { tasks {
withType<Jar> { withType<Jar> {
onlyIf { false } onlyIf { false }

Datei anzeigen

@ -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"
}

Datei anzeigen

@ -1,6 +1,6 @@
dependencies { dependencies {
implementation(project(":viabackwards-common")) implementation(projects.viabackwardsCommon)
compileOnly("org.spigotmc", "spigot-api", Versions.spigot) { compileOnly(libs.paper) {
exclude("com.google.code.gson", "gson") exclude("com.google.code.gson", "gson")
exclude("javax.persistence", "persistence-api") exclude("javax.persistence", "persistence-api")
} }

Datei anzeigen

@ -1,4 +1,4 @@
dependencies { dependencies {
implementation(project(":viabackwards-common")) implementation(projects.viabackwardsCommon)
compileOnly("net.md-5", "bungeecord-api", Versions.bungee) compileOnly(libs.bungee)
} }

Datei anzeigen

@ -1,5 +1,5 @@
plugins { plugins {
id("net.kyori.blossom") version "1.2.0" id("net.kyori.blossom")
} }
blossom { blossom {
@ -8,8 +8,8 @@ blossom {
} }
dependencies { dependencies {
compileOnly("io.netty", "netty-all", Versions.netty) compileOnlyApi(libs.viaver)
compileOnlyApi("us.myles", "viaversion", Versions.viaversion) compileOnlyApi(libs.netty)
compileOnlyApi("com.google.guava", "guava", Versions.guava) compileOnlyApi(libs.guava)
compileOnlyApi("org.checkerframework", "checker-qual", Versions.checkerQual) compileOnlyApi(libs.checkerQual)
} }

Datei anzeigen

@ -1,5 +1,5 @@
dependencies { dependencies {
implementation(project(":viabackwards-common")) implementation(projects.viabackwardsCommon)
compileOnly("net.fabricmc", "fabric-loader", Versions.fabricLoader) compileOnly(libs.fabricLoader)
compileOnly("org.apache.logging.log4j", "log4j-api", Versions.log4j) compileOnly(libs.log4j)
} }

37
gradle/libs.versions.toml Normale Datei
Datei anzeigen

@ -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" }

Datei anzeigen

@ -1,5 +1,8 @@
rootProject.name = "viabackwards-parent" rootProject.name = "viabackwards-parent"
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
enableFeaturePreview("VERSION_CATALOGS")
setupViaSubproject("common") setupViaSubproject("common")
setupViaSubproject("bukkit") setupViaSubproject("bukkit")
setupViaSubproject("bungee") setupViaSubproject("bungee")

Datei anzeigen

@ -1,5 +1,5 @@
dependencies { dependencies {
implementation(project(":viabackwards-common")) implementation(projects.viabackwardsCommon)
compileOnly("org.spongepowered","spongeapi", Versions.sponge) compileOnly(libs.sponge)
annotationProcessor("org.spongepowered","spongeapi", Versions.sponge) annotationProcessor(libs.sponge)
} }

Datei anzeigen

@ -1,22 +1,26 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id("com.github.johnrengelman.shadow")
}
tasks { tasks {
withType<ShadowJar> { withType<ShadowJar> {
archiveClassifier.set("") archiveClassifier.set("")
archiveFileName.set("ViaBackwards-${project.version}.jar") archiveFileName.set("ViaBackwards-${project.version}.jar")
destinationDirectory.set(rootProject.projectDir.resolve("build/libs")) destinationDirectory.set(rootProject.projectDir.resolve("build/libs"))
duplicatesStrategy = DuplicatesStrategy.EXCLUDE duplicatesStrategy = DuplicatesStrategy.EXCLUDE
arrayOf( sequenceOf(
"bukkit", rootProject.projects.viabackwardsBukkit,
"bungee", rootProject.projects.viabackwardsBungee,
"sponge", rootProject.projects.viabackwardsFabric,
"velocity", rootProject.projects.viabackwardsSponge,
"fabric" rootProject.projects.viabackwardsVelocity,
).forEach { ).map { it.dependencyProject }.forEach { subproject ->
val subProject = rootProject.project(":viabackwards-$it") val shadowJarTask = subproject.tasks.getByName("shadowJar", ShadowJar::class)
val shadowJarTask = subProject.tasks.getByName("shadowJar")
from(zipTree(shadowJarTask.outputs.files.singleFile))
dependsOn(shadowJarTask) dependsOn(shadowJarTask)
dependsOn(subproject.tasks.withType<Jar>())
from(zipTree(shadowJarTask.archiveFile))
} }
} }
build { build {

Datei anzeigen

@ -1,5 +1,5 @@
dependencies { dependencies {
implementation(project(":viabackwards-common")) implementation(projects.viabackwardsCommon)
compileOnly("com.velocitypowered", "velocity-api", Versions.velocity) compileOnly(libs.velocity)
annotationProcessor("com.velocitypowered", "velocity-api", Versions.velocity) annotationProcessor(libs.velocity)
} }