Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version Catalog #155

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 10 additions & 16 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
val crowdControlVersion: String by project
val adventureVersion: String by project
val adventurePlatformVersion: String by project
val cloudVersion: String by project
val reflectionsVersion: String by project

dependencies {
api("com.google.guava:guava:32.0.1-jre")
api("dev.qixils.crowdcontrol:crowd-control-receiver:$crowdControlVersion")
api("net.kyori:adventure-api:$adventureVersion")
api("net.kyori:adventure-platform-api:$adventurePlatformVersion")
api("net.kyori:adventure-text-minimessage:$adventureVersion")
api("net.kyori:adventure-text-serializer-plain:$adventureVersion")
api("net.kyori:adventure-text-serializer-legacy:$adventureVersion")
api("cloud.commandframework:cloud-core:$cloudVersion")
api("cloud.commandframework:cloud-minecraft-extras:$cloudVersion")
implementation("org.reflections:reflections:$reflectionsVersion")
api(libs.guava)
api(libs.crowdcontrol.receiver)
api(libs.adventure.api)
api(libs.adventure.platform.api)
api(libs.adventure.text.minimessage)
api(libs.adventure.text.serializer.plain)
api(libs.adventure.text.serializer.legacy)
api(libs.cloud.core)
api(libs.cloud.minecraft.extras)
implementation(libs.reflections)
}

description = "Minecraft Crowd Control: Common"
Expand Down
4 changes: 1 addition & 3 deletions configurate-common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
val configurateVersion: String by project

description = "Minecraft Crowd Control: Common Code for Configurate v4"

dependencies {
api(project(":base-common"))
api("org.spongepowered:configurate-hocon:$configurateVersion")
api(libs.configurate.hocon)
}

tasks.processResources {
Expand Down
52 changes: 24 additions & 28 deletions fabric/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
val crowdControlVersion: String by project
val minecraftVersion: String by project
val parchmentVersion: String by project
val loaderVersion: String by project
val fabricVersion: String by project
val cloudVersion: String by project
val adventureVersion: String by project
val adventurePlatformFabricVersion: String by project
val cardinalComponentsVersion: String by project
val modMenuVersion: String by project
val clothConfigVersion: String by project

val isMinecraftRelease = Regex("^\\d+\\.\\d+\\.\\d+$").matches(minecraftVersion)

// shading configuration
val shade: Configuration by configurations.creating {
configurations.implementation.get().extendsFrom(this)
Expand Down Expand Up @@ -46,34 +32,43 @@ repositories {

dependencies {
shade(project(":configurate-common"))
minecraft("com.mojang:minecraft:$minecraftVersion")
minecraft(libs.minecraft.fabric)
mappings(loom.officialMojangMappings())
modCompileOnly("net.fabricmc:fabric-loader:$loaderVersion")
modCompileOnly("net.fabricmc.fabric-api:fabric-api:$fabricVersion")
modImplementation(include("net.kyori:adventure-platform-fabric:$adventurePlatformFabricVersion")!!)
modImplementation(include("cloud.commandframework:cloud-fabric:$cloudVersion")!!)
modApi(include("dev.onyxstudios.cardinal-components-api:cardinal-components-base:$cardinalComponentsVersion")!!)
modImplementation(include("dev.onyxstudios.cardinal-components-api:cardinal-components-entity:$cardinalComponentsVersion")!!)
modImplementation("com.terraformersmc:modmenu:$modMenuVersion")
modImplementation("me.shedaniel.cloth:cloth-config-fabric:$clothConfigVersion") {
modCompileOnly(libs.fabric.loader)
modCompileOnly(libs.fabric.api)

include(libs.adventure.platform.fabric)
modImplementation(libs.adventure.platform.fabric)

include(libs.cloud.fabric)
modImplementation(libs.cloud.fabric)

include(libs.cardinalcomponents.base)
modApi(libs.cardinalcomponents.base)

include(libs.cardinalcomponents.entity)
modImplementation(libs.cardinalcomponents.entity)

modImplementation(libs.modmenu)
modImplementation(libs.clothconfig.fabric) {
exclude(group = "net.fabricmc.fabric-api")
}


// misc includes
include("net.kyori:adventure-api:$adventureVersion")
include("me.shedaniel.cloth:cloth-config-fabric:$clothConfigVersion") {
include(libs.adventure.api)
include(libs.clothconfig.fabric) {
exclude(group = "net.fabricmc.fabric-api")
}
}

tasks.processResources {
inputs.property("version", project.version)
inputs.property("minecraftVersion", minecraftVersion)
inputs.property("minecraftVersion", libs.versions.minecraft.fabric)
filteringCharset = "UTF-8"

filesMatching("fabric.mod.json") {
expand("version" to project.version.toString() + "+fabric-$minecraftVersion")
expand("version" to project.version.toString() + "+fabric-${libs.versions.minecraft.fabric.get()}")
}
}

Expand Down Expand Up @@ -114,9 +109,10 @@ tasks.shadowJar {
}

tasks.remapJar {
inputs.property("minecraftVersion", libs.versions.minecraft.fabric)
// configure remapJar to use output of shadowJar
dependsOn(tasks.shadowJar)
inputFile.set(project.buildDir.resolve("libs/shadow-CrowdControl.jar"))
archiveBaseName.set("CrowdControl-Fabric+$minecraftVersion")
archiveBaseName.set("CrowdControl-Fabric+${libs.versions.minecraft.fabric.get()}")
archiveClassifier.set("")
}
9 changes: 0 additions & 9 deletions fabric/gradle.properties

This file was deleted.

7 changes: 0 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,3 @@ group = dev.qixils.crowdcontrol.plugin
version = 3.3.2-SNAPSHOT
# increase available memory
org.gradle.jvmargs=-Xmx2G
# variables
crowdControlVersion=3.7.0
adventureVersion=4.13.1
adventurePlatformVersion=4.3.0
cloudVersion=1.8.3
configurateVersion=4.1.2
reflectionsVersion=0.10.2
44 changes: 44 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[versions]
minecraft-fabric = "1.19.4"
minecraft-paper = "1.19.4"
crowdcontrol = "3.7.1"
adventure = "4.13.1"
adventure-platform = "4.3.0"
adventure-platform-fabric = "5.8.0"
cloud = "1.8.3"
configurate = "4.1.2"
reflections = "0.10.2"
guava = "32.0.1-jre"
fabric-loader = "0.14.17"
fabric-api = "0.75.3+1.19.4"
cardinalcomponents = "5.1.0"
modmenu = "6.1.0"
clothconfig = "10.0.96"

[libraries]
guava = { module = "com.google.guava:guava", version.ref = "guava" }
crowdcontrol-receiver = { module = "dev.qixils.crowdcontrol:crowd-control-receiver", version.ref = "crowdcontrol" }
adventure-api = { module = "net.kyori:adventure-api", version.ref = "adventure" }
adventure-text-minimessage = { module = "net.kyori:adventure-text-minimessage", version.ref = "adventure" }
adventure-text-serializer-plain = { module = "net.kyori:adventure-text-serializer-plain", version.ref = "adventure" }
adventure-text-serializer-legacy = { module = "net.kyori:adventure-text-serializer-legacy", version.ref = "adventure" }
adventure-platform-api = { module = "net.kyori:adventure-platform-api", version.ref = "adventure-platform" }
adventure-platform-spongeapi = { module = "net.kyori:adventure-platform-spongeapi", version.ref = "adventure-platform" }
adventure-platform-fabric = { module = "net.kyori:adventure-platform-fabric", version.ref = "adventure-platform-fabric" }
cloud-core = { module = "cloud.commandframework:cloud-core", version.ref = "cloud" }
cloud-minecraft-extras = { module = "cloud.commandframework:cloud-minecraft-extras", version.ref = "cloud" }
cloud-fabric = { module = "cloud.commandframework:cloud-fabric", version.ref = "cloud" }
cloud-paper = { module = "cloud.commandframework:cloud-paper", version.ref = "cloud" }
cloud-sponge7 = { module = "cloud.commandframework:cloud-sponge7", version.ref = "cloud" }
cloud-sponge8 = { module = "com.github.qixils.cloud:cloud-sponge", version = "feature~sponge-SNAPSHOT" }
reflections = { module = "org.reflections:reflections", version.ref = "reflections" }
minecraft-fabric = { module = "com.mojang:minecraft", version.ref = "minecraft-fabric" }
fabric-loader = { module = "net.fabricmc:fabric-loader", version.ref = "fabric-loader" }
fabric-api = { module = "net.fabricmc.fabric-api:fabric-api", version.ref = "fabric-api" }
cardinalcomponents-base = { module = "dev.onyxstudios.cardinal-components-api:cardinal-components-base", version.ref = "cardinalcomponents" }
cardinalcomponents-entity = { module = "dev.onyxstudios.cardinal-components-api:cardinal-components-entity", version.ref = "cardinalcomponents" }
modmenu = { module = "com.terraformersmc:modmenu", version.ref = "modmenu" }
clothconfig-fabric = { module = "me.shedaniel.cloth:cloth-config-fabric", version.ref = "clothconfig" }
sponge7 = { module = "org.spongepowered:spongeapi", version = "7.4.0" }
sponge8 = { module = "org.spongepowered:spongeapi", version = "8.1.0" }
configurate-hocon = { module = "org.spongepowered:configurate-hocon", version.ref = "configurate" }
8 changes: 3 additions & 5 deletions paper/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import xyz.jpenilla.runpaper.task.RunServer

val cloudVersion: String by project
val minecraftVersion: String by project

val minecraftVersion = libs.versions.minecraft.paper.get()
val mcVersionSplit = minecraftVersion.split(".")
description = "Minecraft Crowd Control: Paper"

Expand All @@ -17,8 +15,8 @@ repositories {

dependencies {
implementation(project(":base-common"))
implementation("cloud.commandframework:cloud-paper:${cloudVersion}")
compileOnly("io.papermc.paper:paper-api:$minecraftVersion-R0.1-SNAPSHOT")
implementation(libs.cloud.paper)
compileOnly("io.papermc.paper:paper-api:${libs.versions.minecraft.paper}-R0.1-SNAPSHOT")
}

// Java 17 boilerplate
Expand Down
1 change: 0 additions & 1 deletion paper/gradle.properties

This file was deleted.

9 changes: 3 additions & 6 deletions sponge-7/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
val cloudVersion: String by project
val adventurePlatformVersion: String by project

description = "Minecraft Crowd Control: Sponge 7"

repositories {
Expand All @@ -10,9 +7,9 @@ repositories {

dependencies {
implementation(project(":base-common"))
implementation("cloud.commandframework:cloud-sponge7:$cloudVersion")
implementation("net.kyori:adventure-platform-spongeapi:$adventurePlatformVersion")
compileOnly("org.spongepowered:spongeapi:7.4.0")
implementation(libs.cloud.sponge7)
implementation(libs.adventure.platform.spongeapi)
compileOnly(libs.sponge7)
}

tasks.processResources {
Expand Down
6 changes: 2 additions & 4 deletions sponge-8/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
val cloudVersion: String by project

description = "Minecraft Crowd Control: Sponge 8"

plugins {
Expand All @@ -20,8 +18,8 @@ repositories {

dependencies {
implementation(project(":configurate-common"))
implementation("com.github.qixils.cloud:cloud-sponge:feature~sponge-SNAPSHOT")
compileOnly("org.spongepowered:spongeapi:8.1.0")
implementation(libs.cloud.sponge8)
compileOnly(libs.sponge8)
//compileOnly("org.spongepowered:sponge:1.16.5-8.0.0-SNAPSHOT:dev")
}

Expand Down