[*] Introduce Fabric helper and adjust a bunch of stuff
This commit is contained in:
@@ -9,8 +9,8 @@ plugins {
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.toVersion(libs.versions.java.main.get())
|
||||
targetCompatibility = JavaVersion.toVersion(libs.versions.java.main.get())
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
val testAgent = configurations.dependencyScope("mockitoAgent")
|
||||
|
||||
@@ -6,14 +6,40 @@ plugins {
|
||||
id("de.siphalor.tweed5.minecraft.mod.component")
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
tasks.shadowJar {
|
||||
relocate("org.apache.commons", "de.siphalor.tweed5.shadowed.org.apache.commons")
|
||||
}
|
||||
|
||||
val processMinecraftModResources = tasks.register<Sync>("processMinecraftModResources") {
|
||||
inputs.property("id", project.name)
|
||||
inputs.property("version", project.version)
|
||||
inputs.property("name", properties["module.name"])
|
||||
inputs.property("description", properties["module.description"])
|
||||
inputs.property("repoUrl", properties["git.url"])
|
||||
|
||||
from(project.layout.settingsDirectory.dir("../tweed5-minecraft/mod-template/resources"))
|
||||
expand(mapOf(
|
||||
"id" to project.name.replace('-', '_'),
|
||||
"version" to project.version,
|
||||
"name" to properties["module.name"],
|
||||
"description" to properties["module.description"],
|
||||
"repoUrl" to properties["git.url"],
|
||||
))
|
||||
into(project.layout.buildDirectory.dir("minecraftModResources"))
|
||||
}
|
||||
|
||||
val minecraftModJar = tasks.register<Jar>("minecraftModJar") {
|
||||
group = LifecycleBasePlugin.BUILD_GROUP
|
||||
|
||||
dependsOn(processMinecraftModResources)
|
||||
|
||||
from(zipTree(tasks.shadowJar.get().archiveFile))
|
||||
from(project.layout.buildDirectory.dir("minecraftModResources"))
|
||||
|
||||
destinationDirectory.set(layout.buildDirectory.dir("minecraftModLibs"))
|
||||
}
|
||||
@@ -24,11 +50,15 @@ tasks.assemble {
|
||||
val minecraftModSourcesJar = tasks.register<Jar>("minecraftModSourcesJar") {
|
||||
group = LifecycleBasePlugin.BUILD_GROUP
|
||||
|
||||
dependsOn(processMinecraftModResources)
|
||||
|
||||
from(zipTree(tasks.named<Jar>("sourcesJar").get().archiveFile))
|
||||
from(project.layout.buildDirectory.dir("minecraftModResources"))
|
||||
|
||||
archiveClassifier = "sources"
|
||||
destinationDirectory.set(layout.buildDirectory.dir("minecraftModLibs"))
|
||||
}
|
||||
|
||||
artifacts.add("minecraftModElements", minecraftModJar)
|
||||
artifacts.add("minecraftModApiElements", minecraftModJar)
|
||||
artifacts.add("minecraftModSourcesElements", minecraftModSourcesJar)
|
||||
|
||||
@@ -4,32 +4,6 @@ plugins {
|
||||
id("de.siphalor.tweed5.minecraft.mod.base")
|
||||
}
|
||||
|
||||
val processMinecraftModResources = tasks.register<Copy>("processMinecraftModResources") {
|
||||
inputs.property("id", project.name)
|
||||
inputs.property("version", project.version)
|
||||
inputs.property("name", properties["module.name"])
|
||||
inputs.property("description", properties["module.description"])
|
||||
|
||||
from(project.layout.settingsDirectory.dir("../tweed5-minecraft/mod-template/resources"))
|
||||
expand(mapOf(
|
||||
"id" to project.name,
|
||||
"version" to project.version,
|
||||
"name" to properties["module.name"],
|
||||
"description" to properties["module.description"]
|
||||
))
|
||||
into(project.layout.buildDirectory.dir("minecraftModResources"))
|
||||
}
|
||||
|
||||
tasks.named<Jar>("minecraftModJar") {
|
||||
from(project.layout.buildDirectory.dir("minecraftModResources"))
|
||||
dependsOn(processMinecraftModResources)
|
||||
}
|
||||
|
||||
tasks.named<Jar>("minecraftModSourcesJar") {
|
||||
from(project.layout.buildDirectory.dir("minecraftModResources"))
|
||||
dependsOn(processMinecraftModResources)
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
create<MavenPublication>("minecraftMod") {
|
||||
|
||||
Reference in New Issue
Block a user