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

Bug 137 #143

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ jobs:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v14
with:
java-version: openjdk@1.17
java-version: 1.17-custom=tgz+https://cache-redirector.jetbrains.com/intellij-jbr/jbr_jcef-17.0.11-linux-x64-b1312.2.tar.gz
- name: Compile & Test
run: sbt test
1 change: 1 addition & 0 deletions .jvmopts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-Dfile.encoding=UTF8
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,16 @@ enabling navigation between step definitions and gherkin steps when using cucumb

## Development

The plugin depends on:
- [Gherkin plugin](https://plugins.jetbrains.com/plugin/9164-gherkin)
- [Scala plugin](https://plugins.jetbrains.com/plugin/1347-scala)
- project [cucumber-jvm-scala](https://github.com/cucumber/cucumber-jvm-scala)

To setup the development environment, follow the following steps:

1. `git clone https://github.com/vbmacher/intellij-cucumber-scala.git`
2. Configure JDK 17
2. Configure JDK 21 (see https://plugins.jetbrains.com/docs/intellij/setting-up-theme-environment.html#add-jdk-and-intellij-platform-plugin-sdk)
3. Open the project in IDEA

The plugin is using [sbt-idea-plugin](https://github.com/JetBrains/sbt-idea-plugin). Please refer to that plugin documentation
to get information about available tasks.
The plugin depends on:
- [Gherkin plugin](https://plugins.jetbrains.com/plugin/9164-gherkin)
- [Scala plugin](https://plugins.jetbrains.com/plugin/1347-scala)
- project [cucumber-jvm-scala](https://github.com/cucumber/cucumber-jvm-scala)

To start an IDE with the plugin installed in the example project, run `runIDE` task. Import the whole project
as gradle project in the sandbox-ide. Wait for indexing to finish.
Expand Down
31 changes: 16 additions & 15 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@ lazy val commonSettings = Seq(
"--add-opens", "java.desktop/java.awt=ALL-UNNAMED",
"--add-opens", "java.desktop/java.awt.event=ALL-UNNAMED",
"--add-opens", "java.desktop/javax.swing=ALL-UNNAMED",
"--add-opens", "java.desktop/javax.swing.text=ALL-UNNAMED",
"--add-opens", "java.desktop/sun.font=ALL-UNNAMED",
"--add-exports", "java.base/jdk.internal.vm=ALL-UNNAMED",
),
version := "2024.1",
scalaVersion := "2.13.10",
version := "2024.3.1.1",
scalaVersion := "2.13.15",
libraryDependencies ++= Seq(
"junit" % "junit" % "4.13.2" % Test,
"io.cucumber" %% "cucumber-scala" % "8.21.1",
"io.cucumber" % "cucumber-junit" % "7.16.1" % Test,
"org.scalatest" %% "scalatest" % "3.2.17" % Test,
"org.scalatestplus" %% "junit-4-13" % "3.2.17.0" % Test,
"org.slf4j" % "slf4j-reload4j" % "2.0.9"
"io.cucumber" %% "cucumber-scala" % "8.25.1",
"io.cucumber" % "cucumber-junit" % "7.20.1" % Test,
"org.scalatest" %% "scalatest" % "3.2.19" % Test,
"org.scalatestplus" %% "junit-4-13" % "3.2.19.0" % Test,
"org.opentest4j" % "opentest4j" % "1.3.0" % Test
)
)

Expand All @@ -29,25 +30,25 @@ lazy val `cucumber-scala` = project
.settings(
commonSettings,
ThisBuild / intellijPluginName := "intellij-cucumber-scala",
ThisBuild / intellijBuild := "241.14494.240",
ThisBuild / intellijBuild := "243.22562.218",
ThisBuild / intellijPlatform := IntelliJPlatform.IdeaCommunity,
Compile / javacOptions ++= "--release" :: "17" :: Nil,
Compile / javacOptions ++= "--release" :: "21" :: Nil,
intellijPlugins ++= Seq(
"org.intellij.scala:2024.1.15".toPlugin,
"gherkin:241.14494.150".toPlugin
"org.intellij.scala:2024.3.23".toPlugin,
"gherkin:243.22562.13".toPlugin
),
packageMethod := PackagingMethod.Standalone(),
patchPluginXml := pluginXmlOptions { xml =>
xml.version = version.value
xml.sinceBuild = "241.14494"
xml.untilBuild = "241.*"
xml.sinceBuild = "243.22562"
xml.untilBuild = "243.*"
},
signPluginOptions := signPluginOptions.value.copy(enabled = true)
)

lazy val example = project.settings(commonSettings)
lazy val example = project.settings(commonSettings, packageMethod := PackagingMethod.Skip())

lazy val `example-stepdefs-lib` = project.settings(commonSettings)
lazy val `example-stepdefs-lib` = project.settings(commonSettings, packageMethod := PackagingMethod.Skip())

lazy val root = (project in file("."))
.aggregate(`cucumber-scala`, example, `example-stepdefs-lib`)
Expand Down
41 changes: 36 additions & 5 deletions cucumber-scala/src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>

<idea-plugin>
<idea-plugin xmlns:xi="http://www.w3.org/2001/XInclude"
require-restart="false">
<id>com.github.danielwegener.cucumber-scala</id>
<name>Cucumber for Scala</name>
<category>Test Tools</category>
<version>2024.1</version>
<idea-version since-build="241.14494" until-build="241.*"/>
<version>2024.3.1.1</version>
<idea-version since-build="243.22562" until-build="243.*"/>
<vendor email="[email protected]" url="https://github.com/vbmacher">Peter Jakubčo</vendor>

<description><![CDATA[
Expand All @@ -18,6 +19,37 @@

<change-notes><![CDATA[
<ul>
<li>2024.3.1.1: Release for IntelliJ 2024.3.1.1 (build 243.22562.218)
<ol>
<li>Scala plugin 2024.3.23</li>
<li>Gherkin plugin 243.22562.13</li>
<li><a href="https://github.com/vbmacher/intellij-cucumber-scala/issues/137">Problem with building in GitHub actions</a></li>
<li>Rollback to using Java version 17 (which is default IntelliJ Idea Java version)</li>
</ol>
</li>
<li>2024.3: Release for IntelliJ 2024.3 (build 243.21565.193)
<ol>
<li>Scala plugin 2024.3.18</li>
<li>Gherkin plugin 243.21565.122</li>
<li>cucumber-scala 8.25.1</li>
<li>cucumber-junit 7.20.1</li>
<li>Use Java version 21</li>
</ol>
</li>
<li>2024.2.1: Release for IntelliJ 2024.2.1 (build 242.21829.142)
<ol>
<li>Scala plugin 2024.2.25</li>
<li>Revert sbt-idea-plugin to 3.18.3</li>
<li><a href="https://github.com/vbmacher/intellij-cucumber-scala/issues/136">IDE Internal Errors</a></li>
</ol>
</li>
<li>2024.2: Release for IntelliJ 2024.2 (build 242.20224.419)
<ol>
<li>Scala plugin 2024.2.20</li>
<li>Gherkin plugin 242.20224.159</li>
<li>cucumber-scala 8.23.0</li>
</ol>
</li>
<li>2024.1: Release for IntelliJ 2024.1 (build 241.14494.240)
<ol>
<li>Scala plugin 2024.1.15</li>
Expand Down Expand Up @@ -211,9 +243,8 @@
</change-notes>

<depends>com.intellij.modules.java</depends>
<depends>org.intellij.intelliLang</depends>
<depends>org.intellij.scala</depends>
<depends>gherkin</depends>
<depends>org.intellij.scala</depends>

<extensions defaultExtensionNs="org.jetbrains.plugins.cucumber.steps">
<cucumberJvmExtensionPoint
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
package com.github.vbmacher.intellij.cucumber.scala

import java.io.File
import com.intellij.codeInsight.daemon.LineMarkerInfo
import com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl.getLineMarkers
import com.intellij.psi._
import com.intellij.testFramework.UsefulTestCase
import com.intellij.testFramework.fixtures.BasePlatformTestCase
import org.apache.log4j.Logger
import com.intellij.openapi.diagnostic.Logger
import org.scalatest.matchers.should.Matchers
import org.scalatestplus.junit.JUnitSuiteLike

import java.io.File
import scala.jdk.CollectionConverters._

abstract class ScCucumberSpecBase extends BasePlatformTestCase with Matchers with JUnitSuiteLike {
protected lazy val LOG = Logger.getRootLogger
protected lazy val LOG = Logger.getInstance(classOf[ScCucumberSpecBase])

val DESCRIPTOR = new LibraryLightProjectDescriptor(
//RemoteDependency("io.cucumber:cucumber-scala_2.13:6.9.0")
Expand All @@ -32,14 +31,12 @@ abstract class ScCucumberSpecBase extends BasePlatformTestCase with Matchers wit

def findLineMarkers() = {
val editor = myFixture.getEditor
val project = myFixture.getProject
val project = getProject

myFixture.doHighlighting()

var lineMarkers = collection.mutable.Seq.empty[LineMarkerInfo[_]]
UsefulTestCase.edt(() => {
getLineMarkers(editor.getDocument, project).asScala.foreach(lineMarkers +:= _)
})
inWriteAction(getLineMarkers(editor.getDocument, project).asScala.foreach(lineMarkers +:= _))

lineMarkers
}
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.7
sbt.version=1.10.1
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
addSbtPlugin("org.jetbrains" % "sbt-idea-plugin" % "3.18.3")
addSbtPlugin("org.jetbrains" % "sbt-idea-plugin" % "3.26.2")
Loading