1414 * limitations under the License.
1515 */
1616
17- import de.undercouch.gradle.tasks.download.*
17+ import de.undercouch.gradle.tasks.download.Download
1818import org.apache.tools.ant.taskdefs.condition.Os
19+ import org.jetbrains.intellij.platform.gradle.TestFrameworkType
20+ import org.jetbrains.intellij.platform.gradle.tasks.PrepareSandboxTask
1921import java.io.ByteArrayOutputStream
2022
23+ fun properties (key : String ) = providers.gradleProperty(key)
24+
2125plugins {
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"
2428 id(" de.undercouch.download" ).version(" 5.3.0" )
2529}
2630
@@ -42,7 +46,7 @@ data class BuildData(
4246val buildDataList = listOf (
4347 BuildData (
4448 ideaSDKShortVersion = " 243" ,
45- ideaSDKVersion = " 243.21565.193 " ,
49+ ideaSDKVersion = " 2024.3 " ,
4650 sinceBuild = " 243" ,
4751 untilBuild = " 243.*" ,
4852 bunch = " 212" ,
@@ -146,9 +150,15 @@ task("installEmmyDebugger", type = Copy::class) {
146150}
147151
148152project(" :" ) {
153+ apply (plugin = " org.jetbrains.intellij.platform" )
154+
149155 repositories {
150- maven(url = " https://www.jetbrains.com/intellij-repository/releases" )
151156 mavenCentral()
157+ intellijPlatform {
158+ defaultRepositories()
159+ jetbrainsRuntime()
160+ nightly()
161+ }
152162 }
153163
154164 dependencies {
@@ -158,6 +168,18 @@ project(":") {
158168 implementation(" org.luaj:luaj-jse:3.0.1" )
159169 implementation(" org.eclipse.mylyn.github:org.eclipse.egit.github.core:2.1.5" )
160170 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" )
161183 }
162184
163185 sourceSets {
@@ -168,20 +190,6 @@ project(":") {
168190 }
169191 }
170192
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-
185193 task(" bunch" ) {
186194 doLast {
187195 val rev = getRev()
@@ -228,25 +236,18 @@ project(":") {
228236 untilBuild.set(buildVersionData.untilBuild)
229237 }
230238
231- instrumentCode {
232- compilerVersion.set(buildVersionData.instrumentCodeCompilerVersion)
233- }
234-
235239 publishPlugin {
236240 token.set(System .getenv(" IDEA_PUBLISH_TOKEN" ))
237241 }
238242
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" ))
250251 }
251252 }
252- }
253+ }
0 commit comments