Skip to content

Commit 5bf4bea

Browse files
fix: modrinth publishing (#3375)
1 parent 10fd8cb commit 5bf4bea

File tree

1 file changed

+13
-18
lines changed

1 file changed

+13
-18
lines changed

worldedit-bukkit/build.gradle.kts

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
import buildlogic.getLibrary
21
import buildlogic.sourceSets
3-
import buildlogic.stringyLibs
42
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
5-
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar.Companion.shadowJar
63
import io.papermc.paperweight.userdev.attribute.Obfuscation
74
import me.modmuss50.mpp.ReleaseType
8-
import kotlin.getOrElse
95

106
plugins {
117
`java-library`
@@ -256,39 +252,38 @@ publishMods {
256252
"FastAsyncWorldEdit/releases/tag/${project.version}")
257253

258254
val common = modrinthOptions {
259-
accessToken.set(System.getenv("MODRINTH_TOKEN"))
260-
projectId.set("z4HZZnLr")
261-
projectDescription.set(providers.fileContents { layout.projectDirectory.file("README.md") as File }.asText)
255+
accessToken = providers.environmentVariable("MODRINTH_TOKEN")
256+
projectId = "z4HZZnLr"
257+
projectDescription = providers.fileContents(layout.projectDirectory.file("README.md")).asText
262258
}
263259

264260
// We publish the reobfJar twice to ensure that the modrinth download menu picks the right jar for the platform regardless
265261
// of minecraft version.
266-
267-
val mojmapPaperVersions = listOf("1.20.6", "1.21.7", "1.21.8", "1.21.9", "1.21.10")
262+
val mojmapPaperVersions = listOf("1.20.6", "1.21.1", "1.21.4", "1.21.5", "1.21.6", "1.21.7", "1.21.8", "1.21.9", "1.21.10")
268263
val spigotMappedPaperVersions = listOf("1.20.2", "1.20.4")
269264

270265
// Mark reobfJar as spigot only for 1.20.5+
271266
modrinth("spigot") {
272267
from(common)
273-
file.set(tasks.named<ShadowJar>("reobfShadowJar").flatMap { it.archiveFile })
274-
minecraftVersions.set(mojmapPaperVersions)
275-
modLoaders.set(listOf("spigot"))
268+
file = tasks.named<ShadowJar>("reobfShadowJar").flatMap { it.archiveFile }
269+
minecraftVersions = mojmapPaperVersions
270+
modLoaders = listOf("spigot")
276271
}
277272

278273
// Mark reobfJar as spigot & paper for <1.20.5
279274
modrinth("spigotAndOldPaper") {
280275
from(common)
281-
file.set(tasks.named<ShadowJar>("reobfShadowJar").flatMap { it.archiveFile })
282-
minecraftVersions.set(spigotMappedPaperVersions)
283-
modLoaders.set(listOf("paper", "spigot"))
276+
file = tasks.named<ShadowJar>("reobfShadowJar").flatMap { it.archiveFile }
277+
minecraftVersions = spigotMappedPaperVersions
278+
modLoaders = listOf("paper", "spigot")
284279
}
285280

286281
// Mark mojang mapped jar as paper 1.20.5+ only
287282
modrinth {
288283
from(common)
289-
file.set(tasks.named<ShadowJar>("shadowJar").flatMap { it.archiveFile })
290-
minecraftVersions.set(mojmapPaperVersions)
291-
modLoaders.set(listOf("paper"))
284+
file = tasks.named<ShadowJar>("shadowJar").flatMap { it.archiveFile }
285+
minecraftVersions = mojmapPaperVersions
286+
modLoaders = listOf("paper")
292287
}
293288

294289
// dryRun.set(true) // For testing

0 commit comments

Comments
 (0)