Skip to content

Commit 0286f36

Browse files
chore: migrate changes of intellij-platform-plugin-template v1.5.0
1 parent d4c1823 commit 0286f36

File tree

6 files changed

+57
-52
lines changed

6 files changed

+57
-52
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jobs:
102102

103103
# Run Verify Plugin task and IntelliJ Plugin Verifier tool
104104
- name: Run Plugin Verification tasks
105-
run: ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}
105+
run: ./gradlew runPluginVerifier -Dplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}
106106

107107
# Collect Plugin Verifier Result
108108
- name: Collect Plugin Verifier Result

.github/workflows/release.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,9 @@ jobs:
4141
EOM
4242
)"
4343
44-
CHANGELOG="${CHANGELOG//'%'/'%25'}"
45-
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
46-
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
47-
48-
echo "changelog=$CHANGELOG" >> $GITHUB_OUTPUT
44+
echo "changelog<<EOF" >> $GITHUB_OUTPUT
45+
echo "$CHANGELOG" >> $GITHUB_OUTPUT
46+
echo "EOF" >> $GITHUB_OUTPUT
4947
5048
# Update Unreleased section with the current release note
5149
- name: Patch Changelog

CHANGELOG.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Testcontainers Port Updater Changelog
22

33
## [Unreleased]
4+
- Bump dependencies to their latest versions
5+
- Bump Gradle version to 8.0.2
6+
- Migrate latest changes of intellij-platform-plugin-template
47

58
## [1.1.0] - 2023-02-25
69
- Bump dependencies to their latest versions
@@ -88,19 +91,19 @@
8891

8992
[Unreleased]: https://github.com/yusufugurozbek/testcontainers-port-updater/compare/v1.1.0...HEAD
9093
[1.1.0]: https://github.com/yusufugurozbek/testcontainers-port-updater/compare/v1.0.5...v1.1.0
91-
[1.0.5]: null/compare/v1.0.4...v1.0.5
92-
[1.0.4]: null/compare/v1.0.3...v1.0.4
93-
[1.0.3]: null/compare/v1.0.2...v1.0.3
94-
[1.0.2]: null/compare/v1.0.1...v1.0.2
95-
[1.0.1]: null/compare/v1.0.0...v1.0.1
96-
[1.0.0]: null/compare/v0.1.2...v1.0.0
97-
[0.1.2]: null/compare/v0.1.1...v0.1.2
98-
[0.1.1]: null/compare/v0.1.0...v0.1.1
99-
[0.1.0]: null/compare/v0.0.8...v0.1.0
100-
[0.0.8]: null/compare/v0.0.7...v0.0.8
101-
[0.0.7]: null/compare/v0.0.6...v0.0.7
102-
[0.0.6]: null/compare/v0.0.5...v0.0.6
103-
[0.0.5]: null/compare/v0.0.4...v0.0.5
104-
[0.0.4]: null/compare/v0.0.3...v0.0.4
105-
[0.0.3]: null/compare/v0.0.2...v0.0.3
106-
[0.0.2]: null/commits/v0.0.2
94+
[1.0.5]: https://github.com/yusufugurozbek/testcontainers-port-updater/compare/v1.0.4...v1.0.5
95+
[1.0.4]: https://github.com/yusufugurozbek/testcontainers-port-updater/compare/v1.0.3...v1.0.4
96+
[1.0.3]: https://github.com/yusufugurozbek/testcontainers-port-updater/compare/v1.0.2...v1.0.3
97+
[1.0.2]: https://github.com/yusufugurozbek/testcontainers-port-updater/compare/v1.0.1...v1.0.2
98+
[1.0.1]: https://github.com/yusufugurozbek/testcontainers-port-updater/compare/v1.0.0...v1.0.1
99+
[1.0.0]: https://github.com/yusufugurozbek/testcontainers-port-updater/compare/v0.1.2...v1.0.0
100+
[0.1.2]: https://github.com/yusufugurozbek/testcontainers-port-updater/compare/v0.1.1...v0.1.2
101+
[0.1.1]: https://github.com/yusufugurozbek/testcontainers-port-updater/compare/v0.1.0...v0.1.1
102+
[0.1.0]: https://github.com/yusufugurozbek/testcontainers-port-updater/compare/v0.0.8...v0.1.0
103+
[0.0.8]: https://github.com/yusufugurozbek/testcontainers-port-updater/compare/v0.0.7...v0.0.8
104+
[0.0.7]: https://github.com/yusufugurozbek/testcontainers-port-updater/compare/v0.0.6...v0.0.7
105+
[0.0.6]: https://github.com/yusufugurozbek/testcontainers-port-updater/compare/v0.0.5...v0.0.6
106+
[0.0.5]: https://github.com/yusufugurozbek/testcontainers-port-updater/compare/v0.0.4...v0.0.5
107+
[0.0.4]: https://github.com/yusufugurozbek/testcontainers-port-updater/compare/v0.0.3...v0.0.4
108+
[0.0.3]: https://github.com/yusufugurozbek/testcontainers-port-updater/compare/v0.0.2...v0.0.3
109+
[0.0.2]: https://github.com/yusufugurozbek/testcontainers-port-updater/compare/v0.0.1...v0.0.2

build.gradle.kts

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import org.jetbrains.changelog.Changelog
22
import org.jetbrains.changelog.markdownToHTML
33

4-
fun properties(key: String) = project.findProperty(key).toString()
4+
fun properties(key: String) = providers.gradleProperty(key)
5+
fun environment(key: String) = providers.environmentVariable(key)
56

67
plugins {
78
// Java support
89
id("java")
910
// Kotlin support
1011
id("org.jetbrains.kotlin.jvm") version "1.8.10"
1112
// Gradle IntelliJ Plugin
12-
id("org.jetbrains.intellij") version "1.13.1"
13+
id("org.jetbrains.intellij") version "1.13.2"
1314
// Gradle Changelog Plugin
1415
id("org.jetbrains.changelog") version "2.0.0"
1516
// Gradle Qodana Plugin
@@ -18,16 +19,16 @@ plugins {
1819
id("org.jetbrains.kotlinx.kover") version "0.6.1"
1920
}
2021

21-
group = properties("pluginGroup")
22-
version = properties("pluginVersion")
22+
group = properties("pluginGroup").get()
23+
version = properties("pluginVersion").get()
2324

2425
// Configure project's dependencies
2526
repositories {
2627
mavenCentral()
2728
}
2829

2930
kotlin {
30-
jvmToolchain(properties("javaVersion").toInt())
31+
jvmToolchain(properties("javaVersion").get().toInt())
3132
}
3233

3334
// Configure Gradle IntelliJ Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
@@ -37,21 +38,21 @@ intellij {
3738
type.set(properties("platformType"))
3839

3940
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
40-
plugins.set(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
41+
plugins.set(properties("platformPlugins").map { it.split(',').map(String::trim).filter(String::isNotEmpty) })
4142
}
4243

4344
// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
4445
changelog {
45-
groups.set(emptyList())
46+
groups.empty()
4647
repositoryUrl.set(properties("pluginRepositoryUrl"))
4748
}
4849

4950
// Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin
5051
qodana {
51-
cachePath.set(file(".qodana").canonicalPath)
52-
reportPath.set(file("build/reports/inspections").canonicalPath)
52+
cachePath.set(provider { file(".qodana").canonicalPath })
53+
reportPath.set(provider { file("build/reports/inspections").canonicalPath })
5354
saveReport.set(true)
54-
showReport.set(System.getenv("QODANA_SHOW_REPORT")?.toBoolean() ?: false)
55+
showReport.set(environment("QODANA_SHOW_REPORT").map { it.toBoolean() }.getOrElse(false))
5556
}
5657

5758
// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration
@@ -61,7 +62,7 @@ kover.xmlReport {
6162

6263
tasks {
6364
wrapper {
64-
gradleVersion = properties("gradleVersion")
65+
gradleVersion = properties("gradleVersion").get()
6566
}
6667

6768
patchPluginXml {
@@ -70,24 +71,26 @@ tasks {
7071
untilBuild.set(properties("pluginUntilBuild"))
7172

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

78+
with (it.lines()) {
7879
if (!containsAll(listOf(start, end))) {
7980
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
8081
}
81-
subList(indexOf(start) + 1, indexOf(end))
82-
}.joinToString("\n").let { markdownToHTML(it) }
83-
)
82+
subList(indexOf(start) + 1, indexOf(end)).joinToString("\n").let(::markdownToHTML)
83+
}
84+
})
8485

86+
val changelog = project.changelog // local variable for configuration cache compatibility
8587
// Get the latest available change notes from the changelog file
86-
changeNotes.set(provider {
88+
changeNotes.set(properties("pluginVersion").map { pluginVersion ->
8789
with(changelog) {
8890
renderItem(
89-
getOrNull(properties("pluginVersion"))
90-
?: runCatching { getLatest() }.getOrElse { getUnreleased() },
91+
(getOrNull(pluginVersion) ?: getUnreleased())
92+
.withHeader(false)
93+
.withEmptySections(false),
9194
Changelog.OutputType.HTML,
9295
)
9396
}
@@ -104,17 +107,17 @@ tasks {
104107
}
105108

106109
signPlugin {
107-
certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
108-
privateKey.set(System.getenv("PRIVATE_KEY"))
109-
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
110+
certificateChain.set(environment("CERTIFICATE_CHAIN"))
111+
privateKey.set(environment("PRIVATE_KEY"))
112+
password.set(environment("PRIVATE_KEY_PASSWORD"))
110113
}
111114

112115
publishPlugin {
113116
dependsOn("patchChangelog")
114-
token.set(System.getenv("PUBLISH_TOKEN"))
117+
token.set(environment("PUBLISH_TOKEN"))
115118
// The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
116119
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
117120
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
118-
channels.set(listOf(properties("pluginVersion").split('-').getOrElse(1) { "default" }.split('.').first()))
121+
channels.set(properties("pluginVersion").map { listOf(it.split('-').getOrElse(1) { "default" }.split('.').first()) })
119122
}
120123
}

gradle.properties

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pluginVersion = 1.1.0
88

99
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
1010
pluginSinceBuild = 222
11-
pluginUntilBuild = 223.*
11+
pluginUntilBuild = 231.*
1212

1313
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
1414
platformType = IU
@@ -18,13 +18,14 @@ platformVersion = 2022.2
1818
platformPlugins = com.intellij.database
1919

2020
# Gradle Releases -> https://github.com/gradle/gradle/releases
21-
gradleVersion = 8.0.1
21+
gradleVersion = 8.0.2
2222

23-
# Opt-out flag for bundling Kotlin standard library -> https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library
23+
# Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib
2424
# suppress inspection "UnusedProperty"
2525
kotlin.stdlib.default.dependency = false
2626

2727
# Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html
28+
# suppress inspection "UnusedProperty"
2829
org.gradle.unsafe.configuration-cache = true
2930

3031
javaVersion = 17
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)