diff --git a/conventions/src/main/kotlin/de.siphalor.tweed5.minecraft.mod.base.gradle.kts b/conventions/src/main/kotlin/de.siphalor.tweed5.minecraft.mod.base.gradle.kts index 6c95eb9..835b4d4 100644 --- a/conventions/src/main/kotlin/de.siphalor.tweed5.minecraft.mod.base.gradle.kts +++ b/conventions/src/main/kotlin/de.siphalor.tweed5.minecraft.mod.base.gradle.kts @@ -14,3 +14,47 @@ tasks.shadowJar { relocate("org.apache.commons", "de.siphalor.tweed5.shadowed.org.apache.commons") } +tasks.register("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"], + ) + ) + } + from(project.layout.settingsDirectory.file("../images/logo-48.png")) { + into("assets/tweed5") + } + into(project.layout.buildDirectory.dir("minecraftModResources")) +} + +tasks.register("processMinecraftTestmodResources") { + 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('-', '_')}_testmod", + "version" to project.version, + "name" to "${properties["module.name"]} (test mod)", + "description" to properties["module.description"], + "repoUrl" to properties["git.url"], + ) + ) + } + into(project.layout.buildDirectory.dir("minecraftTestmodResources")) +} diff --git a/conventions/src/main/kotlin/de.siphalor.tweed5.minecraft.mod.dummy.gradle.kts b/conventions/src/main/kotlin/de.siphalor.tweed5.minecraft.mod.dummy.gradle.kts index cc095d9..73ce67e 100644 --- a/conventions/src/main/kotlin/de.siphalor.tweed5.minecraft.mod.dummy.gradle.kts +++ b/conventions/src/main/kotlin/de.siphalor.tweed5.minecraft.mod.dummy.gradle.kts @@ -4,29 +4,11 @@ plugins { id("de.siphalor.tweed5.minecraft.mod.base") } -val processMinecraftModResources = tasks.register("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("minecraftModJar") { group = LifecycleBasePlugin.BUILD_GROUP dependsOn(tasks.shadowJar) - dependsOn(processMinecraftModResources) + dependsOn(tasks.named("processMinecraftModResources")) from(zipTree(tasks.shadowJar.get().archiveFile)) from(project.layout.buildDirectory.dir("minecraftModResources")) @@ -41,7 +23,7 @@ val minecraftModSourcesJar = tasks.register("minecraftModSourcesJar") { group = LifecycleBasePlugin.BUILD_GROUP dependsOn(tasks.named("sourcesJar")) - dependsOn(processMinecraftModResources) + dependsOn(tasks.named("processMinecraftModResources")) from(tasks.named("sourcesJar").get().archiveFile.map { if (it.asFile.exists()) { diff --git a/tweed5-minecraft/buildSrc/src/main/kotlin/de.siphalor.tweed5.minecraft.mod.cross-version.gradle.kts b/tweed5-minecraft/buildSrc/src/main/kotlin/de.siphalor.tweed5.minecraft.mod.cross-version.gradle.kts index f96de82..7aeca8f 100644 --- a/tweed5-minecraft/buildSrc/src/main/kotlin/de.siphalor.tweed5.minecraft.mod.cross-version.gradle.kts +++ b/tweed5-minecraft/buildSrc/src/main/kotlin/de.siphalor.tweed5.minecraft.mod.cross-version.gradle.kts @@ -140,40 +140,16 @@ afterEvaluate { } tasks.named("processResources") { - 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"].toString(), - "description" to properties["module.description"], - "repoUrl" to properties["git.url"], - )) - } + val processMinecraftModResources = tasks.named("processMinecraftModResources") + dependsOn(processMinecraftModResources) + from(processMinecraftModResources.get().destinationDir) duplicatesStrategy = DuplicatesStrategy.EXCLUDE } tasks.named("processTestmodResources") { - 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('-', '_') + "_testmod", - "version" to project.version, - "name" to properties["module.name"].toString() + " (test mod)", - "description" to properties["module.description"], - "repoUrl" to properties["git.url"], - )) - } + val processMinecraftTestmodResources = tasks.named("processMinecraftTestmodResources") + dependsOn(processMinecraftTestmodResources) + from(processMinecraftTestmodResources.get().destinationDir) duplicatesStrategy = DuplicatesStrategy.EXCLUDE } diff --git a/tweed5-minecraft/mod-template/resources/fabric.mod.json b/tweed5-minecraft/mod-template/resources/fabric.mod.json index 844f44f..b4bcbbc 100644 --- a/tweed5-minecraft/mod-template/resources/fabric.mod.json +++ b/tweed5-minecraft/mod-template/resources/fabric.mod.json @@ -18,7 +18,7 @@ "id": "tweed5", "name": "Tweed 5", "description": "Configuration focused libraries", - "icon": "assets/tweed4_base/icon.png", + "icon": "assets/tweed5/logo-48.png", "badges": [ "library" ] @@ -26,7 +26,7 @@ }, "modmenu:api": true }, - "icon": "assets/tweed5/icon.png", + "icon": "assets/tweed5/logo-48.png", "id": "${id}", "name": "${name}", "description": "${description}",