Skip to content

Commit

Permalink
Fix legacy publish setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Erdragh committed Feb 8, 2025
1 parent 7aa70eb commit b75fffe
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions forge/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import me.modmuss50.mpp.ReleaseType
import me.modmuss50.mpp.platforms.curseforge.CurseforgeOptions
import me.modmuss50.mpp.platforms.modrinth.ModrinthOptions
import org.gradle.internal.extensions.stdlib.capitalized
import org.jetbrains.kotlin.gradle.utils.extendsFrom

Expand Down Expand Up @@ -60,4 +63,37 @@ dependencies {

configurations.named("additionalRuntimeClasspath").extendsFrom(configurations.botLib)
configurations.jarJar.extendsFrom(configurations.botLib)
}

publishMods {
val minecraftVersion: String = libs.versions.minecraft.get()
val modName: String by project
val version: String by project

val titles: Map<String, String> by extra
val curseforgePublish: Provider<CurseforgeOptions> by extra
val modrinthPublish: Provider<ModrinthOptions> by extra

changelog = extra.get("changelog") as String
type = extra.get("type") as ReleaseType

curseforge("curseForge") {
from(curseforgePublish)
modLoaders.add(project.name)
file.set(tasks.jar.get().archiveFile)
additionalFiles.plus(tasks.sourcesJar.get().archiveFile)
displayName = "$modName $version ${titles[project.name]} $minecraftVersion"
this.version = "$version-mc$minecraftVersion-${project.name}"
requires("kotlin-for-forge")
}

modrinth("modrinthForge") {
from(modrinthPublish)
modLoaders.add(project.name)
file.set(tasks.jar.get().archiveFile)
additionalFiles.plus(tasks.sourcesJar.get().archiveFile)
displayName = "$modName $version ${titles[project.name]} $minecraftVersion"
this.version = "$version-mc$minecraftVersion-${project.name}"
requires("kotlin-for-forge")
}
}

0 comments on commit b75fffe

Please sign in to comment.