@@ -6,101 +6,48 @@ fun properties(key: String) = project.findProperty(key).toString()
66plugins {
77 id(" java" )
88 id(" org.jetbrains.kotlin.jvm" ) version " 1.9.21"
9- id(" org.jetbrains.intellij" ) version " 1.17 .0"
9+ id(" org.jetbrains.intellij.platform " ) version " 2.2 .0"
1010 id(" org.jetbrains.changelog" ) version " 2.2.0"
1111 id(" org.jetbrains.qodana" ) version " 0.1.13"
12- id(" com.jetbrains.rdgen" ) version " 2023 .3.2 "
12+ id(" com.jetbrains.rdgen" ) version " 2024 .3.1 "
1313}
1414
15- group = properties(" pluginGroup" )
16- version = properties(" pluginVersion" )
17-
18- // Configure project's dependencies
1915repositories {
2016 mavenCentral()
21- }
22-
23- // Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
24- intellij {
25- pluginName.set(properties(" pluginName" ))
26- version.set(properties(" platformVersion" ))
27- type.set(properties(" platformType" ))
28-
29- // Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
30- plugins.set(properties(" platformPlugins" ).split(' ,' ).map(String ::trim).filter(String ::isNotEmpty))
31- }
32-
33- // Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
34- changelog {
35- version.set(properties(" pluginVersion" ))
36- groups.set(emptyList())
37- }
38-
39- // Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin
40- qodana {
41- cachePath.set(projectDir.resolve(" .qodana" ).canonicalPath)
42- reportPath.set(projectDir.resolve(" build/reports/inspections" ).canonicalPath)
43- saveReport.set(true )
44- showReport.set(System .getenv(" QODANA_SHOW_REPORT" )?.toBoolean() ? : false )
45- }
46-
47- tasks {
48- runIde {
49- maxHeapSize = " 1500m"
50- // maybe autoReloadPlugins = false
51- }
52-
53- wrapper {
54- gradleVersion = properties(" gradleVersion" )
55- }
56-
57- patchPluginXml {
58- version.set(properties(" pluginVersion" ))
59- sinceBuild.set(properties(" pluginSinceBuild" ))
60- untilBuild.set(" " )
61-
62- // Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
63- pluginDescription.set(
64- projectDir.resolve(" README.md" ).readText().lines().run {
65- val start = " <!-- Plugin description -->"
66- val end = " <!-- Plugin description end -->"
67-
68- if (! containsAll(listOf (start, end))) {
69- throw GradleException (" Plugin description section not found in README.md:\n $start ... $end " )
70- }
71- subList(indexOf(start) + 1 , indexOf(end))
72- }.joinToString(" \n " ).run { markdownToHTML(this ) }
73- )
74-
75- // Get the latest available change notes from the changelog file
76- changeNotes.set(provider {
77- changelog.run {
78- getOrNull(properties(" pluginVersion" )) ? : getLatest()
79- }.toHTML()
80- })
17+ intellijPlatform {
18+ defaultRepositories()
8119 }
20+ }
8221
83- // Configure UI tests plugin
84- // Read more: https://github.com/JetBrains/intellij-ui-test-robot
85- runIdeForUiTests {
86- systemProperty(" robot-server.port" , " 8082" )
87- systemProperty(" ide.mac.message.dialogs.as.sheets" , " false" )
88- systemProperty(" jb.privacy.policy.text" , " <!--999.999-->" )
89- systemProperty(" jb.consents.confirmation.enabled" , " false" )
22+ intellijPlatform {
23+ tasks {
24+ buildPlugin {
25+ archiveVersion = properties(" pluginVersion" )
26+ }
9027 }
91-
92- signPlugin {
93- certificateChain.set(System .getenv(" CERTIFICATE_CHAIN" ))
94- privateKey.set(System .getenv(" PRIVATE_KEY" ))
95- password.set(System .getenv(" PRIVATE_KEY_PASSWORD" ))
28+ pluginConfiguration {
29+ name = " csharpier"
30+ group = " com.intellij.csharpier"
31+ ideaVersion.sinceBuild.set(properties(" pluginSinceBuild" ))
32+ description = getProjectDescription()
33+ version = properties(" pluginVersion" )
9634 }
35+ }
9736
98- publishPlugin {
99- dependsOn(" patchChangelog" )
100- token.set(System .getenv(" PUBLISH_TOKEN" ))
101- // pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
102- // Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
103- // https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
104- channels.set(listOf (properties(" pluginVersion" ).split(' -' ).getOrElse(1 ) { " default" }.split(' .' ).first()))
37+ dependencies {
38+ intellijPlatform {
39+ create(" RD" , properties(" platformVersion" ))
10540 }
10641}
42+
43+ fun getProjectDescription (): String {
44+ return projectDir.resolve(" README.md" ).readText().lines().run {
45+ val start = " <!-- Plugin description -->"
46+ val end = " <!-- Plugin description end -->"
47+
48+ if (! containsAll(listOf (start, end))) {
49+ throw GradleException (" Plugin description section not found in README.md:\n $start ... $end " )
50+ }
51+ subList(indexOf(start) + 1 , indexOf(end))
52+ }.joinToString(" \n " ).run { markdownToHTML(this ) }
53+ }
0 commit comments