1
- import java.net.URI
1
+ import org.jetbrains.intellij.platform.gradle.TestFrameworkType
2
2
3
- fun properties (key : String ) = providers.gradleProperty(key)
4
- fun environment (key : String ) = providers.environmentVariable(key)
5
3
val remoteRobotVersion = " 0.11.21"
6
4
7
5
plugins {
8
6
id(" java" ) // Java support
9
7
alias(libs.plugins.kotlin) // Kotlin support
10
- alias(libs.plugins.gradleIntelliJPlugin ) // Gradle IntelliJ Plugin
8
+ alias(libs.plugins.intelliJPlatform ) // IntelliJ Platform Gradle Plugin
11
9
}
12
10
13
- group = properties (" pluginGroup" ).get()
14
- version = properties (" pluginVersion" ).get()
11
+ group = providers.gradleProperty (" pluginGroup" ).get()
12
+ version = providers.gradleProperty (" pluginVersion" ).get()
15
13
16
14
// Configure project's dependencies
17
15
repositories {
18
16
mavenCentral()
19
- maven { url = URI (" https://packages.jetbrains.team/maven/p/ij/intellij-dependencies" ) }
17
+
18
+ // IntelliJ Platform Gradle Plugin Repositories Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-repositories-extension.html
19
+ intellijPlatform {
20
+ defaultRepositories()
21
+ }
20
22
}
21
23
22
24
// Dependencies are managed with Gradle version catalog - read more: https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog
23
25
dependencies {
26
+ testImplementation(libs.junit)
24
27
testImplementation(" com.intellij.remoterobot:remote-robot:$remoteRobotVersion " )
25
28
testImplementation(" com.intellij.remoterobot:remote-fixtures:$remoteRobotVersion " )
26
29
testImplementation(" org.junit.jupiter:junit-jupiter-api:5.10.0" )
@@ -29,6 +32,22 @@ dependencies {
29
32
30
33
// Logging Network Calls
31
34
testImplementation(" com.squareup.okhttp3:logging-interceptor:4.12.0" )
35
+
36
+ // IntelliJ Platform Gradle Plugin Dependencies Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html
37
+ intellijPlatform {
38
+ create(providers.gradleProperty(" platformType" ), providers.gradleProperty(" platformVersion" ))
39
+
40
+ // Plugin Dependencies. Uses `platformBundledPlugins` property from the gradle.properties file for bundled IntelliJ Platform plugins.
41
+ bundledPlugins(providers.gradleProperty(" platformBundledPlugins" ).map { it.split(' ,' ) })
42
+
43
+ // Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file for plugin from JetBrains Marketplace.
44
+ plugins(providers.gradleProperty(" platformPlugins" ).map { it.split(' ,' ) })
45
+
46
+ instrumentationTools()
47
+ pluginVerifier()
48
+ zipSigner()
49
+ testFramework(TestFrameworkType .Platform )
50
+ }
32
51
}
33
52
34
53
// Set the JVM language level used to build the project. Use Java 11 for 2020.3+, and Java 17 for 2022.2+.
@@ -37,64 +56,76 @@ kotlin {
37
56
}
38
57
39
58
// Configure Gradle IntelliJ Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
40
- intellij {
41
- pluginName = properties(" pluginName" )
42
- version = properties(" platformVersion" )
43
- type = properties(" platformType" )
44
-
45
- // Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
46
- plugins = properties(" platformPlugins" ).map { it.split(' ,' ).map(String ::trim).filter(String ::isNotEmpty) }
47
- }
59
+ intellijPlatform {
60
+ pluginConfiguration {
61
+ version = providers.gradleProperty(" pluginVersion" )
62
+
63
+ ideaVersion {
64
+ sinceBuild = providers.gradleProperty(" pluginSinceBuild" )
65
+ untilBuild = providers.gradleProperty(" pluginUntilBuild" )
66
+ }
67
+ }
48
68
49
- tasks {
50
- wrapper {
51
- gradleVersion = properties(" gradleVersion" ).get()
69
+ signing {
70
+ certificateChain = providers.environmentVariable(" CERTIFICATE_CHAIN" )
71
+ privateKey = providers.environmentVariable(" PRIVATE_KEY" )
72
+ password = providers.environmentVariable(" PRIVATE_KEY_PASSWORD" )
52
73
}
53
74
54
- patchPluginXml {
55
- version = properties(" pluginVersion" )
56
- sinceBuild = properties(" pluginSinceBuild" )
57
- untilBuild = properties(" pluginUntilBuild" )
75
+ publishing {
76
+ token = providers.environmentVariable(" PUBLISH_TOKEN" )
77
+ // The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
78
+ // Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
79
+ // https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
80
+ channels = providers.gradleProperty(" pluginVersion" ).map { listOf (it.split(' -' ).getOrElse(1 ) { " default" }.split(' .' ).first()) }
58
81
}
59
82
60
- downloadRobotServerPlugin {
61
- version.set(remoteRobotVersion)
83
+ pluginVerification {
84
+ ides {
85
+ recommended()
86
+ }
62
87
}
88
+ }
63
89
64
- // Configure UI tests plugin
65
- // Read more: https://github.com/JetBrains/intellij-ui-test-robot
66
- runIdeForUiTests {
67
- systemProperty(" robot-server.port" , " 8082" )
68
- systemProperty(" ide.mac.message.dialogs.as.sheets" , " false" )
69
- systemProperty(" jb.privacy.policy.text" , " <!--999.999-->" )
70
- systemProperty(" jb.consents.confirmation.enabled" , " false" )
71
- systemProperty(" ide.mac.file.chooser.native" , " false" )
72
- systemProperty(" jbScreenMenuBar.enabled" , " false" )
73
- systemProperty(" apple.laf.useScreenMenuBar" , " false" )
74
- systemProperty(" idea.trust.all.projects" , " true" )
75
- systemProperty(" ide.show.tips.on.startup.default.value" , " false" )
76
- systemProperty(" eap.require.license" , " false" )
90
+ tasks {
91
+ wrapper {
92
+ gradleVersion = providers.gradleProperty(" gradleVersion" ).get()
93
+ }
77
94
95
+ patchPluginXml {
96
+ version = providers.gradleProperty(" pluginVersion" )
97
+ sinceBuild = providers.gradleProperty(" pluginSinceBuild" )
98
+ untilBuild = providers.gradleProperty(" pluginUntilBuild" )
78
99
}
79
100
80
101
test {
81
102
useJUnitPlatform()
82
103
}
104
+ }
83
105
84
- signPlugin {
85
- certificateChain = environment(" CERTIFICATE_CHAIN" )
86
- privateKey = environment(" PRIVATE_KEY" )
87
- password = environment(" PRIVATE_KEY_PASSWORD" )
88
- }
89
-
90
- publishPlugin {
91
- token = environment(" PUBLISH_TOKEN" )
92
- // The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
93
- // Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
94
- // https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
95
- channels = properties(" pluginVersion" ).map { listOf (it.split(' -' ).getOrElse(1 ) { " default" }.split(' .' ).first()) }
106
+ intellijPlatformTesting {
107
+ runIde {
108
+ register(" runIdeForUiTests" ) {
109
+ task {
110
+ jvmArgumentProviders + = CommandLineArgumentProvider {
111
+ listOf (
112
+ " -Drobot-server.port=8082" ,
113
+ " -Dide.mac.message.dialogs.as.sheets=false" ,
114
+ " -Djb.privacy.policy.text=<!--999.999-->" ,
115
+ " -Djb.consents.confirmation.enabled=false" ,
116
+ " -Dide.mac.file.chooser.native=false" ,
117
+ " -DjbScreenMenuBar.enabled=false" ,
118
+ " -Dapple.laf.useScreenMenuBar=false" ,
119
+ " -Didea.trust.all.projects=true" ,
120
+ " -Dide.show.tips.on.startup.default.value=false" ,
121
+ " -Deap.require.license=false"
122
+ )
123
+ }
124
+ }
125
+
126
+ plugins {
127
+ robotServerPlugin()
128
+ }
129
+ }
96
130
}
97
131
}
98
-
99
-
100
-
0 commit comments