Skip to content

Commit 78aa049

Browse files
committed
Fix gradle generateChangelog
1 parent a54e013 commit 78aa049

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

build.gradle.kts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,9 @@ fun mapVersions(propertyName: String): Provider<List<String>> = provider {
126126
}
127127

128128
fun generateChangelog(): Provider<String> = provider {
129-
val tags = ByteArrayOutputStream().apply {
130-
providers.exec {
131-
commandLine("git", "tag", "--sort", "version:refname")
132-
standardOutput = this@apply
133-
}
134-
}.toString(Charsets.UTF_8.name()).trim().split("\n")
129+
val tags = providers.exec {
130+
commandLine("git", "tag", "--sort", "version:refname")
131+
}.standardOutput.asText.get().trim().split("\n")
135132

136133
val tagsRange = if (tags.size > 1) {
137134
"${tags[tags.size - 2]}...${tags[tags.size - 1]}"
@@ -141,10 +138,9 @@ fun generateChangelog(): Provider<String> = provider {
141138
val changelog = ByteArrayOutputStream().apply {
142139
write("### Commits:\n".toByteArray())
143140

144-
providers.exec {
141+
write(providers.exec {
145142
commandLine("git", "log", tagsRange, "--pretty=format:- [%h]($repoUrl/commit/%H) %s", "--reverse")
146-
standardOutput = this@apply
147-
}
143+
}.standardOutput.asBytes.get())
148144

149145
write("\n\nCompare Changes: [$tagsRange]($repoUrl/compare/$tagsRange)".toByteArray())
150146
}.toString(Charsets.UTF_8.name())

0 commit comments

Comments
 (0)