diff --git a/common/build.gradle.kts b/common/build.gradle.kts index 875950d03..7a4355ac7 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -1,3 +1,5 @@ +import net.fabricmc.loom.task.RemapJarTask + plugins { id("java") id("idea") @@ -53,6 +55,30 @@ sourceSets { } } +tasks.register("apiJar") { + from(sourceSets["api"].output) + archiveBaseName.set("lithium-neoforge") + archiveClassifier.set("api") + destinationDirectory = rootDir.resolve("build").resolve("libs") +} + +tasks.register("remapApiJar") { + dependsOn("apiJar") + archiveBaseName.set("lithium-fabric") + archiveClassifier.set("api") + inputFile.set(tasks.named("apiJar").get().archiveFile) + destinationDirectory = rootDir.resolve("build").resolve("libs") +} + +tasks.named("jar") { + from(sourceSets["api"].output.classesDirs) + from(sourceSets["api"].output.resourcesDir) +} + +tasks.named("build") { + dependsOn("remapApiJar", "apiJar") +} + loom { mixin { defaultRefmapName = "lithium.refmap.json"