diff --git a/.github/workflows/runUiOctopusTests.yml b/.github/workflows/runUiOctopusTests.yml
index 65314d0fc3..65576aef1e 100644
--- a/.github/workflows/runUiOctopusTests.yml
+++ b/.github/workflows/runUiOctopusTests.yml
@@ -23,7 +23,7 @@ jobs:
- name: Run Idea
run: |
mkdir -p build/reports
- gradle runIdeForUiTests -Doctopus.handler=false > build/reports/idea.log &
+ gradle testIdeUi -Doctopus.handler=false > build/reports/idea.log &
- name: Wait for Idea started
uses: jtalk/url-health-check-action@v3
with:
@@ -63,7 +63,7 @@ jobs:
# export DISPLAY=:99.0
# Xvfb -ac :99 -screen 0 1920x1080x16 &
# mkdir -p build/reports
-# gradle :runIdeForUiTests #> build/reports/idea.log
+# gradle :testIdeUi #> build/reports/idea.log
# - name: Wait for Idea started
# uses: jtalk/url-health-check-action@1.5
# with:
@@ -78,4 +78,4 @@ jobs:
# with:
# name: ui-test-fails-report-linux
# path: |
-# ui-test-example/build/reports
\ No newline at end of file
+# ui-test-example/build/reports
diff --git a/.github/workflows/runUiPyTests.yml b/.github/workflows/runUiPyTests.yml
index e67bd9fd3b..2ac8377796 100644
--- a/.github/workflows/runUiPyTests.yml
+++ b/.github/workflows/runUiPyTests.yml
@@ -26,7 +26,7 @@ jobs:
- name: Run Idea
run: |
mkdir -p build/reports
- gradle :runIdeForUiTests -PideaType=PC > build/reports/idea.log &
+ gradle :testIdeUi -PideaType=PC > build/reports/idea.log &
- name: Wait for Idea started
uses: jtalk/url-health-check-action@v3
with:
@@ -49,4 +49,4 @@ jobs:
path: |
build/reports
tests/ui-py-tests/build/reports
- sandbox-idea-log
\ No newline at end of file
+ sandbox-idea-log
diff --git a/.github/workflows/runUiTests.yml b/.github/workflows/runUiTests.yml
index 26f5f10239..9df972b86d 100644
--- a/.github/workflows/runUiTests.yml
+++ b/.github/workflows/runUiTests.yml
@@ -23,7 +23,7 @@ jobs:
- name: Run Idea
run: |
mkdir -p build/reports
- gradle runIdeForUiTests > build/reports/idea.log &
+ gradle testIdeUi > build/reports/idea.log &
- name: Wait for Idea started
uses: jtalk/url-health-check-action@v3
with:
@@ -63,7 +63,7 @@ jobs:
# export DISPLAY=:99.0
# Xvfb -ac :99 -screen 0 1920x1080x16 &
# mkdir -p build/reports
-# gradle :runIdeForUiTests #> build/reports/idea.log
+# gradle :testIdeUi #> build/reports/idea.log
# - name: Wait for Idea started
# uses: jtalk/url-health-check-action@1.5
# with:
@@ -78,4 +78,4 @@ jobs:
# with:
# name: ui-test-fails-report-linux
# path: |
-# ui-test-example/build/reports
\ No newline at end of file
+# ui-test-example/build/reports
diff --git a/.gitignore b/.gitignore
index 718231d9bf..d0a300559a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
*.swp
/.gradle/
+/.intellijPlatform/
/.idea/
!/.idea/scopes
diff --git a/.idea/runConfigurations/IdeaVim_full_verification.xml b/.idea/runConfigurations/IdeaVim_full_verification.xml
index d6b1b41af2..9b6ac4c11e 100644
--- a/.idea/runConfigurations/IdeaVim_full_verification.xml
+++ b/.idea/runConfigurations/IdeaVim_full_verification.xml
@@ -12,7 +12,7 @@
@@ -20,6 +20,7 @@
truetruefalse
+ false
\ No newline at end of file
diff --git a/.idea/runConfigurations/Start_IJ_with_IdeaVim__Split_Mode_.xml b/.idea/runConfigurations/Start_IJ_with_IdeaVim__Split_Mode_.xml
new file mode 100644
index 0000000000..84eaea7f5a
--- /dev/null
+++ b/.idea/runConfigurations/Start_IJ_with_IdeaVim__Split_Mode_.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ true
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/.teamcity/_Self/buildTypes/PluginVerifier.kt b/.teamcity/_Self/buildTypes/PluginVerifier.kt
index f25fa97c73..9d607db162 100644
--- a/.teamcity/_Self/buildTypes/PluginVerifier.kt
+++ b/.teamcity/_Self/buildTypes/PluginVerifier.kt
@@ -22,7 +22,7 @@ object PluginVerifier : IdeaVimBuildType({
steps {
gradle {
- tasks = "clean runPluginVerifier"
+ tasks = "clean verifyPlugin"
buildFile = ""
enableStacktrace = true
}
diff --git a/build.gradle.kts b/build.gradle.kts
index a6fc3bc475..09c271df7e 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -32,6 +32,9 @@ import org.eclipse.jgit.api.Git
import org.eclipse.jgit.lib.RepositoryBuilder
import org.intellij.markdown.ast.getTextInNode
import org.jetbrains.changelog.Changelog
+import org.jetbrains.intellij.platform.gradle.TestFrameworkType
+import org.jetbrains.intellij.platform.gradle.tasks.CustomRunIdeTask
+import org.jetbrains.intellij.platform.gradle.tasks.aware.SplitModeAware
import org.kohsuke.github.GHUser
import java.net.HttpURLConnection
import java.net.URL
@@ -67,38 +70,23 @@ plugins {
kotlin("jvm") version "1.9.22"
application
id("java-test-fixtures")
-
- id("org.jetbrains.intellij") version "1.17.4"
+ id("org.jetbrains.intellij.platform") version "2.0.0-beta7"
id("org.jetbrains.changelog") version "2.2.0"
-
id("org.jetbrains.kotlinx.kover") version "0.6.1"
id("com.dorongold.task-tree") version "4.0.0"
-
id("com.google.devtools.ksp") version "1.9.22-1.0.17"
}
-ksp {
- arg("generated_directory", "$projectDir/src/main/resources/ksp-generated")
- arg("vimscript_functions_file", "intellij_vimscript_functions.json")
- arg("ex_commands_file", "intellij_ex_commands.json")
- arg("commands_file", "intellij_commands.json")
-}
-
-afterEvaluate {
-// tasks.named("kspKotlin").configure { dependsOn("clean") }
- tasks.named("kspTestFixturesKotlin").configure { enabled = false }
- tasks.named("kspTestFixturesKotlin").configure { enabled = false }
- tasks.named("kspTestKotlin").configure { enabled = false }
-}
+val moduleSources by configurations.registering
// Import variables from gradle.properties file
val javaVersion: String by project
val kotlinVersion: String by project
val ideaVersion: String by project
val ideaType: String by project
-val downloadIdeaSources: String by project
val instrumentPluginCode: String by project
val remoteRobotVersion: String by project
+val splitModeVersion: String by project
val publishChannels: String by project
val publishToken: String by project
@@ -108,7 +96,9 @@ val youtrackToken: String by project
repositories {
mavenCentral()
- maven { url = uri("https://cache-redirector.jetbrains.com/intellij-dependencies") }
+ intellijPlatform {
+ defaultRepositories()
+ }
}
dependencies {
@@ -119,9 +109,26 @@ dependencies {
compileOnly("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
compileOnly("org.jetbrains:annotations:24.1.0")
- // --------- Test dependencies ----------
+ intellijPlatform {
+ // Note that it is also possible to use local("...") to compile against a locally installed IDE
+ // E.g. local("/Users/{user}/Applications/IntelliJ IDEA Ultimate.app")
+ // Or something like: intellijIdeaUltimate(ideaVersion)
+ create(ideaType, ideaVersion)
+
+ pluginVerifier()
+ zipSigner()
+ instrumentationTools()
+
+ testFramework(TestFrameworkType.Platform)
+ testFramework(TestFrameworkType.JUnit5)
+
+ // AceJump is an optional dependency. We use their SessionManager class to check if it's active
+ plugin("AceJump", "3.8.11")
+ }
+
+ moduleSources(project(":vim-engine", "sourcesJarArtifacts"))
- testImplementation(testFixtures(project(":")))
+ // --------- Test dependencies ----------
testApi("com.squareup.okhttp3:okhttp:4.12.0")
@@ -154,6 +161,8 @@ configurations {
tasks {
test {
+ useJUnitPlatform()
+
// Set teamcity env variable locally to run additional tests for leaks.
// By default, this test runs on TC only, but this test doesn't take a lot of time,
// so we can turn it on for local development
@@ -166,6 +175,9 @@ tasks {
}
compileJava {
+ // CodeQL can't resolve the 'by project' property, so we need to give it a hint. This is the minimum version we need
+ // so doesn't have to match exactly
+ // Hint for the CodeQL autobuilder: sourceCompatibility = 17
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
@@ -191,21 +203,62 @@ tasks {
}
}
- downloadRobotServerPlugin {
- version.set(remoteRobotVersion)
+ // Note that this will run the plugin installed in the IDE specified in dependencies. To run in a different IDE, use
+ // a custom task (see below)
+ runIde {
+ systemProperty("octopus.handler", System.getProperty("octopus.handler") ?: true)
}
- runIdeForUiTests {
+ // Uncomment to run the plugin in a custom IDE, rather than the IDE specified as a compile target in dependencies
+ // Note that the version must be greater than the plugin's target version, for obvious reasons
+// val runIdeCustom by registering(CustomRunIdeTask::class) {
+// type = IntelliJPlatformType.Rider
+// version = "2024.1.2"
+// }
+
+ // Uncomment to run the plugin in a locally installed IDE
+// val runIdeLocal by registering(CustomRunIdeTask::class) {
+// localPath = file("/Users/{user}/Applications/WebStorm.app")
+// }
+
+ val runIdeSplitMode by registering(CustomRunIdeTask::class) {
+ splitMode = true
+ splitModeTarget = SplitModeAware.SplitModeTarget.FRONTEND
+
+ // Frontend split mode support requires 242+
+ // TODO: Remove this once IdeaVim targets 242, as the task will naturally use the target version to run
+ version.set(splitModeVersion)
+ }
+
+ // Start the default IDE with both IdeaVim and the robot server plugin installed, ready to run a UI test task. The
+ // robot server plugin is automatically added as a dependency to this task, and Gradle will take care of downloading.
+ // Note that the CustomTestIdeUiTask can be used to run tests against a different IDE
+ testIdeUi {
systemProperty("robot-server.port", "8082")
systemProperty("ide.mac.message.dialogs.as.sheets", "false")
systemProperty("jb.privacy.policy.text", "")
systemProperty("jb.consents.confirmation.enabled", "false")
systemProperty("ide.show.tips.on.startup.default.value", "false")
+
systemProperty("octopus.handler", System.getProperty("octopus.handler") ?: true)
}
- runIde {
- systemProperty("octopus.handler", System.getProperty("octopus.handler") ?: true)
+ // Add plugin open API sources to the plugin ZIP
+ val sourcesJar by registering(Jar::class) {
+ dependsOn(moduleSources)
+ destinationDirectory.set(layout.buildDirectory.dir("libs"))
+ archiveClassifier.set(DocsType.SOURCES)
+ from(sourceSets.main.map { it.kotlin })
+ from(provider {
+ moduleSources.map {
+ it.map { jarFile -> zipTree(jarFile) }
+ }
+ })
+ }
+
+ buildPlugin {
+ dependsOn(sourcesJar)
+ from(sourcesJar) { into("lib/src") }
}
}
@@ -231,79 +284,61 @@ gradle.projectsEvaluated {
// --- Intellij plugin
-intellij {
- version.set(ideaVersion)
- type.set(ideaType)
- pluginName.set("IdeaVim")
-
- updateSinceUntilBuild.set(false)
+intellijPlatform {
+ pluginConfiguration {
+ name = "IdeaVim"
+ changeNotes.set(
+ """Changelog"""
+ )
- downloadSources.set(downloadIdeaSources.toBoolean())
- instrumentCode.set(instrumentPluginCode.toBoolean())
- intellijRepository.set("https://www.jetbrains.com/intellij-repository")
- plugins.set(listOf("AceJump:3.8.11"))
-}
+ ideaVersion {
+ // Let the Gradle plugin set the since-build version. It defaults to the version of the IDE we're building against
+ // specified as two components, `{branch}.{build}` (e.g., "241.15989"). There is no third component specified.
+ // The until-build version defaults to `{branch}.*`, but we want to support _all_ future versions, so we set it
+ // with a null provider (the provider is important).
+ // By letting the Gradle plugin handle this, the Plugin DevKit IntelliJ plugin cannot help us with the "Usage of
+ // IntelliJ API not available in older IDEs" inspection. However, since our since-build is the version we compile
+ // against, we can never get an API that's newer - it would be an unresolved symbol.
+ untilBuild.set(provider { null })
+ }
+ }
-tasks {
- publishPlugin {
+ publishing {
channels.set(publishChannels.split(","))
token.set(publishToken)
}
- signPlugin {
+ signing {
certificateChain.set(providers.environmentVariable("CERTIFICATE_CHAIN"))
privateKey.set(providers.environmentVariable("PRIVATE_KEY"))
password.set(providers.environmentVariable("PRIVATE_KEY_PASSWORD"))
}
- runPluginVerifier {
- downloadDir.set("${project.buildDir}/pluginVerifier/ides")
- teamCityOutputFormat.set(true)
- }
-
- // Add plugin open API sources to the plugin ZIP
- val createOpenApiSourceJar by registering(Jar::class) {
- // Java sources
- from(sourceSets.main.get().java) {
- include("**/com/maddyhome/idea/vim/**/*.java")
- }
- from(project(":vim-engine").sourceSets.main.get().java) {
- include("**/com/maddyhome/idea/vim/**/*.java")
- }
- // Kotlin sources
- from(kotlin.sourceSets.main.get().kotlin) {
- include("**/com/maddyhome/idea/vim/**/*.kt")
+ verifyPlugin {
+ teamCityOutputFormat = true
+ ides {
+ recommended()
}
- from(project(":vim-engine").kotlin.sourceSets.main.get().kotlin) {
- include("**/com/maddyhome/idea/vim/**/*.kt")
- }
- destinationDirectory.set(layout.buildDirectory.dir("libs"))
- archiveClassifier.set("src")
}
- buildPlugin {
- dependsOn(createOpenApiSourceJar)
- from(createOpenApiSourceJar) { into("lib/src") }
- }
-
- patchPluginXml {
- // Don't forget to update plugin.xml
- sinceBuild.set("241.15989.150")
-
- changeNotes.set(
- """Changelog"""
- )
- }
+ instrumentCode.set(instrumentPluginCode.toBoolean())
}
-// --- Tests
+ksp {
+ arg("generated_directory", "$projectDir/src/main/resources/ksp-generated")
+ arg("vimscript_functions_file", "intellij_vimscript_functions.json")
+ arg("ex_commands_file", "intellij_ex_commands.json")
+ arg("commands_file", "intellij_commands.json")
+}
-tasks {
- test {
- useJUnitPlatform()
- }
+afterEvaluate {
+// tasks.named("kspKotlin").configure { dependsOn("clean") }
+ tasks.named("kspTestFixturesKotlin").configure { enabled = false }
+ tasks.named("kspTestFixturesKotlin").configure { enabled = false }
+ tasks.named("kspTestKotlin").configure { enabled = false }
}
+
// --- Changelog
changelog {
@@ -888,12 +923,12 @@ fun changes(): List {
println("Start changes processing")
for (message in messages) {
println("Processing '$message'...")
- val lowercaseMessage = message.toLowerCase()
+ val lowercaseMessage = message.lowercase()
val regex = "^fix\\((vim-\\d+)\\):".toRegex()
val findResult = regex.find(lowercaseMessage)
if (findResult != null) {
println("Message matches")
- val value = findResult.groups[1]!!.value.toUpperCase()
+ val value = findResult.groups[1]!!.value.uppercase()
val shortMessage = message.drop(findResult.range.last + 1).trim()
newFixes += Change(value, shortMessage)
} else {
diff --git a/gradle.properties b/gradle.properties
index 9b769d7716..e25ca45adf 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -8,17 +8,32 @@
# suppress inspection "UnusedProperty" for whole file
+# ideaVersion is the version of the IDE that we'll add as a dependency. The format of the version string depends on the
+# value of the `org.jetbrains.intellij.platform.buildFeature.useBinaryReleases` property/build feature.
+# If enabled (default) then the IDE will be a normal, packaged release, which you could install and run like a retail
+# version of the IDE, downloaded from CDN. The `ideaVersion` property should be a marketing version such as `2024.1` or
+# `2024.1.1` (note no trailing `0`). You can find an example list of all versions for IDEA Community here:
+# https://data.services.jetbrains.com/products?code=IC
+# If the build feature is disabled, the IDE will be downloaded from Maven, and should match the format published in
+# Maven, such as `2024.1` (again, no trailing `.0`), `2024.1.1`, `241-EAP-SNAPSHOT`, etc.
+# You can see a list of release versions here: https://www.jetbrains.com/intellij-repository/releases
+# And a list of snapshot versions here: https://www.jetbrains.com/intellij-repository/snapshots
#ideaVersion=LATEST-EAP-SNAPSHOT
ideaVersion=2024.1.1
# Values for type: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#intellij-extension-type
ideaType=IC
-downloadIdeaSources=true
instrumentPluginCode=true
version=SNAPSHOT
javaVersion=17
remoteRobotVersion=0.11.22
antlrVersion=4.10.1
+# [VERSION UPDATE] 2024.2 - remove when IdeaVim targets 2024.2
+# Running IdeaVim in split mode requires 242. Update this version once 242 has been released, and remove it completely
+# when IdeaVim targets 242, at which point runIdeSplitMode will run correctly with the target version.
+# See also runIdeSplitMode
+splitModeVersion=242-EAP-SNAPSHOT
+
# Please don't forget to update kotlin version in buildscript section
# Also update kotlinxSerializationVersion version
@@ -40,4 +55,12 @@ org.gradle.jvmargs='-Dfile.encoding=UTF-8'
kotlin.stdlib.default.dependency=false
# Disable incremental annotation processing
-ksp.incremental=false
\ No newline at end of file
+ksp.incremental=false
+
+# Build features
+# Temporarily disable downloading the IDE dependency from CDN, and use Maven The Plugin DevKit plugin is currently
+# unable to download sources when the IDE is packaged as a normal binary release. This only affects developers working
+# with and debugging IdeaVim. Once the fixed version of DevKit is available, IdeaVim developers can update and this flag
+# can be removed.
+# DevKit will be fixed in IDEA 2024.1.4 and a future EAP of 2024.2
+org.jetbrains.intellij.platform.buildFeature.useBinaryReleases=false
diff --git a/settings.gradle b/settings.gradle
deleted file mode 100644
index fbf6fa59db..0000000000
--- a/settings.gradle
+++ /dev/null
@@ -1,20 +0,0 @@
-// Set repository for snapshot versions of gradle plugin
-pluginManagement {
- repositories {
- maven {
- url 'https://oss.sonatype.org/content/repositories/snapshots/'
- }
- gradlePluginPortal()
- }
-}
-
-rootProject.name = 'IdeaVIM'
-include 'vim-engine'
-include 'scripts'
-include 'annotation-processors'
-include 'tests:java-tests'
-include 'tests:property-tests'
-include 'tests:long-running-tests'
-include 'tests:ui-ij-tests'
-include 'tests:ui-py-tests'
-include 'tests:ui-fixtures'
diff --git a/settings.gradle.kts b/settings.gradle.kts
new file mode 100644
index 0000000000..4c61764636
--- /dev/null
+++ b/settings.gradle.kts
@@ -0,0 +1,21 @@
+// Set repository for snapshot versions of gradle plugin
+pluginManagement {
+ repositories {
+ maven {
+ url = uri("https://oss.sonatype.org/content/repositories/snapshots/")
+ }
+ gradlePluginPortal()
+ }
+}
+
+rootProject.name = "IdeaVIM"
+
+include("vim-engine")
+include("scripts")
+include("annotation-processors")
+include("tests:java-tests")
+include("tests:property-tests")
+include("tests:long-running-tests")
+include("tests:ui-ij-tests")
+include("tests:ui-py-tests")
+include("tests:ui-fixtures")
diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml
index 8ea11b8bdf..813711ef01 100644
--- a/src/main/resources/META-INF/plugin.xml
+++ b/src/main/resources/META-INF/plugin.xml
@@ -24,11 +24,6 @@
SNAPSHOTJetBrains
-
-
-
-
-
com.intellij.modules.platformmessages.IdeaVimBundle
diff --git a/tests/java-tests/build.gradle.kts b/tests/java-tests/build.gradle.kts
index 0e8f29b89e..47287a8327 100644
--- a/tests/java-tests/build.gradle.kts
+++ b/tests/java-tests/build.gradle.kts
@@ -1,3 +1,5 @@
+import org.jetbrains.intellij.platform.gradle.TestFrameworkType
+
/*
* Copyright 2003-2024 The IdeaVim authors
*
@@ -9,16 +11,20 @@
plugins {
id("java")
kotlin("jvm")
- id("org.jetbrains.intellij")
+ id("org.jetbrains.intellij.platform.module")
}
val kotlinVersion: String by project
+val ideaType: String by project
val ideaVersion: String by project
val javaVersion: String by project
repositories {
mavenCentral()
- maven { url = uri("https://cache-redirector.jetbrains.com/intellij-dependencies") }
+
+ intellijPlatform {
+ defaultRepositories()
+ }
}
dependencies {
@@ -26,35 +32,24 @@ dependencies {
compileOnly("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
testImplementation("org.jetbrains.kotlin:kotlin-test:$kotlinVersion")
testImplementation(testFixtures(project(":"))) // The root project
+
+ intellijPlatform {
+ create(ideaType, ideaVersion)
+ testFramework(TestFrameworkType.Platform)
+ testFramework(TestFrameworkType.JUnit5)
+ bundledPlugins("com.intellij.java", "org.jetbrains.plugins.yaml")
+ instrumentationTools()
+ }
+}
+
+intellijPlatform {
+ buildSearchableOptions = false
}
tasks {
test {
useJUnitPlatform()
}
-
- verifyPlugin {
- enabled = false
- }
-
- publishPlugin {
- enabled = false
- }
-
- runIde {
- enabled = false
- }
-
- runPluginVerifier {
- enabled = false
- }
-}
-
-intellij {
- version.set(ideaVersion)
- type.set("IC")
- // Yaml is only used for testing. It's part of the IdeaIC distribution, but needs to be included as a reference
- plugins.set(listOf("java", "yaml"))
}
java {
diff --git a/tests/long-running-tests/build.gradle.kts b/tests/long-running-tests/build.gradle.kts
index a8d726b33a..6b5962fea8 100644
--- a/tests/long-running-tests/build.gradle.kts
+++ b/tests/long-running-tests/build.gradle.kts
@@ -1,15 +1,23 @@
+import org.jetbrains.intellij.platform.gradle.TestFrameworkType
+import org.jetbrains.intellij.platform.gradle.extensions.intellijPlatform
+import org.jetbrains.intellij.platform.gradle.tasks.CustomTestIdeTask
+
plugins {
java
kotlin("jvm")
- id("org.jetbrains.intellij")
+ id("org.jetbrains.intellij.platform.module")
}
repositories {
mavenCentral()
- maven { url = uri("https://cache-redirector.jetbrains.com/intellij-dependencies") }
+
+ intellijPlatform {
+ defaultRepositories()
+ }
}
val kotlinVersion: String by project
+val ideaType: String by project
val ideaVersion: String by project
val javaVersion: String by project
@@ -18,42 +26,32 @@ dependencies {
compileOnly("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
testImplementation("org.jetbrains.kotlin:kotlin-test:$kotlinVersion")
testImplementation(testFixtures(project(":"))) // The root project
+
+ intellijPlatform {
+ create(ideaType, ideaVersion)
+ testFramework(TestFrameworkType.Platform)
+ testFramework(TestFrameworkType.JUnit5)
+ instrumentationTools()
+ }
+}
+
+intellijPlatform {
+ buildSearchableOptions = false
}
tasks {
// This task is disabled because it should be excluded from `gradle test` run (because it's slow)
// I didn't find a better way to exclude except disabling and defining a new task with a different name
+ // Note that useJUnitTestPlatform() is required to prevent red code
test {
enabled = false
useJUnitPlatform()
}
- register("testLongRunning") {
+ register("testLongRunning") {
group = "verification"
useJUnitPlatform()
}
-
- verifyPlugin {
- enabled = false
- }
-
- publishPlugin {
- enabled = false
- }
-
- runIde {
- enabled = false
- }
-
- runPluginVerifier {
- enabled = false
- }
-}
-
-intellij {
- version.set(ideaVersion)
- type.set("IC")
- plugins.set(listOf("java"))
}
java {
diff --git a/tests/property-tests/build.gradle.kts b/tests/property-tests/build.gradle.kts
index 7fcbd7767c..cd4bf458bf 100644
--- a/tests/property-tests/build.gradle.kts
+++ b/tests/property-tests/build.gradle.kts
@@ -1,15 +1,23 @@
+import org.jetbrains.intellij.platform.gradle.TestFrameworkType
+import org.jetbrains.intellij.platform.gradle.extensions.intellijPlatform
+import org.jetbrains.intellij.platform.gradle.tasks.CustomTestIdeTask
+
plugins {
java
kotlin("jvm")
- id("org.jetbrains.intellij")
+ id("org.jetbrains.intellij.platform.module")
}
repositories {
mavenCentral()
- maven { url = uri("https://cache-redirector.jetbrains.com/intellij-dependencies") }
+
+ intellijPlatform {
+ defaultRepositories()
+ }
}
val kotlinVersion: String by project
+val ideaType: String by project
val ideaVersion: String by project
val javaVersion: String by project
@@ -18,6 +26,18 @@ dependencies {
compileOnly("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
testImplementation("org.jetbrains.kotlin:kotlin-test:$kotlinVersion")
testImplementation(testFixtures(project(":"))) // The root project
+
+ intellijPlatform {
+ create(ideaType, ideaVersion)
+ bundledPlugins("com.intellij.java")
+ testFramework(TestFrameworkType.Platform)
+ testFramework(TestFrameworkType.JUnit5)
+ instrumentationTools()
+ }
+}
+
+intellijPlatform {
+ buildSearchableOptions = false
}
tasks {
@@ -28,32 +48,10 @@ tasks {
enabled = false
}
- register("testPropertyBased") {
+ register("testPropertyBased") {
group = "verification"
useJUnitPlatform()
}
-
- verifyPlugin {
- enabled = false
- }
-
- publishPlugin {
- enabled = false
- }
-
- runIde {
- enabled = false
- }
-
- runPluginVerifier {
- enabled = false
- }
-}
-
-intellij {
- version.set(ideaVersion)
- type.set("IC")
- plugins.set(listOf("java"))
}
java {
diff --git a/vim-engine/build.gradle.kts b/vim-engine/build.gradle.kts
index 9af976fa1d..f5284e33f7 100644
--- a/vim-engine/build.gradle.kts
+++ b/vim-engine/build.gradle.kts
@@ -16,6 +16,12 @@ plugins {
antlr
}
+val sourcesJarArtifacts by configurations.registering {
+ attributes {
+ attribute(DocsType.DOCS_TYPE_ATTRIBUTE, objects.named(DocsType.SOURCES))
+ }
+}
+
val kotlinVersion: String by project
val kotlinxSerializationVersion: String by project
@@ -99,6 +105,8 @@ java {
withJavadocJar()
}
+artifacts.add(sourcesJarArtifacts.name, tasks.named("sourcesJar"))
+
val spaceUsername: String by project
val spacePassword: String by project
val engineVersion: String by project
@@ -122,4 +130,4 @@ publishing {
}
}
}
-}
\ No newline at end of file
+}