Skip to content

Commit

Permalink
use mod-publish-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
mezz committed Sep 6, 2024
1 parent cac37fa commit 79599da
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 45 deletions.
34 changes: 20 additions & 14 deletions Fabric/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 {
Expand All @@ -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
Expand Down Expand Up @@ -210,23 +211,28 @@ tasks.register<TaskPublishCurseForge>("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<PublishModTask> {
dependsOn(tasks.jar, ":Changelog:makeMarkdownChangelog")
}
tasks.modrinth.get().dependsOn(tasks.remapJar)
tasks.modrinth.get().dependsOn(":Changelog:makeMarkdownChangelog")

tasks.named<Test>("test") {
useJUnitPlatform()
Expand Down
32 changes: 20 additions & 12 deletions Forge/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -185,22 +187,28 @@ tasks.register<TaskPublishCurseForge>("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<PublishModTask> {
dependsOn(tasks.jar, ":Changelog:makeMarkdownChangelog")
}
tasks.modrinth.get().dependsOn(tasks.jar)
tasks.modrinth.get().dependsOn(":Changelog:makeMarkdownChangelog")

tasks.named<Test>("test") {
useJUnitPlatform()
Expand Down
35 changes: 20 additions & 15 deletions NeoForge/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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")
}

Expand All @@ -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
Expand Down Expand Up @@ -163,24 +164,28 @@ tasks.register<TaskPublishCurseForge>("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<PublishModTask> {
dependsOn(tasks.jar, ":Changelog:makeMarkdownChangelog")
}
tasks.modrinth.get().dependsOn(tasks.jar)
tasks.modrinth.get().dependsOn(":Changelog:makeMarkdownChangelog")

tasks.named<Test>("test") {
useJUnitPlatform()
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 79599da

Please sign in to comment.