@@ -6,10 +6,10 @@ fun properties(key: String) = project.findProperty(key).toString()
66
77plugins {
88 id(" java" )
9- id(" org.jetbrains.kotlin.jvm" ) version " 1.5.31 "
10- id(" org.jetbrains.intellij" ) version " 0.7.3 "
11- id(" org.jetbrains.changelog" ) version " 1.1.2 "
12- id(" io.gitlab.arturbosch.detekt" ) version " 1.16 .0"
9+ id(" org.jetbrains.kotlin.jvm" ) version " 1.7.10 "
10+ id(" org.jetbrains.intellij" ) version " 1.8.0 "
11+ id(" org.jetbrains.changelog" ) version " 1.3.1 "
12+ id(" io.gitlab.arturbosch.detekt" ) version " 1.21 .0"
1313 id(" org.jlleitschuh.gradle.ktlint" ) version " 10.2.0"
1414}
1515
@@ -25,18 +25,18 @@ dependencies {
2525}
2626
2727intellij {
28- pluginName = properties(" pluginName" )
29- version = properties(" platformVersion" )
30- type = properties(" platformType" )
31- downloadSources = properties(" platformDownloadSources" ).toBoolean()
32- updateSinceUntilBuild = true
28+ pluginName.set( properties(" pluginName" ) )
29+ version.set( properties(" platformVersion" ) )
30+ type.set( properties(" platformType" ) )
31+ downloadSources.set( properties(" platformDownloadSources" ).toBoolean() )
32+ updateSinceUntilBuild.set( true )
3333
34- setPlugins( * properties(" platformPlugins" ).split(' ,' ).map(String ::trim).filter(String ::isNotEmpty).toTypedArray( ))
34+ plugins.set( properties(" platformPlugins" ).split(' ,' ).map(String ::trim).filter(String ::isNotEmpty))
3535}
3636
3737changelog {
38- version = properties(" pluginVersion" )
39- groups = emptyList()
38+ version.set( properties(" pluginVersion" ) )
39+ groups.set( emptyList() )
4040}
4141
4242detekt {
@@ -51,24 +51,30 @@ detekt {
5151}
5252
5353tasks {
54- withType<JavaCompile > {
55- sourceCompatibility = " 1.8"
56- targetCompatibility = " 1.8"
57- }
58- withType<KotlinCompile > {
59- kotlinOptions.jvmTarget = " 1.8"
54+ // Set the JVM compatibility versions
55+ properties(" javaVersion" ).let {
56+ withType<JavaCompile > {
57+ sourceCompatibility = it
58+ targetCompatibility = it
59+ }
60+ withType<KotlinCompile > {
61+ kotlinOptions.jvmTarget = it
62+ }
63+ withType<Detekt > {
64+ jvmTarget = it
65+ }
6066 }
6167
62- withType< Detekt > {
63- jvmTarget = " 1.8 "
68+ wrapper {
69+ gradleVersion = properties( " gradleVersion " )
6470 }
6571
6672 patchPluginXml {
67- version(properties(" pluginVersion" ))
68- sinceBuild(properties(" pluginSinceBuild" ))
69- untilBuild(properties(" pluginUntilBuild" ))
73+ version.set (properties(" pluginVersion" ))
74+ sinceBuild.set (properties(" pluginSinceBuild" ))
75+ untilBuild.set (properties(" pluginUntilBuild" ))
7076
71- pluginDescription(
77+ pluginDescription.set (
7278 File (" ./README.md" ).readText().lines().run {
7379 val start = " <!-- Plugin description -->"
7480 val end = " <!-- Plugin description end -->"
@@ -80,16 +86,23 @@ tasks {
8086 }.joinToString(" \n " ).run { markdownToHTML(this ) }
8187 )
8288
83- changeNotes(changelog.getUnreleased().toHTML())
89+ changeNotes.set (changelog.getUnreleased().toHTML())
8490 }
8591
8692 runPluginVerifier {
87- ideVersions(properties(" pluginVerifierIdeVersions" ).split(' ,' ).map(String ::trim).filter(String ::isNotEmpty))
93+ ideVersions.set(
94+ properties(" pluginVerifierIdeVersions" ).split(' ,' ).map(String ::trim)
95+ .filter(String ::isNotEmpty)
96+ )
8897 }
8998
9099 publishPlugin {
91100 dependsOn(" patchChangelog" )
92- token(System .getenv(" PUBLISH_TOKEN" ))
93- channels(properties(" pluginVersion" ).split(' -' ).getOrElse(1 ) { " default" }.split(' .' ).first())
101+ token.set(System .getenv(" PUBLISH_TOKEN" ))
102+ channels.set(
103+ listOf (
104+ properties(" pluginVersion" ).split(' -' ).getOrElse(1 ) { " default" }.split(' .' ).first()
105+ )
106+ )
94107 }
95108}
0 commit comments