Skip to content

Commit 46e5cb6

Browse files
committed
Merge remote-tracking branch 'origin/pr/37'
2 parents 5ecffe0 + 97bf1ff commit 46e5cb6

File tree

2 files changed

+86
-3
lines changed

2 files changed

+86
-3
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: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,44 @@ scalaVersion := "2.12.4"
99
lazy val `scala-plugin` = IdeaPlugin.Zip("scala-plugin", url("https://plugins.jetbrains.com/plugin/download?updateId=44474"))
1010
lazy val `cucumber-java` = IdeaPlugin.Zip("cucumber-java", url("https://plugins.jetbrains.com/plugin/download?updateId=43535"))
1111
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.4",
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 := "181.4203.550",
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+

0 commit comments

Comments
 (0)