2022-10-07 16:03:38 +02:00
|
|
|
import io.gitlab.jfronny.scripts.*
|
2022-10-06 19:30:52 +02:00
|
|
|
|
|
|
|
plugins {
|
|
|
|
id("jfmod")
|
|
|
|
id("com.modrinth.minotaur")
|
|
|
|
}
|
|
|
|
|
2023-07-09 16:47:13 +02:00
|
|
|
val args = extensions.getByName("jfMod") as JfModExtension
|
|
|
|
|
2022-10-06 19:30:52 +02:00
|
|
|
val readmeFile = file("README.md")
|
|
|
|
|
|
|
|
modrinth {
|
|
|
|
token.set(System.getenv()["MODRINTH_API_TOKEN"])
|
2023-07-09 16:47:13 +02:00
|
|
|
projectId.set(args.modrinth.projectId)
|
2022-10-06 19:30:52 +02:00
|
|
|
versionName.set("[${lom.minecraftVersion.get()}] $versionS")
|
|
|
|
versionType.set(project.versionType.modrinthName)
|
|
|
|
changelog.set(project.changelog)
|
2022-12-03 16:45:52 +01:00
|
|
|
uploadFile.set(tasks.remapJar as Any)
|
2022-10-06 19:30:52 +02:00
|
|
|
gameVersions.add(lom.minecraftVersion.get())
|
|
|
|
loaders.add("fabric")
|
2023-07-09 16:47:13 +02:00
|
|
|
args.modrinth.requiredDependencies.getOrElse(listOf()).forEach { required.project(it) }
|
|
|
|
args.modrinth.optionalDependencies.getOrElse(listOf()).forEach { optional.project(it) }
|
2022-10-06 19:30:52 +02:00
|
|
|
if (readmeFile.exists()) {
|
|
|
|
syncBodyFrom.set(
|
|
|
|
"""${readmeFile.readText()}
|
|
|
|
|
|
|
|
[![Contact](https://img.shields.io/badge/-Contact-informational)](https://jfronny.gitlab.io/contact.html)"""
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.deployRelease.dependsOn(tasks.modrinth)
|
|
|
|
if (readmeFile.exists()) {
|
|
|
|
tasks.deployRelease.dependsOn(tasks.modrinthSyncBody)
|
|
|
|
}
|