summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-03-09 15:37:56 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-03-09 15:37:56 +0100
commit79c955bcbea82ab700079f5676a144c1c6dcadbf (patch)
treec165f34ae0e7adea6fcdbebd2d3a8ecdb4e8cb92
parent9b0d7d6dd7d2ccb85be0560d92a99c191fa9818a (diff)
downloadSkyHanniChangelogBuilder-79c955bcbea82ab700079f5676a144c1c6dcadbf.tar.gz
SkyHanniChangelogBuilder-79c955bcbea82ab700079f5676a144c1c6dcadbf.tar.bz2
SkyHanniChangelogBuilder-79c955bcbea82ab700079f5676a144c1c6dcadbf.zip
added two last lines of discord public
-rw-r--r--src/main/kotlin/Main.kt35
1 files changed, 28 insertions, 7 deletions
diff --git a/src/main/kotlin/Main.kt b/src/main/kotlin/Main.kt
index 19719c4..3f62afc 100644
--- a/src/main/kotlin/Main.kt
+++ b/src/main/kotlin/Main.kt
@@ -39,7 +39,8 @@ enum class WhatToDo {
fun main() {
val firstPr = 1122
val hideWhenError = true
- val title = "Version 0.24 Beta 8"
+ val fullVersion = "0.24"
+ val beta = 8
val whatToDo = WhatToDo.NEXT_BETA
@@ -55,10 +56,17 @@ fun main() {
val gson = GsonBuilder().create()
val fromJson = gson.fromJson(data, JsonArray::class.java)
val prs = fromJson.map { gson.fromJson(it, PullRequest::class.java) }
- readPrs(prs, firstPr, hideWhenError, title, whatToDo)
+ readPrs(prs, firstPr, hideWhenError, whatToDo, fullVersion, beta)
}
-fun readPrs(prs: List<PullRequest>, firstPr: Int, hideWhenError: Boolean, title: String, whatToDo: WhatToDo) {
+fun readPrs(
+ prs: List<PullRequest>,
+ firstPr: Int,
+ hideWhenError: Boolean,
+ whatToDo: WhatToDo,
+ fullVersion: String,
+ beta: Int,
+) {
val categories = mutableListOf<Category>()
val allChanges = mutableListOf<Change>()
var errors = 0
@@ -107,7 +115,7 @@ fun readPrs(prs: List<PullRequest>, firstPr: Int, hideWhenError: Boolean, title:
println("")
for (type in OutputType.entries) {
- print(categories, allChanges, type, title)
+ print(categories, allChanges, type, fullVersion, beta)
}
println("")
if (excluded > 0) {
@@ -132,14 +140,15 @@ private fun print(
categories: MutableList<Category>,
allChanges: MutableList<Change>,
outputType: OutputType,
- title: String,
+ fullVersion: String,
+ beta: Int,
) {
val extraInfoPrefix = when (outputType) {
OutputType.DISCORD_PUBLIC -> " = "
OutputType.GITHUB -> " * "
OutputType.DISCORD_INTERNAL -> " - "
}
- val list = createPrint(categories, outputType, allChanges, extraInfoPrefix)
+ val list = createPrint(categories, outputType, allChanges, extraInfoPrefix, fullVersion, beta)
val border = "================================================================================="
println("")
println("outputType ${outputType.name.lowercase()}:")
@@ -148,7 +157,6 @@ private fun print(
println("$totalLength/2000 characters used")
}
println(border)
- println("## $title")
for (line in list) {
println(line)
}
@@ -160,8 +168,12 @@ private fun createPrint(
outputType: OutputType,
allChanges: MutableList<Change>,
extraInfoPrefix: String,
+ fullVersion: String,
+ beta: Int,
): MutableList<String> {
val list = mutableListOf<String>()
+ list.add("## Version $fullVersion Beta $beta")
+
for (category in allowedCategories.map { getCategory(categories, it) }) {
if (outputType == OutputType.DISCORD_PUBLIC && category.name == "Technical Details") continue
val changes = allChanges.filter { it.category == category }
@@ -186,6 +198,15 @@ private fun createPrint(
list.add("```")
}
}
+ if (outputType == OutputType.DISCORD_PUBLIC) {
+ val root = "https://github.com/hannibal002/SkyHanni"
+ val releaseLink = "$root/releases/tag/$fullVersion.Beta.$beta>"
+ list.add("For a full changelog, including technical details, see the [GitHub release](<$releaseLink)")
+
+ val downloadLink = "$root/releases/download/$fullVersion.Beta.$beta/SkyHanni-$fullVersion.Beta.$beta.jar"
+ list.add("Download link: $downloadLink")
+ }
+
return list
}