diff --git a/build.gradle.kts b/build.gradle.kts index 6e65df0..be33351 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,4 @@ +import org.jetbrains.intellij.platform.gradle.TestFrameworkType import org.jetbrains.kotlin.gradle.plugin.getKotlinPluginVersion import org.jetbrains.kotlin.gradle.tasks.KotlinCompile @@ -5,19 +6,20 @@ val jetbrainsPublishUsername: String? by project val jetbrainsPublishToken: String? by project plugins { - id("org.jetbrains.intellij") version "1.17.4" + id("org.jetbrains.intellij.platform") version "2.0.1" + id("org.jetbrains.intellij.platform.migration") version "2.0.1" kotlin("jvm") version "2.0.20" } -val kotlinVersion = project.getKotlinPluginVersion() +//val kotlinVersion = project.getKotlinPluginVersion() configure { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 } tasks { withType { - kotlinOptions.jvmTarget = "17" + kotlinOptions.jvmTarget = "21" } buildSearchableOptions { enabled = false @@ -26,22 +28,36 @@ tasks { repositories { mavenCentral() + intellijPlatform { + defaultRepositories() + } } -intellij { - version.set("IC-2023.3") - pluginName.set("jgiven-intellij-plugin") - plugins.set(listOf("java")) -} +//intellij { +// version.set("IC-2024.2") +// pluginName.set("jgiven-intellij-plugin") +// plugins.set(listOf("java")) +//} dependencies { - implementation(kotlin("stdlib", kotlinVersion)) + intellijPlatform { + intellijIdeaCommunity("2024.2.2") + bundledPlugin("com.intellij.java") + instrumentationTools() + + testFramework(TestFrameworkType.Plugin.Java) + } + + //implementation(kotlin("stdlib", kotlinVersion)) - testImplementation(kotlin("stdlib-jdk7", kotlinVersion)) - testImplementation("com.tngtech.jgiven:jgiven-junit:1.2.5") + //testImplementation(kotlin("stdlib-jdk7", kotlinVersion)) + testImplementation("com.tngtech.jgiven:jgiven-junit:1.3.0") testImplementation("com.tngtech.junit.dataprovider:junit4-dataprovider:2.10") testImplementation("org.assertj:assertj-core:3.24.2") testImplementation("org.mockito:mockito-core:5.13.0") + testImplementation("org.opentest4j:opentest4j:1.3.0") + + //testRuntimeOnly("junit:junit:4.13.2") } inline operator fun T.invoke(a: T.() -> Unit): T = apply(a) diff --git a/src/test/java/com/tngtech/jgiven/LibraryTestUtil.kt b/src/test/java/com/tngtech/jgiven/LibraryTestUtil.kt index 6336b37..a68d639 100644 --- a/src/test/java/com/tngtech/jgiven/LibraryTestUtil.kt +++ b/src/test/java/com/tngtech/jgiven/LibraryTestUtil.kt @@ -9,12 +9,19 @@ import com.intellij.openapi.util.Ref import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess import com.intellij.testFramework.PsiTestUtil import com.tngtech.jgiven.annotation.ScenarioState +import org.junit.Ignore import java.io.File -class LibraryTestUtil constructor(private val myModule: Module) { +@Ignore +class LibraryTestUtil { + private lateinit var myModule: Module private val references = ArrayList>() + fun setModule(module: Module) { + myModule = module + } + private fun addJarContaining(clazz: Class<*>): LibraryTestUtil { val path = getJarPath(clazz) addLibraryAt(path)