-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate IntelliJ Platform Gradle Plugin to 2.x (#76)
* Migrate IntelliJ Platform Gradle Plugin to 2.x * Update version to denote breaking changes * Update sourceCompability * Explicitly set Java and Kotlin target version * Update CI Java version to 21 * Add test dependency and fix JUnit 5/4 issue
- Loading branch information
Showing
4 changed files
with
55 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,82 @@ | ||
import org.jetbrains.intellij.platform.gradle.TestFrameworkType | ||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
plugins { | ||
id("org.jetbrains.kotlin.jvm") version "2.0.0" | ||
id("org.jetbrains.intellij") version "1.17.4" | ||
id("org.jetbrains.kotlin.jvm") version "2.0.20" | ||
id("org.jetbrains.intellij.platform") version "2.0.1" | ||
} | ||
|
||
group = "com.mituuz" | ||
version = "0.26.2" | ||
// Use same version and group for the jar and the plugin | ||
val currentVersion = "1.0.0" | ||
val myGroup = "com.mituuz" | ||
version = currentVersion | ||
group = myGroup | ||
|
||
repositories { | ||
mavenCentral() | ||
|
||
intellijPlatform { | ||
defaultRepositories() | ||
} | ||
} | ||
|
||
dependencies { | ||
intellijPlatform { | ||
intellijIdeaCommunity("2024.2.0.1") | ||
|
||
pluginVerifier() | ||
zipSigner() | ||
instrumentationTools() | ||
|
||
testFramework(TestFrameworkType.Platform) | ||
} | ||
|
||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.2") | ||
testImplementation("org.mockito:mockito-core:5.12.0") | ||
|
||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.10.2") | ||
|
||
// Required to fix issue where JUnit5 Test Framework refers to JUnit4 | ||
// https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-faq.html#junit5-test-framework-refers-to-junit4 | ||
testRuntimeOnly("junit:junit:4.13.2") | ||
} | ||
|
||
tasks.test { | ||
useJUnitPlatform() | ||
} | ||
|
||
// Configure Gradle IntelliJ Plugin | ||
// Read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html | ||
intellij { | ||
version.set("2024.1") | ||
plugins.set(listOf(/* Plugin Dependencies */)) | ||
tasks.withType<KotlinCompile> { | ||
compilerOptions.jvmTarget.set(JvmTarget.JVM_21) | ||
} | ||
|
||
tasks { | ||
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> { | ||
compilerOptions.jvmTarget.set(JvmTarget.JVM_17) | ||
} | ||
java { | ||
sourceCompatibility = JavaVersion.VERSION_21 | ||
} | ||
|
||
patchPluginXml { | ||
sinceBuild.set("241") | ||
untilBuild.set("242.*") | ||
intellijPlatform { | ||
pluginConfiguration { | ||
version = currentVersion | ||
group = myGroup | ||
|
||
changeNotes = """ | ||
<h2>Version $currentVersion</h2> | ||
- Re-implement project file handling as a backup if no modules are present<br> | ||
- Migrate IntelliJ Platform Gradle Plugin to 2.x | ||
""".trimIndent() | ||
|
||
ideaVersion { | ||
sinceBuild = "242" | ||
} | ||
} | ||
|
||
signPlugin { | ||
|
||
publishing { | ||
token.set(System.getenv("PUBLISH_TOKEN")) | ||
} | ||
|
||
signing { | ||
certificateChain.set(System.getenv("CERTIFICATE_CHAIN")) | ||
privateKey.set(System.getenv("PRIVATE_KEY")) | ||
password.set(System.getenv("PRIVATE_KEY_PASSWORD")) | ||
} | ||
|
||
publishPlugin { | ||
token.set(System.getenv("PUBLISH_TOKEN")) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters