@@ -12,6 +12,7 @@ plugins {
1212 kotlin(" plugin.serialization" ) version libs.versions.kotlin.get()
1313 id(" org.jetbrains.compose" )
1414 alias(libs.plugins.spotless)
15+ alias(libs.plugins.compose)
1516}
1617
1718group = properties(" pluginGroup" ).get()
@@ -28,7 +29,12 @@ buildscript {
2829// Configure project's dependencies
2930repositories {
3031 mavenCentral()
32+ google()
33+ maven(" https://maven.pkg.jetbrains.space/public/p/compose/dev" )
3134 maven { url = uri(" https://maven.pkg.jetbrains.space/public/p/compose/dev" ) }
35+ intellijPlatform {
36+ defaultRepositories()
37+ }
3238}
3339
3440apply (
@@ -42,31 +48,35 @@ dependencies {
4248 implementation(compose.materialIconsExtended)
4349 implementation(libs.segment)
4450
45- val version = " 0.7.81 "
51+ val version = " 0.8.10 "
4652 val macTarget = " macos-arm64"
4753 val windowsTarget = " windows-x64"
4854 val linuxTarget = " linux-x64"
4955
5056 implementation(" org.jetbrains.skiko:skiko-awt-runtime-$macTarget :$version " )
5157 implementation(" org.jetbrains.skiko:skiko-awt-runtime-$windowsTarget :$version " )
5258 implementation(" org.jetbrains.skiko:skiko-awt-runtime-$linuxTarget :$version " )
53- }
5459
55- // Set the JVM language level used to build the project. Use Java 11 for 2020.3+, and Java 17 for 2022.2+.
56- kotlin {
57- jvmToolchain {
58- languageVersion.set(JavaLanguageVersion .of(libs.versions.jdk.get()))
60+ testImplementation(libs.junit)
61+
62+ // IntelliJ Platform Gradle Plugin Dependencies Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html
63+ intellijPlatform {
64+ create(properties(" platformType" ).get(), properties(" platformVersion" ).get())
65+
66+ // Plugin Dependencies. Uses `platformBundledPlugins` property from the gradle.properties file for bundled IntelliJ Platform plugins.
67+ bundledPlugins(properties(" platformBundledPlugins" ).map { it.split(' ,' ) })
68+
69+ // Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file for plugin from JetBrains Marketplace.
70+ plugins(properties(" platformPlugins" ).map { it.split(' ,' ) })
71+
72+ instrumentationTools()
73+ pluginVerifier()
74+ zipSigner()
5975 }
6076}
6177
62- // Configure Gradle IntelliJ Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
63- intellij {
64- pluginName = properties(" pluginName" )
65- version = properties(" platformVersion" )
66- type = properties(" platformType" )
67-
68- // Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
69- plugins = properties(" platformPlugins" ).map { it.split(' ,' ).map(String ::trim).filter(String ::isNotEmpty) }
78+ kotlin {
79+ jvmToolchain(libs.versions.jdk.get().toInt())
7080}
7181
7282// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
@@ -81,9 +91,9 @@ tasks {
8191 }
8292
8393 patchPluginXml {
84- version = properties(" pluginVersion" )
85- sinceBuild = properties(" pluginSinceBuild" )
86- untilBuild = properties(" pluginUntilBuild" )
94+ version = properties(" pluginVersion" ).get()
95+ sinceBuild = properties(" pluginSinceBuild" ).get()
96+ // untilBuild = properties("pluginUntilBuild").get( )
8797
8898 // Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
8999 pluginDescription = providers.fileContents(layout.projectDirectory.file(" README.md" )).asText.map {
@@ -112,27 +122,89 @@ tasks {
112122 }
113123 }
114124
115- // Configure UI tests plugin
116- // Read more: https://github.com/JetBrains/intellij-ui-test-robot
117- runIdeForUiTests {
118- systemProperty(" robot-server.port" , " 8082" )
119- systemProperty(" ide.mac.message.dialogs.as.sheets" , " false" )
120- systemProperty(" jb.privacy.policy.text" , " <!--999.999-->" )
121- systemProperty(" jb.consents.confirmation.enabled" , " false" )
122- }
123-
124125 signPlugin {
125126 certificateChain = environment(" CERTIFICATE_CHAIN" )
126127 privateKey = environment(" PRIVATE_KEY" )
127128 password = environment(" PRIVATE_KEY_PASSWORD" )
128129 }
130+ }
131+
132+ intellijPlatformTesting {
133+ runIde {
134+ register(" runIdeForUiTests" ) {
135+ task {
136+ jvmArgumentProviders + = CommandLineArgumentProvider {
137+ listOf (
138+ " -Drobot-server.port=8082" ,
139+ " -Dide.mac.message.dialogs.as.sheets=false" ,
140+ " -Djb.privacy.policy.text=<!--999.999-->" ,
141+ " -Djb.consents.confirmation.enabled=false"
142+ )
143+ }
144+ }
145+
146+ plugins {
147+ robotServerPlugin()
148+ }
149+ }
150+ }
151+ }
152+
153+ // Configure IntelliJ Platform Gradle Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-extension.html
154+ intellijPlatform {
155+ pluginConfiguration {
156+ version = properties(" pluginVersion" ).get()
157+
158+ // Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
159+ description = providers.fileContents(layout.projectDirectory.file(" README.md" )).asText.map {
160+ val start = " <!-- Plugin description -->"
161+ val end = " <!-- Plugin description end -->"
162+
163+ with (it.lines()) {
164+ if (! containsAll(listOf (start, end))) {
165+ throw GradleException (" Plugin description section not found in README.md:\n $start ... $end " )
166+ }
167+ subList(indexOf(start) + 1 , indexOf(end)).joinToString(" \n " ).let (::markdownToHTML)
168+ }
169+ }
170+
171+ val changelog = project.changelog // local variable for configuration cache compatibility
172+ // Get the latest available change notes from the changelog file
173+ changeNotes = properties(" pluginVersion" ).map { pluginVersion ->
174+ with (changelog) {
175+ renderItem(
176+ (getOrNull(pluginVersion) ? : getUnreleased())
177+ .withHeader(false )
178+ .withEmptySections(false ),
179+ Changelog .OutputType .HTML
180+ )
181+ }
182+ }
183+
184+ ideaVersion {
185+ sinceBuild = properties(" pluginSinceBuild" ).get()
186+ untilBuild = properties(" pluginUntilBuild" ).get()
187+ }
188+ }
189+
190+ signing {
191+ certificateChain = providers.environmentVariable(" CERTIFICATE_CHAIN" )
192+ privateKey = providers.environmentVariable(" PRIVATE_KEY" )
193+ password = providers.environmentVariable(" PRIVATE_KEY_PASSWORD" )
194+ }
129195
130- publishPlugin {
131- dependsOn(" patchChangelog" )
132- token = environment(" PUBLISH_TOKEN" )
196+ publishing {
197+ token = providers.environmentVariable(" PUBLISH_TOKEN" )
133198 // The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
134199 // Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
135200 // https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
136- // channels = properties("pluginVersion").map { listOf(it.split('-').getOrElse(1) { "default" }.split('.').first()) }
201+ channels = properties(" pluginVersion" )
202+ .map { listOf (it.substringAfter(' -' , " " ).substringBefore(' .' ).ifEmpty { " default" }) }
203+ }
204+
205+ pluginVerification {
206+ ides {
207+ recommended()
208+ }
137209 }
138210}
0 commit comments