Skip to content

Commit 53a6739

Browse files
committed
Version 1.4.0
1 parent 37e2218 commit 53a6739

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

build.gradle

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ ext.fabricModrinthDownloadLink = null
3838
ext.forgeModrinthDownloadLink = null
3939
ext.githubDownloadLink = null
4040

41+
ext.releaseType = "patch"
42+
4143
architectury {
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:"

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ org.gradle.jvmargs=-Xmx2G
55
minecraft_version=1.16.5
66
fabric_loader_version=0.11.1
77
# Mod Properties
8-
mod_version=1.3.17
8+
mod_version=1.4.0
99
maven_group=com.oroarmor
1010
archives_base_name=netherite-plus-mod
1111
project_name=Netherite Plus Mod

0 commit comments

Comments
 (0)