Skip to content

Commit 01efb95

Browse files
authored
Merge pull request #458 from JetBrains/2.0.0
2.0.0
2 parents 1d73667 + 87e9765 commit 01efb95

File tree

12 files changed

+118
-132
lines changed

12 files changed

+118
-132
lines changed

.github/template-cleanup/gradle.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ platformType = IC
1515
platformVersion = 2023.2.7
1616

1717
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
18-
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
18+
# Example: platformPlugins = com.jetbrains.php:203.4449.22, org.intellij.scala:2023.3.27@EAP
1919
platformPlugins =
20+
# Example: platformBundledPlugins = com.intellij.java
21+
platformBundledPlugins =
2022

2123
# Gradle Releases -> https://github.com/gradle/gradle/releases
2224
gradleVersion = 8.9

.github/workflows/build.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ jobs:
7373
echo "$CHANGELOG" >> $GITHUB_OUTPUT
7474
echo "EOF" >> $GITHUB_OUTPUT
7575
76-
./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
77-
7876
# Build plugin
7977
- name: Build plugin
8078
run: ./gradlew buildPlugin
@@ -214,7 +212,7 @@ jobs:
214212

215213
# Run Verify Plugin task and IntelliJ Plugin Verifier tool
216214
- name: Run Plugin Verification tasks
217-
run: ./gradlew runPluginVerifier -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }}
215+
run: ./gradlew verifyPlugin -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }}
218216

219217
# Collect Plugin Verifier Result
220218
- name: Collect Plugin Verifier Result

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
echo "$CHANGELOG" >> $GITHUB_OUTPUT
5252
echo "EOF" >> $GITHUB_OUTPUT
5353
54-
# Update Unreleased section with the current release note
54+
# Update the Unreleased section with the current release note
5555
- name: Patch Changelog
5656
if: ${{ steps.properties.outputs.changelog != '' }}
5757
env:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.gradle
22
.idea
3+
.intellijPlatform
34
.qodana
45
build

.run/Run IDE for UI Tests.run.xml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.run/Run Qodana.run.xml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.run/Run Verifications.run.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,15 @@
1111
</option>
1212
<option name="taskNames">
1313
<list>
14-
<option value="runPluginVerifier" />
14+
<option value="verifyPlugin" />
1515
</list>
1616
</option>
1717
<option name="vmOptions" value="" />
1818
</ExternalSystemSettings>
1919
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
2020
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
2121
<DebugAllEnabled>false</DebugAllEnabled>
22-
<method v="2">
23-
<option name="Gradle.BeforeRunTask" enabled="true" tasks="clean" externalProjectPath="$PROJECT_DIR$" vmOptions="" scriptParameters="" />
24-
</method>
22+
<RunAsTest>false</RunAsTest>
23+
<method v="2" />
2524
</configuration>
2625
</component>

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
## [Unreleased]
66

7+
### Changed
8+
9+
- Migrate to [IntelliJ Platform Gradle Plugin 2.0](https://blog.jetbrains.com/platform/2024/07/intellij-platform-gradle-plugin-2-0/).
10+
711
## [1.14.2] - 2024-07-12
812

913
### Changed
@@ -47,7 +51,7 @@
4751

4852
- Dependencies - upgrade `org.jetbrains.kotlin.jvm` to `1.9.23`
4953
- Dependencies - upgrade `org.jetbrains.kotlinx.kover` to `0.7.6`
50-
- Dependencies - upgrade `org.jetbrains.qodana` to `2023.3.1`
54+
- Dependencies - upgrade `org.jetbrains.qodana` to `2023.3.2`
5155
- Dependencies (GitHub Actions) - upgrade `actions/upload-artifact` to `4`
5256
- Dependencies (GitHub Actions) - upgrade `codecov/codecov-action` to `4`
5357
- Dependencies (GitHub Actions) - upgrade `gradle/wrapper-validation-action` to `2`

build.gradle.kts

Lines changed: 94 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,63 @@
11
import org.jetbrains.changelog.Changelog
22
import org.jetbrains.changelog.markdownToHTML
3-
4-
fun properties(key: String) = providers.gradleProperty(key)
5-
fun environment(key: String) = providers.environmentVariable(key)
3+
import org.jetbrains.intellij.platform.gradle.Constants.Constraints
4+
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
65

76
plugins {
87
id("java") // Java support
98
alias(libs.plugins.kotlin) // Kotlin support
10-
alias(libs.plugins.gradleIntelliJPlugin) // Gradle IntelliJ Plugin
9+
alias(libs.plugins.intelliJPlatform) // IntelliJ Platform Gradle Plugin
1110
alias(libs.plugins.changelog) // Gradle Changelog Plugin
1211
alias(libs.plugins.qodana) // Gradle Qodana Plugin
1312
alias(libs.plugins.kover) // Gradle Kover Plugin
1413
}
1514

16-
group = properties("pluginGroup").get()
17-
version = properties("pluginVersion").get()
15+
group = providers.gradleProperty("pluginGroup").get()
16+
version = providers.gradleProperty("pluginVersion").get()
17+
18+
// Set the JVM language level used to build the project.
19+
kotlin {
20+
jvmToolchain(17)
21+
}
1822

1923
// Configure project's dependencies
2024
repositories {
2125
mavenCentral()
26+
27+
// IntelliJ Platform Gradle Plugin Repositories Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-repositories-extension.html
28+
intellijPlatform {
29+
defaultRepositories()
30+
}
2231
}
2332

2433
// Dependencies are managed with Gradle version catalog - read more: https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog
2534
dependencies {
26-
// implementation(libs.exampleLibrary)
27-
}
35+
testImplementation(libs.junit)
2836

29-
// Set the JVM language level used to build the project.
30-
kotlin {
31-
jvmToolchain(17)
32-
}
37+
// IntelliJ Platform Gradle Plugin Dependencies Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html
38+
intellijPlatform {
39+
create(providers.gradleProperty("platformType"), providers.gradleProperty("platformVersion"))
3340

34-
// Configure Gradle IntelliJ Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
35-
intellij {
36-
pluginName = properties("pluginName")
37-
version = properties("platformVersion")
38-
type = properties("platformType")
41+
// Plugin Dependencies. Uses `platformBundledPlugins` property from the gradle.properties file for bundled IntelliJ Platform plugins.
42+
bundledPlugins(providers.gradleProperty("platformBundledPlugins").map { it.split(',') })
3943

40-
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
41-
plugins = properties("platformPlugins").map { it.split(',').map(String::trim).filter(String::isNotEmpty) }
42-
}
43-
44-
// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
45-
changelog {
46-
groups.empty()
47-
repositoryUrl = properties("pluginRepositoryUrl")
48-
}
44+
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file for plugin from JetBrains Marketplace.
45+
plugins(providers.gradleProperty("platformPlugins").map { it.split(',') })
4946

50-
// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration
51-
kover {
52-
reports {
53-
total {
54-
xml {
55-
onCheck = true
56-
}
57-
}
47+
instrumentationTools()
48+
pluginVerifier()
49+
zipSigner()
50+
testFramework(TestFrameworkType.Platform)
5851
}
5952
}
6053

61-
tasks {
62-
wrapper {
63-
gradleVersion = properties("gradleVersion").get()
64-
}
65-
66-
patchPluginXml {
67-
version = properties("pluginVersion")
68-
sinceBuild = properties("pluginSinceBuild")
69-
untilBuild = properties("pluginUntilBuild")
54+
// Configure IntelliJ Platform Gradle Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-extension.html
55+
intellijPlatform {
56+
pluginConfiguration {
57+
version = providers.gradleProperty("pluginVersion")
7058

7159
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
72-
pluginDescription = providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
60+
description = providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
7361
val start = "<!-- Plugin description -->"
7462
val end = "<!-- Plugin description end -->"
7563

@@ -83,7 +71,7 @@ tasks {
8371

8472
val changelog = project.changelog // local variable for configuration cache compatibility
8573
// Get the latest available change notes from the changelog file
86-
changeNotes = properties("pluginVersion").map { pluginVersion ->
74+
changeNotes = providers.gradleProperty("pluginVersion").map { pluginVersion ->
8775
with(changelog) {
8876
renderItem(
8977
(getOrNull(pluginVersion) ?: getUnreleased())
@@ -93,29 +81,74 @@ tasks {
9381
)
9482
}
9583
}
96-
}
9784

98-
// Configure UI tests plugin
99-
// Read more: https://github.com/JetBrains/intellij-ui-test-robot
100-
runIdeForUiTests {
101-
systemProperty("robot-server.port", "8082")
102-
systemProperty("ide.mac.message.dialogs.as.sheets", "false")
103-
systemProperty("jb.privacy.policy.text", "<!--999.999-->")
104-
systemProperty("jb.consents.confirmation.enabled", "false")
85+
ideaVersion {
86+
sinceBuild = providers.gradleProperty("pluginSinceBuild")
87+
untilBuild = providers.gradleProperty("pluginUntilBuild")
88+
}
10589
}
10690

107-
signPlugin {
108-
certificateChain = environment("CERTIFICATE_CHAIN")
109-
privateKey = environment("PRIVATE_KEY")
110-
password = environment("PRIVATE_KEY_PASSWORD")
91+
signing {
92+
certificateChain = providers.environmentVariable("CERTIFICATE_CHAIN")
93+
privateKey = providers.environmentVariable("PRIVATE_KEY")
94+
password = providers.environmentVariable("PRIVATE_KEY_PASSWORD")
11195
}
11296

113-
publishPlugin {
114-
dependsOn("patchChangelog")
115-
token = environment("PUBLISH_TOKEN")
97+
publishing {
98+
token = providers.environmentVariable("PUBLISH_TOKEN")
11699
// The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
117100
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
118101
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
119-
channels = properties("pluginVersion").map { listOf(it.substringAfter('-', "").substringBefore('.').ifEmpty { "default" }) }
102+
channels = providers.gradleProperty("pluginVersion").map { listOf(it.substringAfter('-', "").substringBefore('.').ifEmpty { "default" }) }
103+
}
104+
105+
pluginVerification {
106+
ides {
107+
recommended()
108+
}
109+
}
110+
}
111+
112+
// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
113+
changelog {
114+
groups.empty()
115+
repositoryUrl = providers.gradleProperty("pluginRepositoryUrl")
116+
}
117+
118+
// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration
119+
kover {
120+
reports {
121+
total {
122+
xml {
123+
onCheck = true
124+
}
125+
}
126+
}
127+
}
128+
129+
tasks {
130+
wrapper {
131+
gradleVersion = providers.gradleProperty("gradleVersion").get()
132+
}
133+
134+
publishPlugin {
135+
dependsOn(patchChangelog)
136+
}
137+
}
138+
139+
val runIdeForUiTests by intellijPlatformTesting.runIde.registering {
140+
task {
141+
jvmArgumentProviders += CommandLineArgumentProvider {
142+
listOf(
143+
"-Drobot-server.port=8082",
144+
"-Dide.mac.message.dialogs.as.sheets=false",
145+
"-Djb.privacy.policy.text=<!--999.999-->",
146+
"-Djb.consents.confirmation.enabled=false",
147+
)
148+
}
149+
}
150+
151+
plugins {
152+
robotServerPlugin(Constraints.LATEST_VERSION)
120153
}
121154
}

gradle.properties

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pluginGroup = org.jetbrains.plugins.template
44
pluginName = IntelliJ Platform Plugin Template
55
pluginRepositoryUrl = https://github.com/JetBrains/intellij-platform-plugin-template
66
# SemVer format -> https://semver.org
7-
pluginVersion = 1.14.2
7+
pluginVersion = 2.0.0
88

99
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
1010
pluginSinceBuild = 232
@@ -15,8 +15,10 @@ platformType = IC
1515
platformVersion = 2023.2.7
1616

1717
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
18-
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
18+
# Example: platformPlugins = com.jetbrains.php:203.4449.22, org.intellij.scala:2023.3.27@EAP
1919
platformPlugins =
20+
# Example: platformBundledPlugins = com.intellij.java
21+
platformBundledPlugins =
2022

2123
# Gradle Releases -> https://github.com/gradle/gradle/releases
2224
gradleVersion = 8.9

gradle/libs.versions.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
[versions]
22
# libraries
3-
exampleLibrary = "24.1.0"
3+
junit = "4.13.2"
44

55
# plugins
6+
changelog = "2.2.1"
7+
intelliJPlatform = "2.0.0"
68
kotlin = "1.9.24"
7-
changelog = "2.2.0"
8-
gradleIntelliJPlugin = "1.17.4"
9-
qodana = "2024.1.5"
109
kover = "0.8.1"
10+
qodana = "2024.1.5"
1111

1212
[libraries]
13-
exampleLibrary = { group = "com.example", name = "exampleLibrary", version.ref = "exampleLibrary" }
13+
junit = { group = "junit", name = "junit", version.ref = "junit" }
1414

1515
[plugins]
1616
changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" }
17-
gradleIntelliJPlugin = { id = "org.jetbrains.intellij", version.ref = "gradleIntelliJPlugin" }
17+
intelliJPlatform = { id = "org.jetbrains.intellij.platform", version.ref = "intelliJPlatform" }
1818
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
1919
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
2020
qodana = { id = "org.jetbrains.qodana", version.ref = "qodana" }

0 commit comments

Comments
 (0)