[minecraft-bundle] Fix sources bundle
This commit is contained in:
@@ -25,11 +25,6 @@ dependencyResolutionManagement {
|
||||
}
|
||||
}
|
||||
}
|
||||
versionCatalogs {
|
||||
create("libs") {
|
||||
from(files("../../gradle/libs.versions.toml"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
includeBuild("../../conventions")
|
||||
@@ -0,0 +1,21 @@
|
||||
package de.siphalor.tweed5.minecraft.bundled.sources
|
||||
|
||||
import org.gradle.api.file.ArchiveOperations
|
||||
import org.gradle.api.file.ConfigurableFileCollection
|
||||
import org.gradle.api.tasks.InputFiles
|
||||
import org.gradle.api.tasks.TaskAction
|
||||
import org.gradle.api.tasks.bundling.Jar
|
||||
import javax.inject.Inject
|
||||
|
||||
abstract class BundledSourcesJar: Jar() {
|
||||
@get:InputFiles
|
||||
abstract val sources: ConfigurableFileCollection
|
||||
|
||||
@get:Inject
|
||||
abstract val archiveOperations: ArchiveOperations
|
||||
|
||||
@TaskAction
|
||||
override fun copy() {
|
||||
from(sources.filter { it.name.startsWith("tweed5") }.map { archiveOperations.zipTree(it) })
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
import de.siphalor.tweed5.minecraft.bundled.sources.BundledSourcesJar
|
||||
|
||||
plugins {
|
||||
id("de.siphalor.tweed5.minecraft.mod.dummy")
|
||||
}
|
||||
@@ -25,12 +27,7 @@ tasks.shadowJar {
|
||||
relocate("org.objectweb.asm", "de.siphalor.tweed5.shadowed.org.objectweb.asm")
|
||||
}
|
||||
|
||||
tasks.register<Jar>("sourcesJar") {
|
||||
inputs.files(bundledSourcesConfiguration)
|
||||
from(
|
||||
bundledSourcesConfiguration.get().resolve()
|
||||
.filter { it.name.startsWith(rootProject.name) }
|
||||
.map { zipTree(it) }
|
||||
)
|
||||
tasks.register<BundledSourcesJar>("sourcesJar") {
|
||||
sources.from(bundledSourcesConfiguration)
|
||||
archiveClassifier.set("sources")
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ rootProject.name = "tweed5-minecraft"
|
||||
|
||||
pluginManagement {
|
||||
includeBuild("../conventions")
|
||||
includeBuild("conventions")
|
||||
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
|
||||
Reference in New Issue
Block a user