Skip to content

Commit

Permalink
Update changelog config to work with org.jetbrains.changelog 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Konafets committed Dec 5, 2022
1 parent 537109c commit f64ab08
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import org.jetbrains.changelog.date
import org.jetbrains.changelog.Changelog
import org.jetbrains.changelog.markdownToHTML

fun properties(key: String) = project.findProperty(key).toString()
Expand Down Expand Up @@ -44,14 +44,8 @@ intellij {

// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
changelog {
version.set(properties("pluginVersion"))
version.set(properties("pluginVersion"))
path.set("${project.projectDir}/CHANGELOG.md")
header.set(provider { "[${version.get()}] - ${date()}" })
itemPrefix.set("-")
keepUnreleasedSection.set(true)
unreleasedTerm.set("[Unreleased]")
groups.set(listOf("Added", "Changed", "Deprecated", "Removed", "Fixed", "Security"))
groups.set(emptyList())
repositoryUrl.set(properties("pluginRepositoryUrl"))
}

// Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin
Expand Down Expand Up @@ -94,9 +88,12 @@ tasks {

// Get the latest available change notes from the changelog file
changeNotes.set(provider {
changelog.run {
getOrNull(properties("pluginVersion")) ?: getLatest()
}.toHTML()
with(changelog) {
renderItem(
getOrNull(properties("pluginVersion")) ?: getLatest(),
Changelog.OutputType.HTML,
)
}
})
}

Expand Down

0 comments on commit f64ab08

Please sign in to comment.