Skip to content

Commit

Permalink
Use JiJ for deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Su5eD committed Aug 8, 2024
1 parent 99b439f commit 1abf584
Showing 1 changed file with 11 additions and 41 deletions.
52 changes: 11 additions & 41 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import net.fabricmc.loom.util.Constants
import net.fabricmc.loom.util.download.Download
import net.fabricmc.loom.util.download.DownloadBuilder
import net.fabricmc.loom.util.srg.Tsrg2Writer
import net.fabricmc.lorenztiny.TinyMappingsWriter
import net.fabricmc.mappingio.MappingReader
import net.fabricmc.mappingio.MappingWriter
import net.fabricmc.mappingio.adapter.*
Expand All @@ -21,7 +20,6 @@ plugins {
java
`maven-publish`
id("org.cadixdev.licenser") version "0.6.1"
id("com.github.johnrengelman.shadow") version "8.1.1"
id("net.neoforged.gradleutils").version("3.0.0-alpha.10")
// Used for mapping tools only, provides TSRG writer on top of mappings-io
id("dev.architectury.loom") version "1.6-SNAPSHOT"
Expand Down Expand Up @@ -52,7 +50,6 @@ license {
}

val yarnMappings: Configuration by configurations.creating
val shade: Configuration by configurations.creating

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
Expand All @@ -67,21 +64,6 @@ sourceSets {
}
}

configurations {
implementation {
extendsFrom(shade)
}

runtimeElements {
setExtendsFrom(setOf())

outgoing {
artifacts.clear()
artifact(tasks.shadowJar)
}
}
}

repositories {
mavenCentral()
maven {
Expand All @@ -104,9 +86,9 @@ dependencies {
neoForge(group = "net.neoforged", name = "neoforge", version = versionForge)
yarnMappings(group = "net.fabricmc", name = "yarn", version = versionYarn)

shade("net.minecraftforge:srgutils:0.5.4")
shade("org.ow2.sat4j:org.ow2.sat4j.core:2.3.6")
shade("org.ow2.sat4j:org.ow2.sat4j.pb:2.3.6")
api(include("net.minecraftforge:srgutils:0.5.4")!!)
implementation(include("org.ow2.sat4j:org.ow2.sat4j.core:2.3.6")!!)
implementation(include("org.ow2.sat4j:org.ow2.sat4j.pb:2.3.6")!!)

testCompileOnly("org.jetbrains:annotations:23.0.0")
// Unit testing for mod metadata
Expand Down Expand Up @@ -185,26 +167,14 @@ val createTinyMappings by tasks.registering {
}

tasks {
setOf(jar, shadowJar).forEach { provider ->
provider.configure {
from(createMappings.flatMap { it.outputFile }) { rename { "mappings.tsrg" } }
from(createTinyMappings.map { it.outputs.files.singleFile }) { rename { "mappings/mappings.tiny" } }
manifest.attributes(
"FMLModType" to "LIBRARY",
"Automatic-Module-Name" to "net.fabricmc.loader",
"Implementation-Version" to archiveVersion.get()
)
}
}

shadowJar {
configurations = listOf(shade)
relocate("net.minecraftforge.srgutils", "reloc.net.minecraftforge.srgutils")
archiveClassifier.set("full")
}

assemble {
dependsOn(shadowJar)
jar {
from(createMappings.flatMap { it.outputFile }) { rename { "mappings.tsrg" } }
from(createTinyMappings.map { it.outputs.files.singleFile }) { rename { "mappings/mappings.tiny" } }
manifest.attributes(
"FMLModType" to "LIBRARY",
"Automatic-Module-Name" to "net.fabricmc.loader",
"Implementation-Version" to archiveVersion.get()
)
}
}

Expand Down

0 comments on commit 1abf584

Please sign in to comment.