Skip to content

Commit

Permalink
Clean up dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadiboo committed Jun 14, 2024
1 parent 1d722e8 commit d2d6fef
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 23 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
14 changes: 3 additions & 11 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
8 changes: 3 additions & 5 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand All @@ -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')) {
Expand Down

0 comments on commit d2d6fef

Please sign in to comment.