1
- import org.jetbrains.intellij.tasks.RunPluginVerifierTask
2
- import java.util.EnumSet
1
+ import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
2
+ import org.jetbrains.intellij.platform.gradle.TestFrameworkType
3
3
4
4
group = " com.squareup.cash.hermit"
5
5
version = project.properties[" version" ] ? : " 1.0-SNAPSHOT"
6
6
7
7
plugins {
8
- id(" idea" )
9
8
id(" java" )
10
9
kotlin(" kapt" ) version " 1.9.25"
11
- id(" org.jetbrains.intellij" ) version " 1.17.4"
10
+ id(" org.jetbrains.intellij.platform" ) version " 2.0.0"
11
+
12
12
id(" org.jetbrains.kotlin.jvm" ) version " 1.9.25"
13
13
id(" org.jetbrains.kotlin.plugin.serialization" ) version " 1.4.32"
14
14
}
@@ -17,40 +17,15 @@ plugins {
17
17
18
18
java {
19
19
sourceCompatibility = JavaVersion .VERSION_17
20
- targetCompatibility = JavaVersion .VERSION_11
20
+ targetCompatibility = JavaVersion .VERSION_17
21
21
}
22
22
23
23
repositories {
24
24
mavenCentral()
25
- }
26
-
27
- val kotlinVersion = " 1.9.25"
28
- val arrowVersion = " 0.11.0"
29
-
30
- dependencies {
31
- implementation(" org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion " )
32
- implementation(" org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion " )
33
- implementation(" org.jetbrains.kotlinx:kotlinx-serialization-json:1.1.0" )
34
- implementation(" io.arrow-kt:arrow-core:$arrowVersion " )
35
- implementation(" io.arrow-kt:arrow-syntax:$arrowVersion " )
36
- kapt(" io.arrow-kt:arrow-meta:$arrowVersion " )
37
-
38
- testImplementation(" org.junit.jupiter:junit-jupiter-api:5.4.2" )
39
- }
40
-
41
- tasks {
42
- compileKotlin {
43
- kotlinOptions.jvmTarget = " 11"
44
- kotlinOptions.freeCompilerArgs = listOf (" -Xjvm-default=all-compatibility" )
45
- }
46
-
47
- test {
48
- systemProperty(" idea.force.use.core.classloader" , " true" )
25
+ intellijPlatform {
26
+ defaultRepositories()
49
27
}
50
28
}
51
- // endregion
52
-
53
- // region IJ Plugin setup
54
29
55
30
data class Product (
56
31
val releaseType : String , // identifier for this product
@@ -79,73 +54,83 @@ val products = listOf(
79
54
)
80
55
val product = products.first { it.releaseType == (System .getenv(" RELEASE_TYPE" ) ? : " release" ) }
81
56
82
- intellij {
83
- version.set(product.sdkVersion)
84
- type.set(" IU" )
85
- plugins.set(
86
- listOf (
87
- " gradle" ,
88
- " java" ,
89
- " terminal" ,
57
+ val kotlinVersion = " 1.9.25"
58
+ val arrowVersion = " 0.11.0"
59
+
60
+ dependencies {
61
+ intellijPlatform {
62
+ intellijIdeaUltimate(properties[" IIC.release.version" ] as String )
63
+ pluginVerifier(" 1.371" )
64
+ plugins(
65
+ " org.jetbrains.plugins.go:${product.goPluginVersion} "
66
+ )
67
+ bundledPlugins(
68
+ " com.intellij.gradle" ,
69
+ " com.intellij.java" ,
70
+ // "com.intellij.terminal",
90
71
" com.intellij.properties" ,
91
- " org.jetbrains.plugins.go:${product.goPluginVersion} " ,
92
72
// Needed by Go plugin. See https://github.com/JetBrains/gradle-intellij-plugin/issues/1056
93
73
" org.intellij.intelliLang"
94
74
)
95
- )
75
+ testFramework(TestFrameworkType .Bundled , properties[" IIC.release.version" ] as String )
76
+ }
77
+
78
+ implementation(" org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion " )
79
+ implementation(" org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion " )
80
+ implementation(" org.jetbrains.kotlinx:kotlinx-serialization-json:1.1.0" )
81
+ implementation(" io.arrow-kt:arrow-core:$arrowVersion " )
82
+ implementation(" io.arrow-kt:arrow-syntax:$arrowVersion " )
83
+ kapt(" io.arrow-kt:arrow-meta:$arrowVersion " )
84
+
85
+ testImplementation(" junit:junit:4.13.2" )
86
+ testImplementation(" org.junit.jupiter:junit-jupiter-api:5.4.2" )
96
87
}
88
+
97
89
tasks {
98
- runIde {
99
- // Uncomment this, and set your path accordingly, if you want to debug on GoLand
100
- // ideDirectory "/Users/juho/Library/Application Support/JetBrains/Toolbox/apps/Goland/ch-0/203.6682.164/GoLand.app/Contents"
90
+ compileKotlin {
91
+ kotlinOptions.jvmTarget = " 17"
92
+ kotlinOptions.freeCompilerArgs = listOf (" -Xjvm-default=all-compatibility" )
93
+ }
94
+
95
+ test {
96
+ systemProperty(" idea.force.use.core.classloader" , " true" )
97
+ }
98
+ }
99
+
100
+ intellijPlatform {
101
+ version = version
102
+ projectName = project.name
103
+
104
+ instrumentCode = false // We don't need to scan codebase for jetbrains annotations
105
+
106
+ // type.set("IU")
107
+
108
+ pluginVerification {
109
+ // These need to match the versions from
110
+ // https://data.services.jetbrains.com/products?fields=code,name,releases.downloads,releases.version,releases.build,releases.type&code=IIC,IIE,GO
111
+ ides {
112
+ ide(IntelliJPlatformType .IntellijIdeaUltimate , project.properties[" IIC.from.version" ] as String )
113
+ ide(IntelliJPlatformType .IntellijIdeaUltimate , product.intellijVersion)
114
+ ide(IntelliJPlatformType .IntellijIdeaCommunity , project.properties[" IIC.from.version" ] as String )
115
+ ide(IntelliJPlatformType .IntellijIdeaCommunity , product.intellijVersion)
116
+ ide(IntelliJPlatformType .GoLand , project.properties[" GO.from.version" ] as String )
117
+ ide(IntelliJPlatformType .GoLand , product.golandVersion)
118
+ recommended()
119
+ }
101
120
}
121
+ }
102
122
123
+ tasks {
103
124
patchPluginXml {
104
- sinceBuild.set(project.properties[" IIC.from.version " ] as String )
125
+ sinceBuild.set(project.properties[" IIC.from.build " ] as String )
105
126
val versionSuffix = when (product.releaseType) {
106
127
" release" -> " "
107
128
else -> " -${product.releaseType} "
108
129
}
109
- version.set(" ${System .getenv(" IJ_PLUGIN_VERSION" )}${versionSuffix} " ) // IJ_PLUGIN_VERSION env var available in CI
110
- }
111
-
112
- runPluginVerifier {
113
- // These need to match the versions from
114
- // https://data.services.jetbrains.com/products?fields=code,name,releases.downloads,releases.version,releases.build,releases.type&code=IIC,IIE,GO
115
- ideVersions.set(
116
- listOf (
117
- " IIC-${project.properties[" IIC.from.version" ] as String } " ,
118
- " GO-${project.properties[" GO.from.version" ] as String } " ,
119
- " IIC-${product.intellijVersion} " ,
120
- " GO-${product.golandVersion} "
121
- )
122
- )
123
- failureLevel.set(
124
- EnumSet .complementOf(
125
- EnumSet .of(
126
- // skipping missing dependencies as com.intellij.java provided by IJ raises a false warning
127
- RunPluginVerifierTask .FailureLevel .MISSING_DEPENDENCIES ,
128
- // skipping experimental API usage, as delaying Gradle execution relies on experimental GradleExecutionAware.
129
- // if the API changes, we should be able to detect that in our tests when a new version comes out.
130
- RunPluginVerifierTask .FailureLevel .EXPERIMENTAL_API_USAGES ,
131
- // we do not fail on deprecated API usages, as we want to support older versions where the API has
132
- // not been deprecate yet, and the newer API not available
133
- RunPluginVerifierTask .FailureLevel .DEPRECATED_API_USAGES ,
134
- // TODO: fix these
135
- RunPluginVerifierTask .FailureLevel .SCHEDULED_FOR_REMOVAL_API_USAGES ,
136
- )
137
- )
138
- )
130
+ version = " ${System .getenv(" IJ_PLUGIN_VERSION" )}${versionSuffix} " // IJ_PLUGIN_VERSION env var available in CI
139
131
}
140
132
141
133
publishPlugin {
142
134
token.set(System .getenv(" JETBRAINS_TOKEN" )) // JETBRAINS_TOKEN env var available in CI
143
135
}
144
-
145
- // See https://youtrack.jetbrains.com/issue/KTIJ-782
146
- buildSearchableOptions {
147
- enabled = false
148
- }
149
- }
150
-
151
- // endregion
136
+ }
0 commit comments