diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index f8336d9ff..2b8e44169 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -78,8 +78,6 @@ jobs:
echo "changelog=$CHANGELOG" >> $GITHUB_OUTPUT
echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT
- ./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
-
# Run tests
- name: Run Tests
@@ -102,7 +100,7 @@ jobs:
# Run Verify Plugin task and IntelliJ Plugin Verifier tool
- name: Run Plugin Verification tasks
- run: ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}
+ run: ./gradlew verifyPlugin
# Collect Plugin Verifier Result
- name: Collect Plugin Verifier Result
diff --git a/.run/Run IDE for UI Tests.run.xml b/.run/Run IDE for UI Tests.run.xml
index 47eabffa9..ebe72fecf 100644
--- a/.run/Run IDE for UI Tests.run.xml
+++ b/.run/Run IDE for UI Tests.run.xml
@@ -5,13 +5,13 @@
-
+
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index e71256d5b..253daa6d8 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -25,11 +25,11 @@ to include test generation using Grazie in the build process, you need to pass S
## Run IDE for UI tests
In IDEA, run the `Run IDE for UI Tests` configuration. Alternatively, use the following command:
-`gradle runIdeForUiTests`.
+`gradle runIde`.
### Including Test generation using Grazie (for JetBrains employees only!)
to include test generation using Grazie in the runIdeForUiTests process, you need to pass Space username and token as properties:
-`gradle runIdeForUiTests -Dspace.username= -Dspace.pass=`.
+`gradle runIde -Dspace.username= -Dspace.pass=`.
`` is generated by Space, which has access to Automatically generating unit tests maven packages.
diff --git a/build.gradle.kts b/build.gradle.kts
index b210fe2ab..717f160f0 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,5 +1,8 @@
import org.jetbrains.changelog.markdownToHTML
-import org.jetbrains.intellij.tasks.RunIdeTask
+import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
+import org.jetbrains.intellij.platform.gradle.TestFrameworkType
+import org.jetbrains.intellij.platform.gradle.models.ProductRelease
+import org.jetbrains.intellij.platform.gradle.tasks.RunIdeTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.io.FileOutputStream
import java.net.URL
@@ -25,7 +28,9 @@ plugins {
// Kotlin support
id("org.jetbrains.kotlin.jvm") version "1.9.0"
// Gradle IntelliJ Plugin
- id("org.jetbrains.intellij") version "1.15.0"
+ id("org.jetbrains.intellij.platform") version "2.1.0"
+ // Gradle IntelliJ Plugin Migration Help (uncomment it for migration tips)
+// id("org.jetbrains.intellij.platform.migration") version "2.1.0"
// Gradle Changelog Plugin
id("org.jetbrains.changelog") version "2.1.2"
// Gradle Qodana Plugin
@@ -37,6 +42,11 @@ version = properties("pluginVersion")
// Configure project's dependencies
repositories {
mavenCentral()
+ // this part is mandatory for all modules for platform version 2:
+ // See https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-repositories-extension.html#default-repositories
+ intellijPlatform {
+ defaultRepositories()
+ }
maven("https://packages.jetbrains.team/maven/p/ij/intellij-dependencies")
maven("https://www.jetbrains.com/intellij-repository/snapshots")
@@ -66,6 +76,13 @@ if (spaceCredentialsProvided()) {
usingSourceSet(hasGrazieAccess)
}
+ // Add the dependencies for the new source set
+ dependencies {
+ add(hasGrazieAccess.implementationConfigurationName, kotlin("stdlib"))
+ add(hasGrazieAccess.implementationConfigurationName, "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
+ add(hasGrazieAccess.implementationConfigurationName, "org.jetbrains.research:grazie-test-generation:$grazieTestGenerationVersion")
+ }
+
tasks.register("checkCredentials") {
configurations.detachedConfiguration(
dependencies.create("org.jetbrains.research:grazie-test-generation:$grazieTestGenerationVersion"),
@@ -77,7 +94,7 @@ if (spaceCredentialsProvided()) {
}
// add build of new source set as the part of UI testing
- tasks.prepareUiTestingSandbox.configure {
+ tasks.prepareTestSandbox.configure {
dependsOn(hasGrazieAccess.jarTaskName)
from(tasks.getByName(hasGrazieAccess.jarTaskName).outputs.files.asPath) { into("TestSpark/lib") }
@@ -99,6 +116,20 @@ if (spaceCredentialsProvided()) {
}
dependencies {
+ // Check platform V2 documentation for more details: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html
+ intellijPlatform {
+ // make a custom version of IDEA
+ create(properties("platformType"), properties("platformVersion"))
+ // Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
+ bundledPlugins(providers.gradleProperty("platformPlugins").map { it.split(',') })
+
+ pluginVerifier()
+ zipSigner()
+ instrumentationTools()
+
+ testFramework(TestFrameworkType.Bundled)
+ }
+
implementation(files("lib/evosuite-${properties("evosuiteVersion")}.jar"))
implementation(files("lib/standalone-runtime.jar"))
implementation(files("lib/jacocoagent.jar"))
@@ -169,23 +200,41 @@ dependencies {
implementation("org.jetbrains.kotlin:kotlin-test:1.8.0")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3")
-
- if (spaceCredentialsProvided()) {
- // Dependencies for hasGrazieAccess variant
- "hasGrazieAccessImplementation"(kotlin("stdlib"))
- "hasGrazieAccessImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
- "hasGrazieAccessImplementation"("org.jetbrains.research:grazie-test-generation:$grazieTestGenerationVersion")
- }
}
-// Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
-intellij {
- pluginName.set(properties("pluginName"))
- version.set(properties("platformVersion"))
- type.set(properties("platformType"))
+// Configure Gradle IntelliJ Plugin - read more: // Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
+intellijPlatform {
+ pluginConfiguration {
+ name = properties("pluginName")
+ version = properties("pluginVersion")
+
+ ideaVersion {
+ sinceBuild = properties("pluginSinceBuild")
+ untilBuild = properties("pluginUntilBuild")
+ }
+ }
- // Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
- plugins.set(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
+ publishing {
+ token = System.getenv("PUBLISH_TOKEN")
+ channels = listOf(properties("pluginVersion").split('-').getOrElse(1) { "default" }.split('.').first())
+ }
+ // Set the ides on which the plugin verification is executed.
+ // See https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-extension.html#intellijPlatform-pluginVerification-ides
+ pluginVerification {
+ ides {
+ recommended()
+ select {
+ types = listOf(IntelliJPlatformType.IntellijIdeaUltimate)
+ channels = listOf(ProductRelease.Channel.RELEASE)
+ sinceBuild = properties("pluginSinceBuild")
+ untilBuild = properties("pluginUntilBuild")
+ }
+ }
+ freeArgs = listOf(
+ "-mute",
+ "TemplateWordInPluginId,ForbiddenPluginIdPrefix"
+ )
+ }
}
// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
@@ -232,11 +281,13 @@ tasks {
}
}
- patchPluginXml {
- version.set(properties("pluginVersion"))
- sinceBuild.set(properties("pluginSinceBuild"))
- untilBuild.set(properties("pluginUntilBuild"))
+ signPlugin {
+ certificateChain.set(providers.environmentVariable("CERTIFICATE_CHAIN"))
+ privateKey.set(providers.environmentVariable("PRIVATE_KEY"))
+ password.set(providers.environmentVariable("PRIVATE_KEY_PASSWORD"))
+ }
+ patchPluginXml {
// Extract the section from README.md and provide for the plugin's manifest
pluginDescription.set(
projectDir.resolve("README.md").readText().lines().run {
@@ -260,33 +311,8 @@ tasks {
)
}
- // Configure UI tests plugin
- // Read more: https://github.com/JetBrains/intellij-ui-test-robot
- runIdeForUiTests {
- 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("idea.trust.all.projects", "true")
- systemProperty("ide.show.tips.on.startup.default.value", "false")
- systemProperty("jb.consents.confirmation.enabled", "false")
- systemProperty("ide.mac.file.chooser.native", "false")
- systemProperty("apple.laf.useScreenMenuBar", "false")
- }
-
- signPlugin {
- certificateChain.set(System.getenv("CERTIFICATE_CHAIN").trimIndent())
- privateKey.set(System.getenv("PRIVATE_KEY").trimIndent())
- password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
- }
-
publishPlugin {
dependsOn("patchChangelog")
- token.set(System.getenv("PUBLISH_TOKEN"))
- // pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
- // Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
- // https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
- channels.set(listOf(properties("pluginVersion").split('-').getOrElse(1) { "default" }.split('.').first()))
}
}
diff --git a/gradle.properties b/gradle.properties
index 29c32f252..175b30baa 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -11,21 +11,21 @@ evosuiteVersion = 1.0.5
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
# for insight into build numbers and IntelliJ Platform versions.
pluginSinceBuild = 241
-pluginUntilBuild = 241.*
+pluginUntilBuild = 242.*
# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
platformType = IC
-platformVersion = 2024.1
+platformVersion = 2024.2.3
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
-platformPlugins = com.intellij.java, org.jetbrains.kotlin, maven, gradle
+platformPlugins = com.intellij.java, org.jetbrains.kotlin, org.jetbrains.idea.maven, com.intellij.gradle
# Java language level used to compile sources and to generate the files for - Java 17 is required since 2023.1
javaVersion = 17
# Gradle Releases -> https://github.com/gradle/gradle/releases
-gradleVersion = 8.2.1
+gradleVersion = 8.10.2
# Opt-out flag for bundling Kotlin standard library.
# See https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library for details.
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 070cb702f..0d1842103 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/java/build.gradle.kts b/java/build.gradle.kts
index a499d11b5..f90007a00 100644
--- a/java/build.gradle.kts
+++ b/java/build.gradle.kts
@@ -1,33 +1,38 @@
plugins {
kotlin("jvm")
- id("org.jetbrains.intellij")
+ id("org.jetbrains.intellij.platform")
}
repositories {
mavenCentral()
+ intellijPlatform {
+ defaultRepositories()
+ }
}
dependencies {
+ intellijPlatform {
+ create(rootProject.properties["platformType"].toString(), rootProject.properties["platformVersion"].toString())
+ // Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
+ bundledPlugins(listOf("com.intellij.java"))
+
+ instrumentationTools()
+ }
implementation(kotlin("stdlib"))
implementation(project(":langwrappers")) // Interfaces that cover language-specific logic
implementation(project(":core"))
}
-intellij {
- rootProject.properties["platformVersion"]?.let { version.set(it.toString()) }
- plugins.set(listOf("java"))
+intellijPlatform {
+ pluginConfiguration {
+ rootProject.properties["platformVersion"]?.let { version = it.toString() }
+ }
}
tasks.named("verifyPlugin") { enabled = false }
tasks.named("runIde") { enabled = false }
-tasks.named("runPluginVerifier") { enabled = false }
-
-tasks {
- buildSearchableOptions {
- enabled = false
- }
-}
+tasks.named("prepareJarSearchableOptions") { enabled = false }
kotlin {
jvmToolchain(rootProject.properties["jvmToolchainVersion"].toString().toInt())
diff --git a/kotlin/build.gradle.kts b/kotlin/build.gradle.kts
index 903631aa9..8cd1fa6f8 100644
--- a/kotlin/build.gradle.kts
+++ b/kotlin/build.gradle.kts
@@ -1,27 +1,39 @@
plugins {
kotlin("jvm")
- id("org.jetbrains.intellij")
+ id("org.jetbrains.intellij.platform")
}
repositories {
mavenCentral()
+ intellijPlatform {
+ defaultRepositories()
+ }
}
dependencies {
+
+ intellijPlatform {
+ create(rootProject.properties["platformType"].toString(), rootProject.properties["platformVersion"].toString())
+ // Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
+ bundledPlugins(listOf("com.intellij.java", "org.jetbrains.kotlin"))
+
+ instrumentationTools()
+ }
implementation(kotlin("stdlib"))
implementation(project(":langwrappers")) // Interfaces that cover language-specific logic
implementation(project(":core"))
}
-intellij {
- rootProject.properties["platformVersion"]?.let { version.set(it.toString()) }
- plugins.set(listOf("java", "org.jetbrains.kotlin"))
+intellijPlatform {
+ pluginConfiguration {
+ rootProject.properties["platformVersion"]?.let { version = it.toString() }
+ }
}
tasks.named("verifyPlugin") { enabled = false }
tasks.named("runIde") { enabled = false }
-tasks.named("runPluginVerifier") { enabled = false }
+tasks.named("prepareJarSearchableOptions") { enabled = false }
tasks {
buildSearchableOptions {
diff --git a/langwrappers/build.gradle.kts b/langwrappers/build.gradle.kts
index 317debb35..336bca55d 100644
--- a/langwrappers/build.gradle.kts
+++ b/langwrappers/build.gradle.kts
@@ -1,26 +1,41 @@
plugins {
kotlin("jvm")
- id("org.jetbrains.intellij")
+ id("org.jetbrains.intellij.platform")
}
repositories {
mavenCentral()
+ intellijPlatform {
+ defaultRepositories()
+ }
}
dependencies {
+
+ intellijPlatform {
+ create(rootProject.properties["platformType"].toString(), rootProject.properties["platformVersion"].toString())
+ // Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
+ bundledPlugins(listOf("com.intellij.java"))
+
+ instrumentationTools()
+ }
implementation(kotlin("stdlib"))
implementation(project(":core"))
}
-intellij {
- rootProject.properties["platformVersion"]?.let { version.set(it.toString()) }
- plugins.set(listOf("java"))
+intellijPlatform {
+ pluginConfiguration {
+ rootProject.properties["platformVersion"]?.let { version = it.toString() }
+ }
+// apply(plugin = "java")
+// // Apply more plugins if necessary
+// apply(plugin = "kotlin")
}
tasks.named("verifyPlugin") { enabled = false }
tasks.named("runIde") { enabled = false }
-tasks.named("runPluginVerifier") { enabled = false }
+tasks.named("prepareJarSearchableOptions") { enabled = false }
kotlin {
jvmToolchain(rootProject.properties["jvmToolchainVersion"].toString().toInt())
diff --git a/src/main/kotlin/org/jetbrains/research/testspark/bundles/llm/LLMDefaultsBundle.kt b/src/main/kotlin/org/jetbrains/research/testspark/bundles/llm/LLMDefaultsBundle.kt
index 4c3377fd7..f016e1bc8 100644
--- a/src/main/kotlin/org/jetbrains/research/testspark/bundles/llm/LLMDefaultsBundle.kt
+++ b/src/main/kotlin/org/jetbrains/research/testspark/bundles/llm/LLMDefaultsBundle.kt
@@ -14,4 +14,8 @@ object LLMDefaultsBundle : DynamicBundle(LLMBundlePaths.defaults) {
*/
@Nls
fun get(@PropertyKey(resourceBundle = LLMBundlePaths.defaults) key: String): String = getMessage(key)
+ // In Intellij Platform version 2, the DynamicBundle returns the whole path and the value at the end in plugin verification.
+ // Each is separated by "|" (e.g., "|b|properties.llm.LLMDefaults|k|maxLLMRequest|3")
+ // if we do not split them here, the process will throw java.lang.NumberFormatException
+ .split("|").last()
}