14
14
* limitations under the License.
15
15
*/
16
16
17
- import de.undercouch.gradle.tasks.download.*
17
+ import de.undercouch.gradle.tasks.download.Download
18
18
import org.apache.tools.ant.taskdefs.condition.Os
19
+ import org.jetbrains.intellij.platform.gradle.TestFrameworkType
20
+ import org.jetbrains.intellij.platform.gradle.tasks.PrepareSandboxTask
19
21
import java.io.ByteArrayOutputStream
20
22
23
+ fun properties (key : String ) = providers.gradleProperty(key)
24
+
21
25
plugins {
22
- id(" org.jetbrains.intellij" ). version( " 1.13.3 " )
23
- id(" org.jetbrains.kotlin.jvm" ). version( " 1.8 .21" )
26
+ id(" org.jetbrains.intellij.platform " ) version " 2.0.1 "
27
+ id(" org.jetbrains.kotlin.jvm" ) version " 2.0 .21"
24
28
id(" de.undercouch.download" ).version(" 5.3.0" )
25
29
}
26
30
@@ -42,7 +46,7 @@ data class BuildData(
42
46
val buildDataList = listOf (
43
47
BuildData (
44
48
ideaSDKShortVersion = " 243" ,
45
- ideaSDKVersion = " 243-EAP-SNAPSHOT " ,
49
+ ideaSDKVersion = " 2024.3 " ,
46
50
sinceBuild = " 232" ,
47
51
untilBuild = " 243.*" ,
48
52
bunch = " 212" ,
@@ -146,9 +150,15 @@ task("installEmmyDebugger", type = Copy::class) {
146
150
}
147
151
148
152
project(" :" ) {
153
+ apply (plugin = " org.jetbrains.intellij.platform" )
154
+
149
155
repositories {
150
- maven(url = " https://www.jetbrains.com/intellij-repository/releases" )
151
156
mavenCentral()
157
+ intellijPlatform {
158
+ defaultRepositories()
159
+ jetbrainsRuntime()
160
+ nightly()
161
+ }
152
162
}
153
163
154
164
dependencies {
@@ -158,6 +168,18 @@ project(":") {
158
168
implementation(" org.luaj:luaj-jse:3.0.1" )
159
169
implementation(" org.eclipse.mylyn.github:org.eclipse.egit.github.core:2.1.5" )
160
170
implementation(" com.jgoodies:forms:1.2.1" )
171
+
172
+ intellijPlatform {
173
+ create(" IC" , buildVersionData.ideaSDKVersion, useInstaller = properties(" useInstaller" ).get().toBoolean())
174
+ instrumentationTools()
175
+ jetbrainsRuntime()
176
+
177
+ // some code used in tests was moved to the java plugin and not available in the platform
178
+ bundledPlugins(" com.intellij.java" )
179
+ testFramework(TestFrameworkType .Plugin .Java )
180
+ }
181
+ testImplementation(" junit:junit:4.13.2" )
182
+ testImplementation(" org.opentest4j:opentest4j:1.3.0" )
161
183
}
162
184
163
185
sourceSets {
@@ -168,20 +190,6 @@ project(":") {
168
190
}
169
191
}
170
192
171
- /* configure<JavaPluginConvention> {
172
- sourceCompatibility = buildVersionData.targetCompatibilityLevel
173
- targetCompatibility = buildVersionData.targetCompatibilityLevel
174
- }*/
175
-
176
- intellij {
177
- type.set(" IC" )
178
- updateSinceUntilBuild.set(false )
179
- downloadSources.set(! isCI)
180
- version.set(buildVersionData.ideaSDKVersion)
181
- // localPath.set(System.getenv("IDEA_HOME_${buildVersionData.ideaSDKShortVersion}"))
182
- sandboxDir.set(" ${project.buildDir} /${buildVersionData.ideaSDKShortVersion} /idea-sandbox" )
183
- }
184
-
185
193
task(" bunch" ) {
186
194
doLast {
187
195
val rev = getRev()
@@ -228,25 +236,18 @@ project(":") {
228
236
untilBuild.set(buildVersionData.untilBuild)
229
237
}
230
238
231
- instrumentCode {
232
- compilerVersion.set(buildVersionData.instrumentCodeCompilerVersion)
233
- }
234
-
235
239
publishPlugin {
236
240
token.set(System .getenv(" IDEA_PUBLISH_TOKEN" ))
237
241
}
238
242
239
- withType< org.jetbrains.intellij.tasks.PrepareSandboxTask > {
240
- doLast {
241
- copy {
242
- from(" src/main/resources/std" )
243
- into(" $destinationDir /${pluginName.get()} /std" )
244
- }
245
- copy {
246
- from(" src/main/resources/debugger" )
247
- into(" $destinationDir /${pluginName.get()} /debugger" )
248
- }
249
- }
243
+ withType<PrepareSandboxTask > {
244
+ inputs.dir(" src/main/resources/std" )
245
+ inputs.dir(" src/main/resources/debugger" )
246
+
247
+ intoChild(intellijPlatform.projectName.map { projectName -> " $projectName /std" })
248
+ .from(file(" src/main/resources/std" ))
249
+ intoChild(intellijPlatform.projectName.map { projectName -> " $projectName /debugger" })
250
+ .from(file(" src/main/resources/debugger" ))
250
251
}
251
252
}
252
- }
253
+ }
0 commit comments