11import com.hierynomus.gradle.license.tasks.LicenseCheck
22import com.hierynomus.gradle.license.tasks.LicenseFormat
3+ import org.jetbrains.intellij.platform.gradle.TestFrameworkType
34
45plugins {
5- id " org.jetbrains.intellij" version " 1.17.4 "
6+ id " org.jetbrains.intellij.platform " version " 2.0.1 "
67 id " com.github.hierynomus.license" version " 0.16.1"
78 id " de.undercouch.download" version " 5.6.0"
89}
@@ -13,7 +14,7 @@ version pluginVersion
1314
1415apply plugin : ' idea'
1516apply plugin : ' java'
16- apply plugin : ' org.jetbrains.intellij'
17+ apply plugin : ' org.jetbrains.intellij.platform '
1718apply plugin : ' license'
1819apply plugin : ' checkstyle'
1920apply plugin : ' jacoco'
@@ -26,19 +27,20 @@ java {
2627repositories {
2728 mavenLocal()
2829 mavenCentral()
30+ intellijPlatform {
31+ defaultRepositories()
32+ }
2933}
3034
31- intellij {
32- version = System . getenv(). getOrDefault(' IDEA_VERSION' , ideaVersion)
33- type = ideaType
34- downloadSources = Boolean . valueOf(sources)
35- sameSinceUntilBuild = Boolean . valueOf(isEAP)
35+ intellijPlatform {
3636 instrumentCode = false
37- updateSinceUntilBuild = false
38- pluginName = ' MapStruct-Intellij-Plugin'
39- // The properties plugin is needed because Kotlin uses it
40- // and for some reason plugins does not transitively pull itx
41- plugins = [' java' , ' Kotlin' , ' properties' ]
37+ projectName = ' MapStruct-Intellij-Plugin'
38+ pluginConfiguration {
39+ ideaVersion {
40+ sinceBuild = " 223"
41+ untilBuild = provider { null } as Provider<? extends String >
42+ }
43+ }
4244}
4345
4446// Simple function to load change-notes.html and description.html into valid text for plugin.xml
@@ -89,22 +91,37 @@ jacocoTestReport {
8991 }
9092}
9193
94+ def versionToUse = System . getenv(). getOrDefault( ' IDEA_VERSION' , ideaVersion )
95+ def useInstaller = ! versionToUse. containsIgnoreCase( " EAP" )
9296dependencies {
97+ intellijPlatform {
98+ ideaType == ' IC' ? intellijIdeaCommunity(versionToUse, useInstaller) : intellijIdeaUltimate(versionToUse, useInstaller)
99+
100+ jetbrainsRuntime()
101+
102+ bundledPlugin( ' com.intellij.java' )
103+ bundledPlugin( ' org.jetbrains.kotlin' )
104+
105+ testFramework( TestFrameworkType.Platform . INSTANCE )
106+ testFramework( TestFrameworkType.Bundled . INSTANCE )
107+ }
93108 implementation(' org.mapstruct:mapstruct:1.5.3.Final' )
94- testImplementation(platform(' org.junit:junit-bom:5.8.2 ' ))
109+ testImplementation(platform(' org.junit:junit-bom:5.11.0 ' ))
95110 testImplementation(' org.junit.platform:junit-platform-launcher' )
96111 testImplementation(' org.junit.jupiter:junit-jupiter-api' )
97112 testImplementation(' org.junit.jupiter:junit-jupiter-engine' )
98113 testRuntimeOnly(' org.junit.vintage:junit-vintage-engine' )
99- testImplementation(' org.assertj:assertj-core:3.11.1' )
100- testImplementation(' org.apache.commons:commons-text:1.10.0' )
114+ testImplementation(' org.assertj:assertj-core:3.26.3' )
115+ testImplementation(' org.apache.commons:commons-text:1.12.0' )
116+ testImplementation( ' junit:junit:4.13.2' )
101117}
102118
103119task libs (type : Sync ) {
104120 from configurations. runtimeClasspath
105121 into layout. buildDirectory. dir(" libs" )
106122 preserve {
107123 include ' mapstruct-intellij-*.jar'
124+ include ' MapStruct-Intellij-*.jar'
108125 }
109126 rename ' mapstruct-1.5.3.Final.jar' , ' mapstruct.jar'
110127}
@@ -149,8 +166,8 @@ task downloadMockJdk11() {
149166}
150167
151168test. dependsOn( libs, downloadMockJdk7, downloadMockJdk8, downloadMockJdk11 )
152- prepareTestingSandbox. dependsOn( libs )
153169prepareSandbox. dependsOn( libs )
170+ composedJar. dependsOn( libs )
154171
155172test {
156173 // Idea SDK needs special configuration
0 commit comments