@@ -6,6 +6,7 @@ plugins {
66
77 id(" me.modmuss50.mod-publish-plugin" )
88 `maven- publish`
9+ id(" com.gradleup.nmcp" )
910
1011 id(" dev.kikugie.postprocess.j52j" ) version " 2.1-beta.3"
1112}
@@ -151,7 +152,7 @@ val nativeTargets = listOf(
151152val nativeConfigurations = nativeTargets.associate { target ->
152153 target.configurationName to configurations.create(target.configurationName)
153154}
154- val nativeHashConfiguration = configurations.create(" nativeHashes" )
155+ val nativeHashConfiguration: Configuration = configurations.create(" nativeHashes" )
155156
156157nativeTargets.forEach { target ->
157158 dependencies {
@@ -242,42 +243,40 @@ publishMods {
242243 // modrinth and curseforge use different formats for snapshots. this can be expressed globally
243244 val stableMCVersions = versionList(" pub.stableMC" )
244245
245- val modrinthId: String by project
246- if (modrinthId.isNotBlank() && hasProperty(" modrinth.token" )) {
247- modrinth {
248- projectId.set(modrinthId)
249- accessToken.set(findProperty(" modrinth.token" )?.toString())
250- minecraftVersions.addAll(stableMCVersions)
251- minecraftVersions.addAll(versionList(" pub.modrinthMC" ))
246+ modrinth {
247+ accessToken = secrets.gradleProperty(" modrinth.accessToken" )
252248
253- announcementTitle = " Download $mcVersion for ${loader.replaceFirstChar { it.uppercase() }} from Modrinth "
249+ projectId = providers.gradleProperty( " pub.modrinthId " )
254250
255- requires { slug.set(" yacl" ) }
251+ minecraftVersions.addAll(stableMCVersions)
252+ minecraftVersions.addAll(versionList(" pub.modrinthMC" ))
256253
257- if (modstitch.isLoom) {
258- requires { slug.set(" fabric-api" ) }
259- optional { slug.set(" modmenu" ) }
260- }
254+ announcementTitle = " Download $mcVersion for ${loader.replaceFirstChar { it.uppercase() }} from Modrinth"
255+
256+ requires { slug.set(" yacl" ) }
257+
258+ if (modstitch.isLoom) {
259+ requires { slug.set(" fabric-api" ) }
260+ optional { slug.set(" modmenu" ) }
261261 }
262262 }
263263
264- val curseforgeId: String by project
265- if (curseforgeId.isNotBlank() && hasProperty(" curseforge.token" )) {
266- curseforge {
267- projectId = curseforgeId
268- projectSlug = findProperty(" curseforgeSlug" )!! .toString()
269- accessToken = findProperty(" curseforge.token" )?.toString()
270- minecraftVersions.addAll(stableMCVersions)
271- minecraftVersions.addAll(versionList(" pub.curseMC" ))
264+ curseforge {
265+ accessToken = secrets.gradleProperty(" curseforge.accessToken" )
272266
273- announcementTitle = " Download $mcVersion for ${loader.replaceFirstChar { it.uppercase() }} from CurseForge"
267+ projectId = providers.gradleProperty(" pub.curseforgeId" )
268+ projectSlug = providers.gradleProperty(" pub.curseforgeSlug" )
274269
275- requires { slug.set(" yacl" ) }
270+ minecraftVersions.addAll(stableMCVersions)
271+ minecraftVersions.addAll(versionList(" pub.curseMC" ))
276272
277- if (modstitch.isLoom) {
278- requires { slug.set(" fabric-api" ) }
279- optional { slug.set(" modmenu" ) }
280- }
273+ announcementTitle = " Download $mcVersion for ${loader.replaceFirstChar { it.uppercase() }} from CurseForge"
274+
275+ requires { slug.set(" yacl" ) }
276+
277+ if (modstitch.isLoom) {
278+ requires { slug.set(" fabric-api" ) }
279+ optional { slug.set(" modmenu" ) }
281280 }
282281 }
283282}
@@ -288,6 +287,33 @@ publishing {
288287
289288 artifactId = " controlify"
290289 groupId = " dev.isxander"
290+
291+ pom {
292+ name = modstitch.metadata.modName
293+ description = modstitch.metadata.modDescription
294+ url = " https://www.isxander.dev/projects/controlify"
295+ licenses {
296+ license {
297+ name = " LGPL-3.0-or-later"
298+ url = " https://www.gnu.org/licenses/lgpl-3.0.en.html"
299+ }
300+ }
301+ developers {
302+ developer {
303+ id = " isXander"
304+ name = " Xander"
305+ 306+ }
307+ }
308+ scm {
309+ url = " https://github.com/isXander/Controlify"
310+ connection = " scm:git:git//github.com/isXander/Controlify.git"
311+ developerConnection
= " scm:git:ssh://[email protected] /isXander/Controlify.git" 312+ }
313+ }
291314 }
292315 }
293316}
317+ signing {
318+ sign(publishing.publications[" mod" ])
319+ }
0 commit comments