@@ -5,18 +5,12 @@ fun properties(key: String) = providers.gradleProperty(key)
55fun environment (key : String ) = providers.environmentVariable(key)
66
77plugins {
8- // Java support
9- id(" java" )
10- // Kotlin support
11- id(" org.jetbrains.kotlin.jvm" ) version " 1.8.10"
12- // Gradle IntelliJ Plugin
13- id(" org.jetbrains.intellij" ) version " 1.13.2"
14- // Gradle Changelog Plugin
15- id(" org.jetbrains.changelog" ) version " 2.0.0"
16- // Gradle Qodana Plugin
17- id(" org.jetbrains.qodana" ) version " 0.1.13"
18- // Gradle Kover Plugin
19- id(" org.jetbrains.kotlinx.kover" ) version " 0.6.1"
8+ id(" java" ) // Java support
9+ alias(libs.plugins.kotlin) // Kotlin support
10+ alias(libs.plugins.gradleIntelliJPlugin) // Gradle IntelliJ Plugin
11+ alias(libs.plugins.changelog) // Gradle Changelog Plugin
12+ alias(libs.plugins.qodana) // Gradle Qodana Plugin
13+ alias(libs.plugins.kover) // Gradle Kover Plugin
2014}
2115
2216group = properties(" pluginGroup" ).get()
@@ -27,38 +21,47 @@ repositories {
2721 mavenCentral()
2822}
2923
24+ // Dependencies are managed with Gradle version catalog - read more: https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog
25+ dependencies {
26+ // implementation(libs.annotations)
27+ }
28+
3029// Set the JVM language level used to build the project. Use Java 11 for 2020.3+, and Java 17 for 2022.2+.
3130kotlin {
32- jvmToolchain(11 )
31+ jvmToolchain(17 )
3332}
3433
3534// Configure Gradle IntelliJ Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
3635intellij {
37- pluginName.set( properties(" pluginName" ) )
38- version.set( properties(" platformVersion" ) )
39- type.set( properties(" platformType" ) )
36+ pluginName = properties(" pluginName" )
37+ version = properties(" platformVersion" )
38+ type = properties(" platformType" )
4039
4140 // Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
42- plugins.set( properties(" platformPlugins" ).map { it.split(' ,' ).map(String ::trim).filter(String ::isNotEmpty) })
41+ plugins = properties(" platformPlugins" ).map { it.split(' ,' ).map(String ::trim).filter(String ::isNotEmpty) }
4342}
4443
4544// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
4645changelog {
4746 groups.empty()
48- repositoryUrl.set( properties(" pluginRepositoryUrl" ) )
47+ repositoryUrl = properties(" pluginRepositoryUrl" )
4948}
5049
5150// Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin
5251qodana {
53- cachePath.set( provider { file(" .qodana" ).canonicalPath })
54- reportPath.set( provider { file(" build/reports/inspections" ).canonicalPath })
55- saveReport.set( true )
56- showReport.set( environment(" QODANA_SHOW_REPORT" ).map { it.toBoolean() }.getOrElse(false ) )
52+ cachePath = provider { file(" .qodana" ).canonicalPath }
53+ reportPath = provider { file(" build/reports/inspections" ).canonicalPath }
54+ saveReport = true
55+ showReport = environment(" QODANA_SHOW_REPORT" ).map { it.toBoolean() }.getOrElse(false )
5756}
5857
5958// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration
60- kover.xmlReport {
61- onCheck.set(true )
59+ koverReport {
60+ defaults {
61+ xml {
62+ onCheck = true
63+ }
64+ }
6265}
6366
6467tasks {
@@ -67,12 +70,12 @@ tasks {
6770 }
6871
6972 patchPluginXml {
70- version.set( properties(" pluginVersion" ) )
71- sinceBuild.set( properties(" pluginSinceBuild" ) )
72- untilBuild.set( properties(" pluginUntilBuild" ) )
73+ version = properties(" pluginVersion" )
74+ sinceBuild = properties(" pluginSinceBuild" )
75+ untilBuild = properties(" pluginUntilBuild" )
7376
7477 // Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
75- pluginDescription.set( providers.fileContents(layout.projectDirectory.file(" README.md" )).asText.map {
78+ pluginDescription = providers.fileContents(layout.projectDirectory.file(" README.md" )).asText.map {
7679 val start = " <!-- Plugin description -->"
7780 val end = " <!-- Plugin description end -->"
7881
@@ -82,11 +85,11 @@ tasks {
8285 }
8386 subList(indexOf(start) + 1 , indexOf(end)).joinToString(" \n " ).let (::markdownToHTML)
8487 }
85- })
88+ }
8689
8790 val changelog = project.changelog // local variable for configuration cache compatibility
8891 // Get the latest available change notes from the changelog file
89- changeNotes.set( properties(" pluginVersion" ).map { pluginVersion ->
92+ changeNotes = properties(" pluginVersion" ).map { pluginVersion ->
9093 with (changelog) {
9194 renderItem(
9295 (getOrNull(pluginVersion) ? : getUnreleased())
@@ -95,7 +98,7 @@ tasks {
9598 Changelog .OutputType .HTML ,
9699 )
97100 }
98- })
101+ }
99102 }
100103
101104 // Configure UI tests plugin
@@ -108,17 +111,17 @@ tasks {
108111 }
109112
110113 signPlugin {
111- certificateChain.set( environment(" CERTIFICATE_CHAIN" ) )
112- privateKey.set( environment(" PRIVATE_KEY" ) )
113- password.set( environment(" PRIVATE_KEY_PASSWORD" ) )
114+ certificateChain = environment(" CERTIFICATE_CHAIN" )
115+ privateKey = environment(" PRIVATE_KEY" )
116+ password = environment(" PRIVATE_KEY_PASSWORD" )
114117 }
115118
116119 publishPlugin {
117120 dependsOn(" patchChangelog" )
118- token.set( environment(" PUBLISH_TOKEN" ) )
121+ token = environment(" PUBLISH_TOKEN" )
119122 // The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
120123 // Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
121124 // https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
122- channels.set( properties(" pluginVersion" ).map { listOf (it.split(' -' ).getOrElse(1 ) { " default" }.split(' .' ).first()) })
125+ channels = properties(" pluginVersion" ).map { listOf (it.split(' -' ).getOrElse(1 ) { " default" }.split(' .' ).first()) }
123126 }
124127}
0 commit comments