Skip to content

Commit a3aa033

Browse files
committed
Make our maven pom override less hardcoded
1 parent 971c26a commit a3aa033

1 file changed

Lines changed: 19 additions & 30 deletions

File tree

build.gradle.kts

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,8 @@ allprojects {
4040
}
4141

4242
configurations {
43-
val implementationOnly = create("implementationOnly") //A non-transitive implementation
44-
runtimeClasspath.get().extendsFrom(implementationOnly)
45-
compileClasspath.get().extendsFrom(implementationOnly)
43+
val transitiveImplementation = create("transitiveImplementation")
44+
implementation.get().extendsFrom(transitiveImplementation)
4645

4746
// Required cause loom 0.14 for some reason doesn't remove asm-all 4.1. Ew.
4847
all {
@@ -56,7 +55,7 @@ allprojects {
5655
implementation("org.apache.logging.log4j:log4j-slf4j18-impl:2.17.2")
5756

5857
implementation("org.apache.logging.log4j:log4j-core:2.17.2")
59-
implementation("com.google.guava:guava:31.1-jre")
58+
implementation("com.google.guava:guava:33.2.1-jre")
6059
implementation("com.google.code.gson:gson:2.9.0")
6160

6261
//to change the versions see the gradle.properties file
@@ -69,17 +68,17 @@ allprojects {
6968
implementation("io.github.llamalad7:mixinextras-fabric:${project.properties["mixinextras_version"]}")
7069
annotationProcessor("io.github.llamalad7:mixinextras-fabric:${project.properties["mixinextras_version"]}")
7170

72-
"implementationOnly"("org.apache.commons:commons-lang3:3.12.0")
73-
"implementationOnly"("commons-io:commons-io:2.11.0")
74-
implementation("net.jodah:typetools:${project.properties["typetools_version"]}")
75-
implementation("com.github.mineLdiver:expressions:${project.properties["expressions_version"]}")
76-
implementation("com.github.mineLdiver:UnsafeEvents:${project.properties["unsafeevents_version"]}")
77-
implementation("it.unimi.dsi:fastutil:${project.properties["fastutil_version"]}")
71+
"transitiveImplementation"("org.apache.commons:commons-lang3:3.12.0")
72+
"transitiveImplementation"("commons-io:commons-io:2.11.0")
73+
"transitiveImplementation"("net.jodah:typetools:${project.properties["typetools_version"]}")
74+
"transitiveImplementation"("com.github.mineLdiver:expressions:${project.properties["expressions_version"]}")
75+
"transitiveImplementation"("com.github.mineLdiver:UnsafeEvents:${project.properties["unsafeevents_version"]}")
76+
"transitiveImplementation"("it.unimi.dsi:fastutil:${project.properties["fastutil_version"]}")
7877
//noinspection GradlePackageUpdate
79-
implementation("com.github.ben-manes.caffeine:caffeine:${project.properties["caffeine_version"]}")
80-
implementation("com.mojang:datafixerupper:${project.properties["dfu_version"]}")
81-
implementation("maven.modrinth:spasm:${project.properties["spasm_version"]}")
82-
implementation("com.oath.cyclops:cyclops:${project.properties["cyclops_version"]}")
78+
"transitiveImplementation"("com.github.ben-manes.caffeine:caffeine:${project.properties["caffeine_version"]}")
79+
"transitiveImplementation"("com.mojang:datafixerupper:${project.properties["dfu_version"]}")
80+
"transitiveImplementation"("maven.modrinth:spasm:${project.properties["spasm_version"]}")
81+
"transitiveImplementation"("com.oath.cyclops:cyclops:${project.properties["cyclops_version"]}")
8382

8483
// convenience stuff
8584
// adds some useful annotations for data classes. does not add any dependencies
@@ -89,7 +88,7 @@ allprojects {
8988
testAnnotationProcessor("org.projectlombok:lombok:1.18.30")
9089

9190
// adds some useful annotations for miscellaneous uses. does not add any dependencies, though people without the lib will be missing some useful context hints.
92-
"implementationOnly"("org.jetbrains:annotations:23.0.0")
91+
implementation("org.jetbrains:annotations:23.0.0")
9392

9493
modLocalRuntime("com.github.calmilamsy:ModMenu:${project.properties["modmenu_version"]}") {
9594
isTransitive = false
@@ -183,24 +182,14 @@ allprojects {
183182

184183
pom {
185184
withXml {
185+
// Wipes dependency block, cause it's just hopelessly wrong, and also includes floader for some reason
186186
val depsNode = asNode().appendNode("dependencies")
187187
// Jank solution to an annoying issue
188-
val deps = arrayListOf<Array<String>>()
189-
deps.add(arrayOf("net.jodah", "typetools", "${project.properties["typetools_version"]}"))
190-
deps.add(arrayOf("com.github.mineLdiver", "expressions", "${project.properties["expressions_version"]}"))
191-
deps.add(arrayOf("com.github.mineLdiver", "UnsafeEvents", "${project.properties["unsafeevents_version"]}"))
192-
deps.add(arrayOf("it.unimi.dsi", "fastutil", "${project.properties["fastutil_version"]}"))
193-
deps.add(arrayOf("com.github.ben-manes.caffeine", "caffeine", "${project.properties["caffeine_version"]}"))
194-
deps.add(arrayOf("com.mojang", "datafixerupper", "${project.properties["dfu_version"]}"))
195-
deps.add(arrayOf("org.apache.commons", "commons-lang3", "3.5"))
196-
deps.add(arrayOf("commons-io", "commons-io", "2.5"))
197-
deps.add(arrayOf("maven.modrinth", "spasm", "${project.properties["spasm_version"]}"))
198-
deps.add(arrayOf("com.oath.cyclops", "cyclops", "${project.properties["cyclops_version"]}"))
199-
deps.forEach {
188+
configurations.getByName("transitiveImplementation").dependencies.forEach {
200189
val depNode = depsNode.appendNode("dependency")
201-
depNode.appendNode("groupId", it[0])
202-
depNode.appendNode("artifactId", it[1])
203-
depNode.appendNode("version", it[2])
190+
depNode.appendNode("groupId", it.group)
191+
depNode.appendNode("artifactId", it.name)
192+
depNode.appendNode("version", it.version)
204193
depNode.appendNode("scope", "compile")
205194
}
206195
}

0 commit comments

Comments
 (0)