@@ -38,6 +38,8 @@ ext.fabricModrinthDownloadLink = null
3838ext. forgeModrinthDownloadLink = null
3939ext. githubDownloadLink = null
4040
41+ ext. releaseType = " patch"
42+
4143architectury {
4244 minecraft = rootProject. minecraft_version
4345}
@@ -77,9 +79,11 @@ def getLastVersion() {
7779 }
7880
7981 if (versions. get(1 ) != 0 ) {
82+ releaseType = " minor"
8083 return versions. get(0 ) + " ." + (versions. get(1 ) - 1 ) + " ." + versions. get(2 )
8184 }
8285
86+ releaseType = " major"
8387 return (versions. get(0 ) - 1 ) + " ." + versions. get(1 ) + " ." + versions. get(2 )
8488}
8589
@@ -88,10 +92,18 @@ task generateChangelog {
8892
8993 def lastTag = getLastVersion()
9094 def currentTag = project. mod_version
91- def commits = " git log --max-count=100 --pretty=format:\" %B\" $lastTag .. $currentTag " . execute()
95+ def commits = " git log --max-count=100 --pretty=format:\" - %B\" $lastTag .. $currentTag " . execute()
9296 println " Last version: $lastTag "
9397 println " Current version: $currentTag "
9498
99+ if (releaseType == " minor" ) {
100+ changes << " Minor Release of Netherite Plus:\n "
101+ changes << " Changes Since ${ lastTag} "
102+ } else if (releaseType == " major" ) {
103+ changes << " Major Release of Netherite Plus:\n "
104+ changes << " Changes Since ${ lastTag} "
105+ }
106+
95107 commits. in . eachLine { line -> // Loops over the lines the git log command returns
96108 def processedLine = line. toString()
97109 if (processedLine. startsWith(" \" " )) {
@@ -100,6 +112,9 @@ task generateChangelog {
100112 if (processedLine. endsWith(" \" " )) {
101113 processedLine = processedLine. substring(0 , processedLine. length() - 1 )
102114 }
115+ if (processedLine. startsWith(" - -" ))
116+ processedLine = processedLine. substring(2 ). trim()
117+
103118 println " Reading line: $processedLine "
104119
105120 println " Adding changelog line:"
0 commit comments