Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added build for 251 #346

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

strategy:
matrix:
product: [ "IC-241", "IC-242", "IC-243" ]
product: [ "IC-241", "IC-242", "IC-243", "IC-251" ]
max-parallel: 10
fail-fast: false

Expand All @@ -25,7 +25,7 @@ jobs:

- uses: actions/setup-java@v4
with:
java-version: "17"
java-version: "21"
distribution: "temurin"

- name: Run tests
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
product: [ "IC-241", "IC-242", "IC-243" ]
product: [ "IC-241", "IC-242", "IC-243", "IC-251" ]
max-parallel: 10
fail-fast: false

Expand All @@ -23,7 +23,7 @@ jobs:

- uses: actions/setup-java@v4
with:
java-version: "17"
java-version: "21"
distribution: "temurin"

- name: Run tests
Expand Down
19 changes: 14 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ data class PluginDescriptor(
// https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
val sdkVersion: String, // the version string passed to the intellij sdk gradle plugin
val sourceFolder: String, // used as the source root for specifics of this build
val useInstaller: Boolean, // required to be false for EAP builds
val useInstaller: Boolean, // required to be false for EAP builds
val jdkTarget: JavaVersion,
)

// https://jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html
Expand Down Expand Up @@ -55,32 +56,35 @@ val descriptors = listOf(
sdkVersion = "2024.1",
sourceFolder = "IC-241",
useInstaller = true,
jdkTarget = JavaVersion.VERSION_17,
),
PluginDescriptor(
since = "242.*", // this version is 2024.2.x
until = "243.*",
sdkVersion = "2024.2.2",
sourceFolder = "IC-242",
useInstaller = true,
jdkTarget = JavaVersion.VERSION_17,
),
PluginDescriptor(
since = "243.*", // this version is 2024.3.x
until = "252.*",
until = "244.*",
sdkVersion = "2024.3.1",
sourceFolder = "IC-243",
useInstaller = true,
jdkTarget = JavaVersion.VERSION_17,
),
PluginDescriptor(
since = "251.*", // this version is 2025.1.x
until = "252.*",
sdkVersion = "251-EAP-SNAPSHOT",
sourceFolder = "IC-251",
useInstaller = false,
jdkTarget = JavaVersion.VERSION_21,
),
)

val productName = System.getenv("PRODUCT_NAME") ?: "IC-243"
val jvmTargetVersion = System.getenv("JVM_TARGET") ?: "17"
val productName = System.getenv("PRODUCT_NAME") ?: "IC-251"
val descriptor = descriptors.first { it.sourceFolder == productName }

val jetbrainsToken: String by project
Expand Down Expand Up @@ -176,9 +180,14 @@ sourceSets {
}
}

java {
sourceCompatibility = descriptor.jdkTarget
targetCompatibility = descriptor.jdkTarget
}

kotlin {
compilerOptions {
jvmToolchain(JavaLanguageVersion.of(jvmTargetVersion).asInt())
jvmToolchain(JavaLanguageVersion.of(descriptor.jdkTarget.toString()).asInt())
}
}

Expand Down
17 changes: 0 additions & 17 deletions src/IC-251/kotlin/io/kotest/plugin/intellij/files.kt
Original file line number Diff line number Diff line change
@@ -1,30 +1,13 @@
package io.kotest.plugin.intellij

import com.intellij.execution.PsiLocation
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.psi.PsiElement
import com.intellij.psi.search.FilenameIndex
import com.intellij.psi.search.GlobalSearchScope
import io.kotest.plugin.intellij.psi.elementAtLine
import io.kotest.plugin.intellij.psi.isTestFile
import io.kotest.plugin.intellij.psi.toPsiLocation
import io.kotest.plugin.intellij.toolwindow.TagsFilename
import org.jetbrains.kotlin.idea.core.util.toPsiFile

fun findFiles(project: Project): List<VirtualFile> {
return FilenameIndex
.getVirtualFilesByName(TagsFilename, false, GlobalSearchScope.allScope(project))
.toList()
}

fun getLocationForFile(
project: Project,
scope: GlobalSearchScope,
name: String,
lineNumber: Int
): PsiLocation<PsiElement>? {
val testFile = FilenameIndex.getVirtualFilesByName(name, scope).firstOrNull { it.isTestFile(project) } ?: return null
// element at line is 1 indexed, so we need to add one
return testFile.toPsiFile(project)?.elementAtLine(lineNumber + 1)?.toPsiLocation()
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package io.kotest.plugin.intellij.psi

import org.jetbrains.kotlin.analysis.api.analyze
import org.jetbrains.kotlin.analysis.api.permissions.KaAllowAnalysisOnEdt
import org.jetbrains.kotlin.analysis.api.permissions.allowAnalysisOnEdt
import org.jetbrains.kotlin.analysis.api.types.symbol
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.StandardClassIds
Expand Down
9 changes: 3 additions & 6 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
<idea-plugin>

<id>kotest-plugin-intellij</id>
<name>Kotest</name>
<name>kotest</name>

<vendor email="[email protected]" url="http://github.com/kotest">Kotest</vendor>
<vendor email="[email protected]" url="https://kotest.io">Kotest</vendor>

<description><![CDATA[
Official IntelliJ-based IDEA plugin for <a href="https://github.com/kotest/kotest">Kotest</a>.<br/><br/>
This plugin requires the use of Kotest 4.2.0 or newer.
]]></description>
<description><![CDATA[Kotest individual test support inside the IDE]]></description>

<!-- correct values will be set by the build plugin -->
<version>1.0.0</version>
Expand Down
Loading