11import io.gitlab.arturbosch.detekt.Detekt
2- import org.jetbrains.changelog.closure
32import org.jetbrains.changelog.date
43import org.jetbrains.changelog.markdownToHTML
54import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
@@ -10,13 +9,13 @@ plugins {
109 // Java support
1110 id(" java" )
1211 // Kotlin support
13- id(" org.jetbrains.kotlin.jvm" ) version " 1.5.0 "
12+ id(" org.jetbrains.kotlin.jvm" ) version " 1.5.10 "
1413 // gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
15- id(" org.jetbrains.intellij" ) version " 0.7.3 "
14+ id(" org.jetbrains.intellij" ) version " 1.0 "
1615 // gradle-changelog-plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
1716 id(" org.jetbrains.changelog" ) version " 1.1.2"
1817 // detekt linter - read more: https://detekt.github.io/detekt/gradle.html
19- id(" io.gitlab.arturbosch.detekt" ) version " 1.16.0 "
18+ id(" io.gitlab.arturbosch.detekt" ) version " 1.17.1 "
2019 // ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle
2120 id(" org.jlleitschuh.gradle.ktlint" ) version " 10.0.0"
2221}
@@ -27,33 +26,32 @@ version = properties("pluginVersion")
2726// Configure project's dependencies
2827repositories {
2928 mavenCentral()
30- jcenter()
3129}
3230dependencies {
33- detektPlugins(" io.gitlab.arturbosch.detekt:detekt-formatting:1.16.0 " )
31+ detektPlugins(" io.gitlab.arturbosch.detekt:detekt-formatting:1.17.1 " )
3432}
3533
3634// Configure gradle-intellij-plugin plugin.
3735// Read more: https://github.com/JetBrains/gradle-intellij-plugin
3836intellij {
39- pluginName = properties(" pluginName" )
40- version = properties(" platformVersion" )
41- type = properties(" platformType" )
42- downloadSources = properties(" platformDownloadSources" ).toBoolean()
43- updateSinceUntilBuild = true
37+ pluginName.set( properties(" pluginName" ) )
38+ version.set( properties(" platformVersion" ) )
39+ type.set( properties(" platformType" ) )
40+ downloadSources.set( properties(" platformDownloadSources" ).toBoolean() )
41+ updateSinceUntilBuild.set( true )
4442
4543 // Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
46- setPlugins( * properties(" platformPlugins" ).split(' ,' ).map(String ::trim).filter(String ::isNotEmpty).toTypedArray( ))
44+ plugins.set( properties(" platformPlugins" ).split(' ,' ).map(String ::trim).filter(String ::isNotEmpty))
4745}
4846
4947// Configure gradle-changelog-plugin plugin.
5048// Read more: https://github.com/JetBrains/gradle-changelog-plugin
5149changelog {
5250 version = properties(" pluginVersion" )
5351 keepUnreleasedSection = true
52+ itemPrefix = " -"
5453 unreleasedTerm = " [Latest release]"
5554 groups = emptyList()
56- closure { " [$version ] - ${date()} " }
5755}
5856
5957// Configure detekt plugin.
@@ -84,42 +82,36 @@ tasks {
8482 }
8583
8684 patchPluginXml {
87- version(properties(" pluginVersion" ))
88- sinceBuild(properties(" pluginSinceBuild" ))
89- untilBuild(properties(" pluginUntilBuild" ))
85+ version.set (properties(" pluginVersion" ))
86+ sinceBuild.set (properties(" pluginSinceBuild" ))
87+ untilBuild.set (properties(" pluginUntilBuild" ))
9088
9189 // Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
92- pluginDescription(
93- closure {
94- File (" ./DESCRIPTION.md" )
95- .readText().lines()
96- .joinToString(" \n " )
97- .run { markdownToHTML(this ) }
98- }
90+
91+ pluginDescription.set(
92+ File (" ./DESCRIPTION.md" )
93+ .readText().lines()
94+ .joinToString(" \n " )
95+ .run { markdownToHTML(this ) }
9996 )
10097
10198 // Get the latest available change notes from the changelog file
102-
103- changeNotes(
104- closure {
105- File (" ./CHANGELOG.md" )
106- .readText().lines()
107- .joinToString(" \n " )
108- .run { markdownToHTML(this ) }
109- }
110- )
99+ changeNotes.set(provider { File (" ./CHANGELOG.md" )
100+ .readText().lines()
101+ .joinToString(" \n " )
102+ .run { markdownToHTML(this ) } })
111103 }
112104
113105 runPluginVerifier {
114- ideVersions(properties(" pluginVerifierIdeVersions" ))
106+ ideVersions.set (properties(" pluginVerifierIdeVersions" ).split( ' , ' ).map( String ::trim).filter( String ::isNotEmpty ))
115107 }
116108
117109 publishPlugin {
118110 dependsOn(" patchChangelog" )
119- token(System .getenv(" PUBLISH_TOKEN" ))
111+ token.set (System .getenv(" PUBLISH_TOKEN" ))
120112 // pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
121113 // Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
122114 // https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
123- channels( properties(" pluginVersion" ).split(' -' ).getOrElse(1 ) { " default" }.split(' .' ).first())
115+ channels.set( listOf ( properties(" pluginVersion" ).split(' -' ).getOrElse(1 ) { " default" }.split(' .' ).first() ))
124116 }
125117}
0 commit comments