Skip to content

Commit 97bf1ff

Browse files
author
Patrick Byrne
committed
Make 2018.1 compatible
Create ability to have run configuration to ease debugging
1 parent 20883f4 commit 97bf1ff

File tree

3 files changed

+93
-10
lines changed

3 files changed

+93
-10
lines changed

README.md

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,69 @@ Now you can build this plugin with `sbt package`
2424
2525
To start an IDE with the plugin installed in the example project just run `sbt "runIdea example"` (_todo: does not work yet_)
2626

27+
28+
# Using a run configuration
29+
(set it to 'single instance only' so it kills the current version when restarting)
30+
31+
This is all reverse engineered (in reality playing a game of spot the difference)
32+
with the scala plugin run configurations.
33+
34+
https://github.com/JetBrains/intellij-scala/blob/8030aef21f8f726796f7230d5f29669e35ebeec9/.idea/runConfigurations/IDEA.xml#L7
35+
36+
It is quite important that scala library does not get added to the classpath etc. If there are
37+
problems run the scala plugin by
38+
39+
1. Checkout https://github.com/JetBrains/intellij-scala
40+
2. Open in Intellij
41+
3. git checkout idea as that will demangle the run configuration so it can be ran easily
42+
43+
When running a configuration to analyse the output of the run window replace : with new lines
44+
so it is diffable.
45+
46+
## Main class
47+
```
48+
com.intellij.idea.Main
49+
```
50+
51+
## VM Options (Note this is using build id 181.4445.78)
52+
```
53+
-Xmx800m
54+
-XX:ReservedCodeCacheSize=240m
55+
-XX:+HeapDumpOnOutOfMemoryError
56+
-ea
57+
-Didea.is.internal=true
58+
-Didea.debug.mode=true
59+
-Dapple.laf.useScreenMenuBar=true
60+
-Dplugin.path=target/scala-2.12/intellij-cucumber-scala_2.12-2018.1.0.jar
61+
-Didea.platform.prefix=Idea
62+
-Didea.system.path=idea/system
63+
-Didea.config.path=idea/config
64+
-Didea.plugins.path=idea/181.4445.78/externalPlugins
65+
```
66+
67+
If system and config outside of extraction directory then it is easier to
68+
purge when a new version is out. You don't have to go through the whole
69+
running for the first time wizard.
70+
71+
72+
## Use classpath of module
73+
```
74+
runner-cucumber-scala-idea
75+
```
76+
77+
## Optional but useful
78+
Under run configuration create additional before launch external tool
79+
1. Name: sbt_package
80+
2. Program: sbt
81+
3. Arguments: package
82+
83+
This will mean that a fresh plugin jar is created each time the test community
84+
edition launches from the run configuration.
85+
2786
# Publishing
2887

2988

30-
1. Add your credentials to `ideaPublishSettings` in `build.sbt` (make sure to not check them in!)
89+
1. Add your credentials to `ideaPublishSettings` in `build.sbt` (make sure to not check them in!)
3190
2 run `sbt publishPlugin`
3291

3392
# License

build.sbt

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,50 @@ import sbt.Keys._
33

44
name := "Cucumber for Scala"
55
normalizedName := "intellij-cucumber-scala"
6-
version := "2017.3.1"
7-
scalaVersion := "2.12.4"
6+
version := "2018.1.0"
7+
scalaVersion := "2.12.3"
88

9-
lazy val `scala-plugin` = IdeaPlugin.Zip("scala-plugin", url("https://plugins.jetbrains.com/plugin/download?updateId=41523"))
10-
lazy val `cucumber-java` = IdeaPlugin.Zip("cucumber-java", url("https://plugins.jetbrains.com/plugin/download?updateId=39749"))
11-
lazy val gherkin = IdeaPlugin.Zip("gherkin", url("https://plugins.jetbrains.com/plugin/download?updateId=39748"))
9+
lazy val `scala-plugin` = IdeaPlugin.Zip("scala-plugin", url("https://plugins.jetbrains.com/plugin/download?updateId=45268"))
10+
lazy val `cucumber-java` = IdeaPlugin.Zip("cucumber-java", url("https://plugins.jetbrains.com/plugin/download?updateId=43535"))
11+
lazy val gherkin = IdeaPlugin.Zip("gherkin", url("https://plugins.jetbrains.com/plugin/download?updateId=43534"))
12+
lazy val ideaBuildNumber = "181.4445.78"
1213

1314
lazy val `cucumber-scala` = project.in(file( "."))
1415
.enablePlugins(SbtIdeaPlugin)
1516
.enablePlugins(SbtIdeaPluginPimps)
1617
.settings(scalariformSettings)
1718
.settings(
18-
autoScalaLibrary := false,
19+
scalaVersion := "2.12.3",
1920
javacOptions in Global ++= Seq("-source", "1.6", "-target", "1.6"),
2021
scalacOptions in Global += "-target:jvm-1.6",
2122
ideaExternalPlugins ++= Seq(`scala-plugin`, gherkin, `cucumber-java`),
2223
// check https://s3-eu-west-1.amazonaws.com/intellij-releases/ for valid builds
23-
ideaBuild in ThisBuild := "173.3942.27",
24+
ideaBuild in ThisBuild := ideaBuildNumber,
2425
ideaEdition in ThisBuild := IdeaEdition.Community,
2526
ideaPublishSettings := PublishSettings(pluginId = "com.github.danielwegener.cucumber-scala", username = "", password = "", channel = None),
2627
fork in Test := true,
2728
parallelExecution := true
2829
)
30+
31+
lazy val `runner-cucumber-scala-idea` = project.in(file(s"idea"))
32+
.settings(
33+
autoScalaLibrary := false,
34+
unmanagedBase := baseDirectory.value / s"$ideaBuildNumber/lib",
35+
fork in run := true,
36+
mainClass in(Compile, run) := Some("com.intellij.idea.Main"),
37+
javaOptions in run ++= Seq(
38+
"-Xmx800m",
39+
"-XX:ReservedCodeCacheSize=64m",
40+
"-XX:MaxPermSize=250m",
41+
"-XX:+HeapDumpOnOutOfMemoryError",
42+
"-ea",
43+
"-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005",
44+
"-Didea.is.internal=true",
45+
"-Didea.debug.mode=true",
46+
s"-Didea.plugins.path=idea/$ideaBuildNumber/externalPlugins",
47+
s"-Didea.config.path=idea/$ideaBuildNumber/system",
48+
"-Dapple.laf.useScreenMenuBar=true",
49+
"-Didea.ProcessCanceledException=disabled"
50+
)
51+
)
52+

src/main/resources/META-INF/plugin.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<idea-plugin>
44
<id>com.github.danielwegener.cucumber-scala</id>
55
<name>Cucumber for Scala</name>
6-
<version>2017.3.1</version>
6+
<version>2018.1.0</version>
77
<vendor email="[email protected]" url="http://daniel.wegener.me">Daniel Wegener</vendor>
88

99
<description><![CDATA[
@@ -35,7 +35,7 @@
3535
</change-notes>
3636

3737
<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for description -->
38-
<idea-version since-build="173.3942.27" until-build="174.0"/>
38+
<idea-version since-build="173.3942.27" until-build="182.0"/>
3939

4040
<!-- please see http://confluence.jetbrains.com/display/IDEADEV/Plugin+Compatibility+with+IntelliJ+Platform+Products
4141
on how to target different products -->

0 commit comments

Comments
 (0)