@@ -5,18 +5,12 @@ fun properties(key: String) = providers.gradleProperty(key)
5
5
fun environment (key : String ) = providers.environmentVariable(key)
6
6
7
7
plugins {
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
20
14
}
21
15
22
16
group = properties(" pluginGroup" ).get()
@@ -27,38 +21,47 @@ repositories {
27
21
mavenCentral()
28
22
}
29
23
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
+
30
29
// Set the JVM language level used to build the project. Use Java 11 for 2020.3+, and Java 17 for 2022.2+.
31
30
kotlin {
32
- jvmToolchain(11 )
31
+ jvmToolchain(17 )
33
32
}
34
33
35
34
// Configure Gradle IntelliJ Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
36
35
intellij {
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" )
40
39
41
40
// 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) }
43
42
}
44
43
45
44
// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
46
45
changelog {
47
46
groups.empty()
48
- repositoryUrl.set( properties(" pluginRepositoryUrl" ) )
47
+ repositoryUrl = properties(" pluginRepositoryUrl" )
49
48
}
50
49
51
50
// Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin
52
51
qodana {
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 )
57
56
}
58
57
59
58
// 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
+ }
62
65
}
63
66
64
67
tasks {
@@ -67,12 +70,12 @@ tasks {
67
70
}
68
71
69
72
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" )
73
76
74
77
// 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 {
76
79
val start = " <!-- Plugin description -->"
77
80
val end = " <!-- Plugin description end -->"
78
81
@@ -82,11 +85,11 @@ tasks {
82
85
}
83
86
subList(indexOf(start) + 1 , indexOf(end)).joinToString(" \n " ).let (::markdownToHTML)
84
87
}
85
- })
88
+ }
86
89
87
90
val changelog = project.changelog // local variable for configuration cache compatibility
88
91
// Get the latest available change notes from the changelog file
89
- changeNotes.set( properties(" pluginVersion" ).map { pluginVersion ->
92
+ changeNotes = properties(" pluginVersion" ).map { pluginVersion ->
90
93
with (changelog) {
91
94
renderItem(
92
95
(getOrNull(pluginVersion) ? : getUnreleased())
@@ -95,7 +98,7 @@ tasks {
95
98
Changelog .OutputType .HTML ,
96
99
)
97
100
}
98
- })
101
+ }
99
102
}
100
103
101
104
// Configure UI tests plugin
@@ -108,17 +111,17 @@ tasks {
108
111
}
109
112
110
113
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" )
114
117
}
115
118
116
119
publishPlugin {
117
120
dependsOn(" patchChangelog" )
118
- token.set( environment(" PUBLISH_TOKEN" ) )
121
+ token = environment(" PUBLISH_TOKEN" )
119
122
// The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
120
123
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
121
124
// 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()) }
123
126
}
124
127
}
0 commit comments