@@ -3,43 +3,32 @@ plugins {
33 id ' fabric-loom' version ' 1.15-SNAPSHOT' apply(false )
44 id ' net.neoforged.moddev' version ' 2.0.141' apply(false )
55 id " me.modmuss50.mod-publish-plugin" version " 1.1.0"
6+ id " dev.nanite.nanite-plugin" version " 0.1.0-SNAPSHOT"
67}
78
8- def ENV = System . getenv()
9+ nanite {
10+ changelog {
11+ file = file(" ./CHANGELOG.md" )
12+ }
13+ }
914
1015allprojects {
1116 apply plugin : ' idea'
1217 apply plugin : ' java-library'
1318 apply plugin : ' maven-publish'
1419
15- version = " ${ mod_version } -build. ${ ENV.GITHUB_RUN_NUMBER ?: 9999 } +mc ${ minecraft_version } "
20+ version = naniteUtils . createModVersion()
1621 group = maven_group
1722
1823 repositories {
1924 mavenLocal()
20- maven {
21- url = " https://jitpack.io"
22- content {
23- includeGroup " com.github.rtyley"
24- includeGroup " com.github.jagrosh"
25- }
26- }
27- maven {
28- url = " https://maven.latvian.dev/releases"
29- content {
30- includeGroup " dev.latvian.mods"
31- includeGroup " dev.latvian.apps"
32- }
33- }
3425 maven {
3526 url " https://maven.nanite.dev/releases"
3627 content {
3728 includeGroup " dev.nanite.forks"
29+ includeGroup " dev.nanite.mods"
3830 }
3931 }
40- maven {
41- url = " https://maven.shedaniel.me/"
42- }
4332 }
4433
4534 tasks. withType(JavaCompile ). configureEach {
@@ -57,7 +46,7 @@ allprojects {
5746
5847subprojects {
5948 base {
60- archivesName = rootProject . archives_base_name + project. name
49+ archivesName = " ${ archives_base_name} - $ project . name "
6150 }
6251
6352 if (project. name != " common" ) {
@@ -73,13 +62,15 @@ subprojects {
7362 def replaceProperties = [
7463 mod_id : mod_id,
7564 minecraft_version : minecraft_version,
76- minecraft_version_range : minecraft_version_range,
65+ minecraft_version_range_maven : minecraft_version_range_maven,
66+ minecraft_version_range_semver : minecraft_version_range_semver,
7767 neoforge_version : neoforge_version,
7868 neoforge_version_range : neoforge_version_range,
7969 fabric_loader_version : fabric_loader_version,
8070 fabric_api_version : fabric_api_version,
81- cloth_config_version : cloth_config_version,
82- cloth_config_version_range : cloth_config_version_range,
71+ fabric_api_version_range : fabric_api_version_range,
72+ nanite_library_version_maven : nanite_library_version_maven,
73+ nanite_library_version_semver : nanite_library_version_semver,
8374 version : version,
8475 ]
8576
@@ -114,57 +105,59 @@ subprojects {
114105 }
115106}
116107
108+ tasks. named(" publishMods" ) {
109+ dependsOn tasks. named(" createChangelog" )
110+ }
111+
117112publishMods {
118113 dryRun = providers. environmentVariable(" CURSE_TOKEN" ). getOrNull() == null
119- changelog = file( " ./CHANGELOG.md " ). text
120- version = " ${ mod_version } "
114+ changelog = tasks . named( " createChangelog " ). flatMap { it . outputFile } . map { it . asFile . text }
115+ version = project . version
121116 type = STABLE
122117
123- def fabricOptions = publishOptions {
124- file = project. provider { project(" :fabric" ). tasks. jar }. flatMap { it. archiveFile }
125- displayName = " [FABRIC][${ minecraft_version} ] ${ project.name} ${ mod_version} "
126- modLoaders. add(" fabric" )
127- }
128-
129- def neoforgeOptions = publishOptions {
130- file = project. provider { project(" :neoforge" ). tasks. jar }. flatMap { it. archiveFile }
131- displayName = " [NEOFORGE][${ minecraft_version} ] ${ project.name} ${ mod_version} "
132- modLoaders. add(" neoforge" )
133- }
118+ def createOptions = { String modLoader -> publishOptions {
119+ file = project. provider { project(" :${ modLoader} " ). tasks. jar }. flatMap { it. archiveFile }
120+ displayName = " SimpleDiscordRichPresense ${ modLoader.capitalize()} ${ project.version} "
121+ modLoaders. add(modLoader)
122+ }}
134123
135124 def curseForgeOptions = curseforgeOptions {
136125 accessToken = providers. environmentVariable(" CURSE_TOKEN" )
137126 projectId = " ${ curseforge_id} "
138- minecraftVersions. add(" ${ minecraft_version} " )
127+ supported_minecraft_versions. split(" ," ). each {
128+ minecraftVersions. add(it. trim())
129+ }
139130 }
140131
141132 def modrinthOptions = modrinthOptions {
142133 accessToken = providers. environmentVariable(" MODRINTH_TOKEN" )
143134 projectId = " ${ modrinth_id} "
144- minecraftVersions. add(" ${ minecraft_version} " )
135+ supported_minecraft_versions. split(" ," ). each {
136+ minecraftVersions. add(it. trim())
137+ }
145138 }
146139
147140 curseforge(" curseforgeFabric" ) {
148- from(curseForgeOptions, fabricOptions )
141+ from(curseForgeOptions, createOptions( " fabric " ) )
149142 requires(" fabric-api" )
150- requires(" cloth-config " )
143+ requires(" nanite-library " )
151144 }
152145
153146 curseforge(" curseforgeNeoforge" ) {
154- from(curseForgeOptions, neoforgeOptions )
155- requires(" cloth-config " )
147+ from(curseForgeOptions, createOptions( " neoforge " ) )
148+ requires(" nanite-library " )
156149 }
157150
158151 if (providers. environmentVariable(" MODRINTH_TOKEN" ). getOrNull() != null ) {
159152 modrinth(" modrinthFabric" ) {
160153 from(modrinthOptions, fabricOptions)
161154 requires(" fabric-api" )
162- requires(" cloth-config " )
155+ requires(" nanite-library " )
163156 }
164157
165158 modrinth(" modrinthNeoforge" ) {
166159 from(modrinthOptions, neoforgeOptions)
167- requires(" cloth-config " )
160+ requires(" nanite-library " )
168161 }
169162 }
170163}
0 commit comments