File tree Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 2525
2626# Files from Forge MDK
2727forge * changelog.txt
28+
29+ # Changelog for unified publishing
30+ CHANGELOG.md
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ plugins {
44 id ' idea'
55 id ' maven-publish'
66 id ' net.neoforged.gradle.userdev' version ' 7.0.181'
7+ id " me.shedaniel.unified-publishing" version " 0.1.+"
78}
89
910version = mod_version
@@ -223,6 +224,41 @@ tasks.withType(JavaCompile).configureEach {
223224 options. encoding = ' UTF-8' // Use the UTF-8 charset for Java compilation
224225}
225226
227+ tasks. publishUnified {
228+ dependsOn tasks. getByName(" build" )
229+ }
230+
231+ unifiedPublishing {
232+ project {
233+ displayName = " Energized Power - " + project. minecraft_version + " - v" + project. mod_version. split(" -" )[1 ] + " [NeoForge]"
234+ version = project. mod_version
235+ changelog = new File (" CHANGELOG.md" ). getText(" UTF-8" )
236+ releaseType = " release"
237+ gameVersions = [project. minecraft_version]
238+ gameLoaders = [" neoforge" ]
239+
240+ mainPublication. set(project. rootDir. toPath(). resolve(" build/libs" ). resolve(project. mod_id + " -" + project. version + " .jar" ). toFile())
241+
242+ relations {
243+ // No dependencies
244+ }
245+
246+ if (project. hasProperty(' MODRINTH_TOKEN' )) {
247+ modrinth {
248+ token = getProperty(' MODRINTH_TOKEN' ) as String
249+ id = " 6pku8gW1"
250+ }
251+ }
252+
253+ if (project. hasProperty(' CURSEFORGE_TOKEN' )) {
254+ curseforge {
255+ token = getProperty(' CURSEFORGE_TOKEN' ) as String
256+ id = " 782147"
257+ }
258+ }
259+ }
260+ }
261+
226262// IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior.
227263idea {
228264 module {
Original file line number Diff line number Diff line change @@ -2,5 +2,6 @@ pluginManagement {
22 repositories {
33 gradlePluginPortal()
44 maven { url = ' https://maven.neoforged.net/releases' }
5+ maven { url " https://maven.architectury.dev/" }
56 }
67}
You can’t perform that action at this time.
0 commit comments