1
1
import org.jetbrains.changelog.Changelog
2
-
3
- fun properties (key : String ) = providers.gradleProperty(key)
2
+ import org.jetbrains.intellij.platform.gradle.TestFrameworkType
4
3
5
4
plugins {
6
5
id(" java" ) // Java support
7
6
alias(libs.plugins.kotlin) // Kotlin support
8
- alias(libs.plugins.gradleIntelliJPlugin ) // Gradle IntelliJ Plugin
7
+ alias(libs.plugins.intelliJPlatform ) // IntelliJ Platform Gradle Plugin
9
8
alias(libs.plugins.changelog) // Gradle Changelog Plugin
10
9
}
11
10
12
- group = properties(" pluginGroup" ).get()
13
- version = properties(" pluginVersion" ).get()
11
+ group = providers.gradleProperty(" pluginGroup" ).get()
12
+ version = providers.gradleProperty(" pluginVersion" ).get()
13
+
14
+ // Set the JVM language level used to build the project.
15
+ kotlin {
16
+ jvmToolchain(17 )
17
+ }
14
18
15
19
// Configure project's dependencies
16
20
repositories {
17
21
mavenCentral()
18
- }
19
22
20
- // Set the JVM language level used to build the project.
21
- kotlin {
22
- jvmToolchain(17 )
23
+ // IntelliJ Platform Gradle Plugin Repositories Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-repositories-extension.html
24
+ intellijPlatform {
25
+ defaultRepositories()
26
+ }
23
27
}
24
28
25
29
// Dependencies are managed with Gradle version catalog - read more: https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog
26
30
dependencies {
27
- }
31
+ testImplementation(" org.opentest4j:opentest4j:1.3.0" ) // TODO: remove in the next update
32
+ testImplementation(libs.junit)
28
33
29
- // Configure Gradle IntelliJ Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
30
- intellij {
31
- pluginName = properties(" pluginName" )
32
- version = properties(" platformVersion" )
33
- type = properties(" platformType" )
34
+ // IntelliJ Platform Gradle Plugin Dependencies Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html
35
+ intellijPlatform {
36
+ create(providers.gradleProperty(" platformType" ), providers.gradleProperty(" platformVersion" ))
34
37
35
- // Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
36
- plugins = properties(" platformPlugins" ).map { it.split(' ,' ).map(String ::trim).filter(String ::isNotEmpty) }
37
- }
38
+ // Plugin Dependencies. Uses `platformBundledPlugins` property from the gradle.properties file for bundled IntelliJ Platform plugins.
39
+ bundledPlugins(providers.gradleProperty(" platformBundledPlugins" ).map { it.split(' ,' ) })
38
40
39
- // Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
40
- changelog {
41
- groups.empty()
42
- repositoryUrl = properties(" pluginRepositoryUrl" )
43
- }
41
+ // Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file for plugin from JetBrains Marketplace.
42
+ plugins(providers.gradleProperty(" platformPlugins" ).map { it.split(' ,' ) })
44
43
45
- tasks {
46
- wrapper {
47
- gradleVersion = properties(" gradleVersion" ).get()
44
+ instrumentationTools()
45
+ pluginVerifier()
46
+ zipSigner()
47
+ testFramework(TestFrameworkType .Platform )
48
48
}
49
+ }
49
50
50
- patchPluginXml {
51
- version = properties( " pluginVersion " )
52
- sinceBuild = properties( " pluginSinceBuild " )
53
- untilBuild = properties( " pluginUntilBuild " )
51
+ // Configure IntelliJ Platform Gradle Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-extension.html
52
+ intellijPlatform {
53
+ pluginConfiguration {
54
+ version = providers.gradleProperty( " pluginVersion " )
54
55
55
56
val changelog = project.changelog // local variable for configuration cache compatibility
56
57
// Get the latest available change notes from the changelog file
57
- changeNotes = properties (" pluginVersion" ).map { pluginVersion ->
58
+ changeNotes = providers.gradleProperty (" pluginVersion" ).map { pluginVersion ->
58
59
with (changelog) {
59
60
renderItem(
60
61
(getOrNull(pluginVersion) ? : getUnreleased())
@@ -64,28 +65,40 @@ tasks {
64
65
)
65
66
}
66
67
}
67
- }
68
-
69
- runIde {
70
- maxHeapSize = " 8g"
71
- }
72
68
73
- buildSearchableOptions {
74
- enabled = false
69
+ ideaVersion {
70
+ sinceBuild = providers.gradleProperty(" pluginSinceBuild" )
71
+ untilBuild = providers.gradleProperty(" pluginUntilBuild" )
72
+ }
75
73
}
76
74
77
75
sourceSets {
78
76
test {
79
77
resources {
80
- setSrcDirs(project.files (" src/test/fixtures" ))
78
+ setSrcDirs(listOf (" src/test/fixtures" ))
81
79
}
82
80
}
83
81
}
84
82
83
+ pluginVerification {
84
+ ides {
85
+ recommended()
86
+ }
87
+ }
88
+ }
89
+
90
+ // Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
91
+ changelog {
92
+ groups.empty()
93
+ repositoryUrl = providers.gradleProperty(" pluginRepositoryUrl" )
94
+ }
95
+
96
+ tasks {
85
97
test {
86
98
delete(" src/test/fixtures/gen" )
99
+ }
87
100
88
- setExcludes( listOf ( " com/vk/modulite/infrastructure/** " , " com/vk/modulite/dsl/** " ))
89
- isScanForTestClasses = false
101
+ wrapper {
102
+ gradleVersion = providers.gradleProperty( " gradleVersion " ).get()
90
103
}
91
104
}
0 commit comments