Skip to content

Commit

Permalink
Build API jar, non-remapped (neoforge) and remapped (fabric)
Browse files Browse the repository at this point in the history
  • Loading branch information
2No2Name committed Nov 9, 2024
1 parent c1fc604 commit 8e5541b
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import net.fabricmc.loom.task.RemapJarTask

plugins {
id("java")
id("idea")
Expand Down Expand Up @@ -53,6 +55,30 @@ sourceSets {
}
}

tasks.register<Jar>("apiJar") {
from(sourceSets["api"].output)
archiveBaseName.set("lithium-neoforge")
archiveClassifier.set("api")
destinationDirectory = rootDir.resolve("build").resolve("libs")
}

tasks.register<RemapJarTask>("remapApiJar") {
dependsOn("apiJar")
archiveBaseName.set("lithium-fabric")
archiveClassifier.set("api")
inputFile.set(tasks.named<Jar>("apiJar").get().archiveFile)
destinationDirectory = rootDir.resolve("build").resolve("libs")
}

tasks.named<Jar>("jar") {
from(sourceSets["api"].output.classesDirs)
from(sourceSets["api"].output.resourcesDir)
}

tasks.named("build") {
dependsOn("remapApiJar", "apiJar")
}

loom {
mixin {
defaultRefmapName = "lithium.refmap.json"
Expand Down

0 comments on commit 8e5541b

Please # to comment.