@@ -2,6 +2,9 @@ import org.jetbrains.intellij.platform.gradle.TestFrameworkType
2
2
import org.jetbrains.intellij.platform.gradle.extensions.intellijPlatform
3
3
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
4
4
5
+ import org.jetbrains.changelog.Changelog
6
+ import org.jetbrains.changelog.markdownToHTML
7
+
5
8
plugins {
6
9
java
7
10
alias(libs.plugins.kotlin)
@@ -47,6 +50,29 @@ dependencies {
47
50
intellijPlatform {
48
51
pluginConfiguration {
49
52
version = providers.gradleProperty(" plugin.version" )
53
+
54
+ description = providers.fileContents(layout.projectDirectory.file(" README.md" )).asText.map {
55
+ val start = " <!-- plugin description -->"
56
+ val end = " <!-- plugin description end -->"
57
+
58
+ with (it.lines()) {
59
+ if (! containsAll(listOf (start, end))) {
60
+ throw GradleException (" Plugin description section not found in README.md:\n $start ... $end " )
61
+ }
62
+ subList(indexOf(start) + 1 , indexOf(end)).joinToString(" \n " ).let (::markdownToHTML)
63
+ }
64
+ }
65
+
66
+ val changelog = project.changelog
67
+ changeNotes = providers.gradleProperty(" pluginVersion" ).map { pluginVersion ->
68
+ with (changelog) {
69
+ renderItem(
70
+ (getOrNull(pluginVersion) ? : getUnreleased())
71
+ .withHeader(false )
72
+ .withEmptySections(false ),
73
+ Changelog .OutputType .HTML ,
74
+ )
75
+ }
50
76
}
51
77
52
78
signing {
@@ -71,6 +97,11 @@ intellijPlatform {
71
97
}
72
98
}
73
99
100
+ changelog {
101
+ groups.empty()
102
+ repositoryUrl = providers.gradleProperty(" pluginRepositoryUrl" )
103
+ }
104
+
74
105
intellijPlatformTesting {
75
106
runIde {
76
107
register(" runIdeForUiTests" ) {
@@ -100,4 +131,8 @@ tasks {
100
131
wrapper {
101
132
gradleVersion = providers.gradleProperty(" gradle.version" ).get()
102
133
}
134
+
135
+ publishPlugin {
136
+ dependsOn(" patchChangelog" )
137
+ }
103
138
}
0 commit comments