Skip to content

Commit 16f8f0e

Browse files
committed
v0.2.7 - Dependencies updates, support for 2023.3
1 parent a8d91ab commit 16f8f0e

File tree

5 files changed

+102
-83
lines changed

5 files changed

+102
-83
lines changed

build.gradle.kts

Lines changed: 60 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,99 @@
1-
import io.gitlab.arturbosch.detekt.Detekt
1+
import org.jetbrains.changelog.Changelog
22
import org.jetbrains.changelog.markdownToHTML
3-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
43

5-
/**
6-
* Get properties from gradle.properties
7-
*/
8-
fun properties(key: String) = project.findProperty(key).toString()
4+
fun properties(key: String) = providers.gradleProperty(key)
5+
fun environment(key: String) = providers.environmentVariable(key)
96

107
plugins {
11-
id("java")
12-
id("org.jetbrains.kotlin.jvm") version "1.8.0-Beta"
13-
id("org.jetbrains.intellij") version "1.10.0"
14-
id("org.jetbrains.changelog") version "2.0.0"
15-
id("io.gitlab.arturbosch.detekt") version "1.22.0"
16-
id("org.jlleitschuh.gradle.ktlint") version "11.0.0"
17-
id("org.jetbrains.qodana") version "0.1.13"
18-
id("com.github.ben-manes.versions") version "0.44.0"
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
14+
id("com.github.ben-manes.versions") version "0.47.0"
1915
}
2016

21-
group = properties("pluginGroup")
22-
version = properties("pluginVersion")
17+
group = properties("pluginGroup").get()
18+
version = properties("pluginVersion").get()
2319

2420
// Configure project's dependencies
2521
repositories {
2622
mavenCentral()
2723
}
2824

29-
dependencies {
30-
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.22.0")
25+
kotlin {
26+
jvmToolchain(17)
3127
}
3228

33-
// Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
3429
intellij {
35-
pluginName.set(properties("pluginName"))
36-
version.set(properties("platformVersion"))
37-
type.set(properties("platformType"))
30+
pluginName = properties("pluginName")
31+
version = properties("platformVersion")
32+
type = properties("platformType")
3833

3934
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
40-
plugins.set(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
35+
plugins = properties("platformPlugins").map { it.split(',').map(String::trim).filter(String::isNotEmpty) }
4136
}
4237

4338
// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
4439
changelog {
45-
version.set(properties("pluginVersion"))
46-
groups.set(emptyList())
40+
groups.empty()
41+
repositoryUrl = properties("pluginRepositoryUrl")
4742
}
4843

44+
4945
// Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin
5046
qodana {
51-
cachePath.set(projectDir.resolve(".qodana").canonicalPath)
52-
reportPath.set(projectDir.resolve("build/reports/inspections").canonicalPath)
53-
saveReport.set(true)
54-
showReport.set(System.getenv("QODANA_SHOW_REPORT")?.toBoolean() ?: false)
55-
}
56-
57-
// Configure detekt plugin.
58-
// Read more: https://detekt.github.io/detekt/kotlindsl.html
59-
detekt {
60-
config = files("./detekt-config.yml")
61-
buildUponDefaultConfig = true
47+
cachePath = provider { file(".qodana").canonicalPath }
48+
reportPath = provider { file("build/reports/inspections").canonicalPath }
49+
saveReport = true
50+
showReport = environment("QODANA_SHOW_REPORT").map { it.toBoolean() }.getOrElse(false)
6251
}
6352

64-
tasks {
65-
// Set the JVM compatibility versions
66-
properties("javaVersion").let {
67-
withType<JavaCompile> {
68-
sourceCompatibility = it
69-
targetCompatibility = it
70-
}
71-
withType<KotlinCompile> {
72-
kotlinOptions.jvmTarget = it
73-
}
74-
withType<Detekt> {
75-
jvmTarget = it
53+
// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration
54+
koverReport {
55+
defaults {
56+
xml {
57+
onCheck = true
7658
}
7759
}
60+
}
7861

62+
tasks {
7963
wrapper {
80-
gradleVersion = properties("gradleVersion")
64+
gradleVersion = properties("gradleVersion").get()
8165
}
8266

8367
patchPluginXml {
84-
version.set(properties("pluginVersion"))
85-
sinceBuild.set(properties("pluginSinceBuild"))
86-
untilBuild.set(properties("pluginUntilBuild"))
68+
version = properties("pluginVersion")
69+
sinceBuild = properties("pluginSinceBuild")
70+
untilBuild = properties("pluginUntilBuild")
8771

8872
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
89-
pluginDescription.set(
90-
projectDir.resolve("README.md").readText().lines().run {
91-
val start = "<!-- Plugin description -->"
92-
val end = "<!-- Plugin description end -->"
73+
pluginDescription = providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
74+
val start = "<!-- Plugin description -->"
75+
val end = "<!-- Plugin description end -->"
9376

77+
with (it.lines()) {
9478
if (!containsAll(listOf(start, end))) {
9579
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
9680
}
97-
subList(indexOf(start) + 1, indexOf(end))
98-
}.joinToString("\n").run { markdownToHTML(this) }
99-
)
81+
subList(indexOf(start) + 1, indexOf(end)).joinToString("\n").let(::markdownToHTML)
82+
}
83+
}
10084

85+
val changelog = project.changelog // local variable for configuration cache compatibility
10186
// Get the latest available change notes from the changelog file
102-
changeNotes.set(
103-
provider {
104-
changelog.run {
105-
getOrNull(properties("pluginVersion")) ?: getLatest()
106-
}.toHTML()
87+
changeNotes = properties("pluginVersion").map { pluginVersion ->
88+
with(changelog) {
89+
renderItem(
90+
(getOrNull(pluginVersion) ?: getUnreleased())
91+
.withHeader(false)
92+
.withEmptySections(false),
93+
Changelog.OutputType.HTML,
94+
)
10795
}
108-
)
96+
}
10997
}
11098

11199
// Configure UI tests plugin
@@ -118,17 +106,17 @@ tasks {
118106
}
119107

120108
signPlugin {
121-
certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
122-
privateKey.set(System.getenv("PRIVATE_KEY"))
123-
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
109+
certificateChain = environment("CERTIFICATE_CHAIN")
110+
privateKey = environment("PRIVATE_KEY")
111+
password = environment("PRIVATE_KEY_PASSWORD")
124112
}
125113

126114
publishPlugin {
127115
dependsOn("patchChangelog")
128-
token.set(System.getenv("PUBLISH_TOKEN"))
129-
// pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
116+
token = environment("PUBLISH_TOKEN")
117+
// The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
130118
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
131119
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
132-
channels.set(listOf(properties("pluginVersion").split('-').getOrElse(1) { "default" }.split('.').first()))
120+
channels = properties("pluginVersion").map { listOf(it.split('-').getOrElse(1) { "default" }.split('.').first()) }
133121
}
134-
}
122+
}

gradle.properties

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,30 @@
33

44
pluginGroup = net.bjonnh.intellij.filepermissionsplugin
55
pluginName = File Permissions
6-
pluginVersion = 0.2.6
7-
pluginSinceBuild = 203
8-
pluginUntilBuild = 231.*
6+
pluginVersion = 0.2.7
7+
pluginSinceBuild = 222
8+
pluginUntilBuild = 232.*
99

1010
# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
1111
platformType = IC
12-
platformVersion = 2021.1.3
12+
platformVersion = 2022.2.5
1313

1414
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
1515
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
1616
platformPlugins =
1717

18-
# Java language level used to compile sources and to generate the files for - Java 11 is required since 2020.3
19-
javaVersion = 11
2018

2119
# Gradle Releases -> https://github.com/gradle/gradle/releases
22-
gradleVersion = 7.4
20+
gradleVersion = 8.2.1
2321

24-
# Opt-out flag for bundling Kotlin standard library.
25-
# See https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library for details.
26-
# suppress inspection "UnusedProperty"
22+
# Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib
2723
kotlin.stdlib.default.dependency = false
24+
25+
# Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html
26+
org.gradle.configuration-cache = true
27+
28+
# Enable Gradle Build Cache -> https://docs.gradle.org/current/userguide/build_cache.html
29+
org.gradle.caching = true
30+
31+
# Enable Gradle Kotlin DSL Lazy Property Assignment -> https://docs.gradle.org/current/userguide/kotlin_dsl.html#kotdsl:assignment
32+
systemProp.org.gradle.unsafe.kotlin.assignment = true

gradle/libs.versions.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[versions]
2+
# libraries
3+
annotations = "24.0.1"
4+
5+
# plugins
6+
kotlin = "1.9.0"
7+
changelog = "2.1.2"
8+
gradleIntelliJPlugin = "1.15.0"
9+
qodana = "0.1.13"
10+
kover = "0.7.2"
11+
12+
[libraries]
13+
annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" }
14+
15+
[plugins]
16+
changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" }
17+
gradleIntelliJPlugin = { id = "org.jetbrains.intellij", version.ref = "gradleIntelliJPlugin" }
18+
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
19+
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
20+
qodana = { id = "org.jetbrains.qodana", version.ref = "qodana" }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-rc-1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

qodana.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,11 @@
22
# https://www.jetbrains.com/help/qodana/qodana-yaml.html
33

44
version: 1.0
5+
linter: jetbrains/qodana-jvm-community:latest
6+
projectJDK: 17
57
profile:
68
name: qodana.recommended
9+
exclude:
10+
- name: All
11+
paths:
12+
- .qodana

0 commit comments

Comments
 (0)