Skip to content

Commit

Permalink
improved release build script code
Browse files Browse the repository at this point in the history
  • Loading branch information
IARI committed Jun 13, 2020
1 parent dc37872 commit 2e6d1d7
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import com.github.breadmoirai.githubreleaseplugin.ChangeLogSupplier
import org.jetbrains.kotlin.utils.identity

val kotlinVersion = "1.3.72"
val appMainClassName = "com.julianjarecki.ettiketten.app.EttikettenApp"
Expand Down Expand Up @@ -130,17 +129,20 @@ tasks {

body {
val cl = changelog().call().split("""commit [0-9a-f]{7}\s*Author:\V*\s*Date:\V*\s*""".toRegex())
val clstring = cl.flatMap {
it.trim()
val clstring = cl.flatMap { commit ->
commit.trim()
.lines()
.map {
//val match = """(\s+\-)\s*(\S.*)""".toRegex().matchEntire(it)
if (it.startsWith(" ")) {
it.replace("""(\s+[\-\+*])(\S)""".toRegex()) {
it.groups[1]!!.value + " " + it.groups[2]!!.value
when {
it.startsWith(" ") -> {
it.replace("""(\s+[\-\+*])(\S)""".toRegex()) {
it.groups[1]!!.value + " " + it.groups[2]!!.value
}
}
} else if (it.any { !it.isWhitespace() }) "- $it"
else it
it.any { !it.isWhitespace() } -> "- $it"
else -> it
}
}
}.joinToString("\n")
"""
Expand Down

0 comments on commit 2e6d1d7

Please sign in to comment.