@@ -30,11 +30,12 @@ import java.nio.charset.Charset
3030plugins {
3131 id(" java" )
3232 id(" maven-publish" )
33- id(" com.gradleup.shadow" ) version " 8.3.5 "
34- id(" io.papermc.hangar-publish-plugin" ) version " 0.1.2 "
35- id(" com.modrinth.minotaur" ) version " 2.8.7 "
36- id(" xyz.jpenilla.run-paper" ) version " 2.3.1 "
33+ id(" com.gradleup.shadow" ) version " 9.4.1 "
34+ id(" io.papermc.hangar-publish-plugin" ) version " 0.1.4 "
35+ id(" com.modrinth.minotaur" ) version " 2.9.0 "
36+ id(" xyz.jpenilla.run-paper" ) version " 3.0.2 "
3737 id(" io.github.apdevteam.github-packages" ) version " 1.2.2"
38+ id(" org.ajoberstar.grgit" ) version (" 5.3.3" )
3839}
3940
4041group = " com.dre.brewery"
@@ -147,7 +148,7 @@ tasks {
147148 outputs.upToDateWhen { false }
148149 filter<ReplaceTokens >(
149150 mapOf (
150- " tokens" to mapOf (" version" to " ${project.version} ;${getGitBranch() } " ),
151+ " tokens" to mapOf (" version" to " ${project.version} ;${grgit.branch.current().name } " ),
151152 " beginToken" to " \$ {" ,
152153 " endToken" to " }"
153154 )
@@ -291,19 +292,6 @@ hangarPublish {
291292 }
292293}
293294
294-
295-
296- fun getGitBranch (): String = ByteArrayOutputStream ().use { stream ->
297- var branch = " none"
298- // TODO: can some nice person replace this deprecated method please? :)
299- project.exec {
300- commandLine = listOf (" git" , " rev-parse" , " --abbrev-ref" , " HEAD" )
301- standardOutput = stream
302- }
303- if (stream.size() > 0 ) branch = stream.toString(Charset .defaultCharset().name()).trim()
304- return branch
305- }
306-
307295fun readChangeLog (): String {
308296 val text: String = System .getenv(" CHANGELOG" ) ? : file(" CHANGELOG.md" ).run {
309297 if (exists()) readText() else " No Changelog found."
0 commit comments