From d2d6fefa80590e4f9bfc9c88dc4a2158072c5ebe Mon Sep 17 00:00:00 2001 From: Cadiboo <37298044+Cadiboo@users.noreply.github.com> Date: Fri, 14 Jun 2024 23:32:44 +1000 Subject: [PATCH] Clean up dependencies --- build.gradle | 6 +++--- common/build.gradle | 8 ++++---- fabric/build.gradle | 14 +++----------- forge/build.gradle | 8 +++----- 4 files changed, 13 insertions(+), 23 deletions(-) diff --git a/build.gradle b/build.gradle index 2e084955..a8d898b4 100644 --- a/build.gradle +++ b/build.gradle @@ -20,8 +20,8 @@ group = mod_group ext { // For the config color picker (we include it in our production jar with ShadowJar) - COLOR_FACTORY = 'org.beryx:awt-color-factory:1.0.2' - MIXIN_EXTRAS = 'io.github.llamalad7:mixinextras-common:0.3.5' + COLOR_FACTORY_VERSION = '1.0.2' + MIXIN_EXTRAS_VERSION = '0.3.5' } subprojects { @@ -41,7 +41,7 @@ subprojects { // For unit tests testImplementation 'org.mockito:mockito-core:4.5.1' testImplementation 'junit:junit:4.13.2' - testImplementation("${rootProject.ext.COLOR_FACTORY}") + testImplementation group: 'org.beryx', name: 'awt-color-factory', version: rootProject.ext.COLOR_FACTORY_VERSION } jar { diff --git a/common/build.gradle b/common/build.gradle index c56fec74..19b3c13a 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -16,10 +16,10 @@ minecraft { dependencies { // Everything here should be compile only, since this common subproject is only ever compiled, never run - compileOnly group: 'org.spongepowered', name: 'mixin', version: '0.8.5' - compileOnly group: 'org.ow2.asm', name: 'asm-tree', version: '9.7' - compileOnly("${rootProject.ext.COLOR_FACTORY}") - compileOnly("${rootProject.ext.MIXIN_EXTRAS}") + compileOnly(group: 'org.spongepowered', name: 'mixin', version: '0.8.5') + compileOnly(group: 'org.ow2.asm', name: 'asm-tree', version: '9.7') + compileOnly(group: 'io.github.llamalad7', name: 'mixinextras-common', version: rootProject.ext.MIXIN_EXTRAS_VERSION) + compileOnly(group: 'org.beryx', name: 'awt-color-factory', version: rootProject.ext.COLOR_FACTORY_VERSION) // Unit test dependencies are handled by the root project build.gradle } diff --git a/fabric/build.gradle b/fabric/build.gradle index 579da482..7b1b19af 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -9,27 +9,19 @@ plugins { base { archivesName = "${mod_name}-fabric-${minecraft_version}" } -configurations { - library - implementation.extendsFrom library - shadow.extendsFrom library -} dependencies { minecraft "com.mojang:minecraft:${minecraft_version}" mappings loom.officialMojangMappings() modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}" testImplementation(compileOnly(project(':common'))) - // For @Nullable - compileOnly 'org.jetbrains:annotations:23.0.0' - // // From https://github.com/MinecraftForge/MinecraftForge/blob/0579572148079a6bc483ff42404878962fc48702/build.gradle#L55 // def NIGHTCONFIG_VERSION = '3.6.0' // // See https://github.com/MinecraftForge/MinecraftForge/blob/0579572148079a6bc483ff42404878962fc48702/build.gradle#L280-L281 -// library "com.electronwill.night-config:core:${NIGHTCONFIG_VERSION}" -// library "com.electronwill.night-config:toml:${NIGHTCONFIG_VERSION}" +// shadow(implementation("com.electronwill.night-config:core:${NIGHTCONFIG_VERSION}")) +// shadow(implementation("com.electronwill.night-config:toml:${NIGHTCONFIG_VERSION}")) - library("${rootProject.ext.COLOR_FACTORY}") + shadow(implementation(group: 'org.beryx', name: 'awt-color-factory', version: rootProject.ext.COLOR_FACTORY_VERSION)) // CompileOnly so our Mixins can target Sodium's classes def sodium = modCompileOnly 'maven.modrinth:sodium:mc1.20.1-0.5.7' diff --git a/forge/build.gradle b/forge/build.gradle index cf6988e7..b1bdac8a 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -62,8 +62,6 @@ minecraft { // See https://github.com/MinecraftForge/MinecraftForge/issues/8240#issuecomment-984621976 configurations { library - implementation.extendsFrom library - shadow.extendsFrom library } minecraft.runs.all { lazyToken('minecraft_classpath') { @@ -76,13 +74,13 @@ dependencies { testImplementation(compileOnly(project(':common'))) annotationProcessor('org.spongepowered:mixin:0.8.5-SNAPSHOT:processor') - library("${rootProject.ext.COLOR_FACTORY}") - library(annotationProcessor("${rootProject.ext.MIXIN_EXTRAS}")) + shadow(testImplementation(implementation(annotationProcessor(group: 'io.github.llamalad7', name: 'mixinextras-common', version: rootProject.ext.MIXIN_EXTRAS_VERSION)))) + shadow(library(implementation(group: 'org.beryx', name: 'awt-color-factory', version: rootProject.ext.COLOR_FACTORY_VERSION))) // embeddium-0.3.14+mc1.20.1.jar def embeddium = 'curse.maven:Embeddium-908741:5265338' // So we can compile our sodium compatibility code - compileOnly(fg.deobf('curse.maven:Embeddium-908741:5265338')) + compileOnly(fg.deobf(embeddium)) // For debugging on my local machine if (!System.getenv('CI')) {