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