From 79599dacaf326dfbcbde7b0b48c6bd4de031ed8c Mon Sep 17 00:00:00 2001 From: mezz Date: Fri, 6 Sep 2024 17:16:55 +0900 Subject: [PATCH] use mod-publish-plugin --- Fabric/build.gradle.kts | 34 ++++++++++++++++++++-------------- Forge/build.gradle.kts | 32 ++++++++++++++++++++------------ NeoForge/build.gradle.kts | 35 ++++++++++++++++++++--------------- build.gradle.kts | 4 ++-- gradle.properties | 4 ++-- 5 files changed, 64 insertions(+), 45 deletions(-) diff --git a/Fabric/build.gradle.kts b/Fabric/build.gradle.kts index 83c5f1681..4486f1c96 100644 --- a/Fabric/build.gradle.kts +++ b/Fabric/build.gradle.kts @@ -1,3 +1,4 @@ +import me.modmuss50.mpp.PublishModTask import net.darkhax.curseforgegradle.TaskPublishCurseForge import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestLogEvent @@ -9,7 +10,7 @@ plugins { `maven-publish` id("fabric-loom") id("net.darkhax.curseforgegradle") - id("com.modrinth.minotaur") + id("me.modmuss50.mod-publish-plugin") } repositories { @@ -28,7 +29,7 @@ val curseHomepageUrl: String by extra val curseProjectId: String by extra val fabricApiVersion: String by extra val fabricLoaderVersion: String by extra -val minecraftExtraCompatibleVersion: String by extra +val minecraftVersionRangeStart: String by extra val minecraftVersion: String by extra val modGroup: String by extra val modId: String by extra @@ -210,23 +211,28 @@ tasks.register("publishCurseForge") { mainFile.releaseType = CFG_Constants.RELEASE_TYPE_BETA mainFile.addJavaVersion("Java $modJavaVersion") mainFile.addGameVersion(minecraftVersion) - mainFile.addGameVersion(minecraftExtraCompatibleVersion) + mainFile.addGameVersion(minecraftVersionRangeStart) mainFile.addModLoader("Fabric") } -modrinth { - token.set(modrinthToken) - projectId.set("jei") - versionNumber.set("${project.version}") - versionName.set("${project.version} for Fabric $minecraftVersion") - versionType.set("beta") - uploadFile.set(tasks.remapJar.get()) +publishMods { + file.set(tasks.jar.get().archiveFile) changelog.set(provider { file("../Changelog/changelog.md").readText() }) - detectLoaders.set(false) - loaders.add("fabric") + type = BETA + modLoaders.add("fabric") + + modrinth { + projectId = "jei" + accessToken = modrinthToken + minecraftVersionRange { + start = minecraftVersionRangeStart + end = minecraftVersion + } + } +} +tasks.withType { + dependsOn(tasks.jar, ":Changelog:makeMarkdownChangelog") } -tasks.modrinth.get().dependsOn(tasks.remapJar) -tasks.modrinth.get().dependsOn(":Changelog:makeMarkdownChangelog") tasks.named("test") { useJUnitPlatform() diff --git a/Forge/build.gradle.kts b/Forge/build.gradle.kts index 2e4af8c42..927dde515 100644 --- a/Forge/build.gradle.kts +++ b/Forge/build.gradle.kts @@ -1,3 +1,4 @@ +import me.modmuss50.mpp.PublishModTask import net.darkhax.curseforgegradle.TaskPublishCurseForge import net.minecraftforge.gradle.common.tasks.DownloadMavenArtifact import net.minecraftforge.gradle.common.tasks.JarExec @@ -13,7 +14,7 @@ plugins { id("net.minecraftforge.gradle") id("org.parchmentmc.librarian.forgegradle") id("net.darkhax.curseforgegradle") - id("com.modrinth.minotaur") + id("me.modmuss50.mod-publish-plugin") } // gradle.properties @@ -22,6 +23,7 @@ val curseProjectId: String by extra val forgeVersion: String by extra val jUnitVersion: String by extra val minecraftVersion: String by extra +val minecraftVersionRangeStart: String by extra val modGroup: String by extra val modId: String by extra val modJavaVersion: String by extra @@ -185,22 +187,28 @@ tasks.register("publishCurseForge") { mainFile.releaseType = CFG_Constants.RELEASE_TYPE_BETA mainFile.addJavaVersion("Java $modJavaVersion") mainFile.addGameVersion(minecraftVersion) + mainFile.addGameVersion(minecraftVersionRangeStart) mainFile.addModLoader("Forge") } -modrinth { - token.set(modrinthToken) - projectId.set("jei") - versionNumber.set("${project.version}") - versionName.set("${project.version} for Forge $minecraftVersion") - versionType.set("beta") - uploadFile.set(tasks.jar.get()) +publishMods { + file.set(tasks.jar.get().archiveFile) changelog.set(provider { file("../Changelog/changelog.md").readText() }) - detectLoaders.set(false) - loaders.add("forge") + type = BETA + modLoaders.add("forge") + + modrinth { + projectId = "jei" + accessToken = modrinthToken + minecraftVersionRange { + start = minecraftVersionRangeStart + end = minecraftVersion + } + } +} +tasks.withType { + dependsOn(tasks.jar, ":Changelog:makeMarkdownChangelog") } -tasks.modrinth.get().dependsOn(tasks.jar) -tasks.modrinth.get().dependsOn(":Changelog:makeMarkdownChangelog") tasks.named("test") { useJUnitPlatform() diff --git a/NeoForge/build.gradle.kts b/NeoForge/build.gradle.kts index 8ec78d782..abcb23a60 100644 --- a/NeoForge/build.gradle.kts +++ b/NeoForge/build.gradle.kts @@ -1,3 +1,4 @@ +import me.modmuss50.mpp.PublishModTask import net.darkhax.curseforgegradle.TaskPublishCurseForge import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestLogEvent @@ -9,7 +10,7 @@ plugins { id("eclipse") id("maven-publish") id("net.darkhax.curseforgegradle") - id("com.modrinth.minotaur") + id("me.modmuss50.mod-publish-plugin") id("net.neoforged.moddev") } @@ -19,7 +20,7 @@ val curseProjectId: String by extra val neoforgeVersion: String by extra val jUnitVersion: String by extra val minecraftVersion: String by extra -val minecraftExtraCompatibleVersion: String by extra +val minecraftVersionRangeStart: String by extra val modGroup: String by extra val modId: String by extra val modJavaVersion: String by extra @@ -163,24 +164,28 @@ tasks.register("publishCurseForge") { mainFile.releaseType = CFG_Constants.RELEASE_TYPE_BETA mainFile.addJavaVersion("Java $modJavaVersion") mainFile.addGameVersion(minecraftVersion) - mainFile.addGameVersion(minecraftExtraCompatibleVersion) + mainFile.addGameVersion(minecraftVersionRangeStart) mainFile.addModLoader("NeoForge") } -modrinth { - token.set(modrinthToken) - projectId.set("jei") - versionNumber.set("${project.version}") - versionName.set("${project.version} for NeoForge $minecraftVersion") - versionType.set("beta") - uploadFile.set(tasks.jar.get()) +publishMods { + file.set(tasks.jar.get().archiveFile) changelog.set(provider { file("../Changelog/changelog.md").readText() }) - gameVersions.set(listOf(minecraftVersion, minecraftExtraCompatibleVersion)) - detectLoaders.set(false) - loaders.add("neoforge") + type = BETA + modLoaders.add("neoforge") + + modrinth { + projectId = "jei" + accessToken = modrinthToken + minecraftVersionRange { + start = minecraftVersionRangeStart + end = minecraftVersion + } + } +} +tasks.withType { + dependsOn(tasks.jar, ":Changelog:makeMarkdownChangelog") } -tasks.modrinth.get().dependsOn(tasks.jar) -tasks.modrinth.get().dependsOn(":Changelog:makeMarkdownChangelog") tasks.named("test") { useJUnitPlatform() diff --git a/build.gradle.kts b/build.gradle.kts index 95efacef2..aed5f08f0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,8 +14,8 @@ plugins { // https://plugins.gradle.org/plugin/net.darkhax.curseforgegradle id("net.darkhax.curseforgegradle") version("1.1.25") apply(false) - // https://plugins.gradle.org/plugin/com.modrinth.minotaur - id("com.modrinth.minotaur") version("2.8.7") apply(false) + // https://plugins.gradle.org/plugin/me.modmuss50.mod-publish-plugin + id("me.modmuss50.mod-publish-plugin") version("0.7.2") apply(false) // https://files.minecraftforge.net/net/minecraftforge/gradle/ForgeGradle/index.html id("net.minecraftforge.gradle") version("6.0.26") apply(false) diff --git a/gradle.properties b/gradle.properties index f91a50d47..b835d96d1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,8 +25,8 @@ minecraftVersion=1.21.1 minecraftVersionRange=[1.21, 1.21.1) # https://projects.neoforged.net/neoforged/neoform neoformTimestamp=20240808.144430 - -minecraftExtraCompatibleVersion=1.21 +# Earliest version of minecraft that is still compatible +minecraftVersionRangeStart=1.21 # Forge # https://files.minecraftforge.net/net/minecraftforge/forge/index_1.21.1.html