Skip to content

Commit 76a3d7a

Browse files
committed
Release 0.6.2
Upgraded to support projects using Scala 2.10.0-RC1 via cucumber-jvm 1.1.1
1 parent f2bd00b commit 76a3d7a

File tree

13 files changed

+36
-21
lines changed

13 files changed

+36
-21
lines changed

Diff for: README.markdown

+12-4
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ IMPORTANT: Release 0.5.0 onwards are a major update that switches from running t
88
Provides the ability to run Cucumber-jvm within the SBT environment. Originally based on the [cuke4duke-sbt-plugin](https://github.com/rubbish/cuke4duke-sbt-plugin) by rubbish and my original implementation for SBT 0.7.x. Specifics for this release:
99

1010
* Works with xsbt 0.12.0
11-
* Works with cucumber-jvm (version 1.0.9 for Scala 2.9.x and version 1.0.14 for Scala 2.10.0-M6)
12-
* Allows projects compiled and running against Scala 2.9.1, 2.9.2 and 2.10.0-M6
13-
* NOTE: Currently doesn't work with Scala 2.10.0-M7 as this isn't supported by the latest cucumber-jvm version
11+
* Works with cucumber-jvm (version 1.0.9 for Scala 2.9.x and version 1.1.1 for Scala 2.10.0-RC1)
12+
* Allows projects compiled and running against Scala 2.9.1, 2.9.2 and 2.10.0-RC1
1413

1514
## Usage ##
1615
Install the plugin (see later). By default features files go in a 'src/test/features' directory. Step definitions go in 'src/test/scala'. Finally from the sbt console call the task:
@@ -72,12 +71,18 @@ For example:
7271
}
7372
}
7473

74+
NOTE: When running Scala 2.10, change the import to:
75+
76+
import cucumber.api.scala.{ScalaDsl, EN}
77+
78+
This is required as the Cucumber package structure changed between the 1.0.x and 1.1.x releases
79+
7580
## Project Setup ##
7681
To install the cucumber plugin, add entries to the build plugins file (project/plugins/build.sbt) as follows:
7782

7883
resolvers += "Templemore Repository" at "http://templemore.co.uk/repo"
7984

80-
addSbtPlugin("templemore" % "xsbt-cucumber-plugin" % "0.6.1")
85+
addSbtPlugin("templemore" % "xsbt-cucumber-plugin" % "0.6.2")
8186

8287
### Basic Configuration ###
8388
To add the cucumber plugin settings to a basic project, just add the following to the build.sbt file:
@@ -143,6 +148,9 @@ Requests for features can be posted to the issues list or emailed to the author.
143148

144149
## Release History ##
145150

151+
### 0.6.2 ###
152+
Upgrade to cucumber-jvm version 1.1.1 to allow compatibility with Scala 2.10.0-RC1 release.
153+
146154
### 0.6.1 ###
147155
Update to allow system properties and other JVM arguments to be passed to the JVM that runs cucumber.
148156
Corrections to documentation.

Diff for: build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name := "xsbt-cucumber-plugin"
22

3-
version := "0.6.1"
3+
version := "0.6.2"
44

55
organization := "templemore"
66

Diff for: src/main/scala/templemore/xsbt/cucumber/Cucumber.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import sbt.OutputStrategy
88
* @author Chris Turner
99
*/
1010
case class Cucumber(classpath: List[File],
11+
mainClass: String,
1112
outputStrategy: OutputStrategy,
1213
systemProperties: Map[String, String],
1314
jvmOptions: List[String],
@@ -28,7 +29,7 @@ case class Cucumber(classpath: List[File],
2829
options ++ makeOptionsList(tags, "--tags") ++ makeOptionsList(names, "--name") ++
2930
(featuresDir.getPath :: Nil)
3031

31-
val args = jvmArgs ++ ("cucumber.cli.Main" :: cucumberParams)
32+
val args = jvmArgs ++ (mainClass :: cucumberParams)
3233
outputStrategy.asInstanceOf[LoggedOutput].logger.debug(args mkString " ")
3334
Fork.java(None, args, None, Map.empty[String, String], outputStrategy)
3435
}

Diff for: src/main/scala/templemore/xsbt/cucumber/CucumberIntegration.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ trait CucumberIntegration {
4141

4242
log.info("Running cucumber...")
4343
cucumberOptions.beforeFunc()
44-
val cucumber = Cucumber(cucumberSettings.classpath, cucumberSettings.outputStrategy,
44+
val cucumber = Cucumber(cucumberSettings.classpath, cucumberOptions.mainClass, cucumberSettings.outputStrategy,
4545
cucumberSettings.systemProperties, cucumberSettings.jvmOptions,
4646
Some(cucumberSettings.maxMemory), Some(cucumberSettings.maxPermGen))
4747
val result = cucumber.cuke(cucumberOptions.featuresDir, cucumberOptions.basePackage,

Diff for: src/main/scala/templemore/xsbt/cucumber/CucumberOptions.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import java.io.File
55
/**
66
* @author Chris Turner
77
*/
8-
case class CucumberOptions(featuresDir: File,
8+
case class CucumberOptions(mainClass: String,
9+
featuresDir: File,
910
basePackage: String,
1011
options: List[String],
1112
beforeFunc: () => Unit,

Diff for: src/main/scala/templemore/xsbt/cucumber/CucumberPlugin.scala

+9-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Project.Initialize
1010
object CucumberPlugin extends Plugin with CucumberIntegration {
1111

1212
private val CucumberVersionForScala2_9 = "1.0.9"
13-
private val CucumberVersionForScala2_10 = "1.0.14"
13+
private val CucumberVersionForScala2_10 = "1.1.1"
1414

1515
type LifecycleCallback = () => Unit
1616

@@ -24,6 +24,7 @@ object CucumberPlugin extends Plugin with CucumberIntegration {
2424
val cucumberSystemProperties = SettingKey[Map[String, String]]("cucumber-system-properties")
2525
val cucumberJVMOptions = SettingKey[List[String]]("cucumber-jvm-options")
2626

27+
val cucumberMainClass = SettingKey[String]("cucumber-main-class")
2728
val cucumberFeaturesDir = SettingKey[File]("cucumber-features-directory")
2829
val cucumberStepsBasePackage = SettingKey[String]("cucumber-steps-base-package")
2930
val cucumberExtraOptions = SettingKey[List[String]]("cucumber-extra-options")
@@ -52,10 +53,10 @@ object CucumberPlugin extends Plugin with CucumberIntegration {
5253
}
5354

5455
protected def cucumberOptionsTask: Initialize[Task[CucumberOptions]] =
55-
(cucumberFeaturesDir, cucumberStepsBasePackage, cucumberExtraOptions,
56+
(cucumberMainClass, cucumberFeaturesDir, cucumberStepsBasePackage, cucumberExtraOptions,
5657
cucumberBefore, cucumberAfter) map {
57-
(fd, bp, o, bf, af) => {
58-
CucumberOptions(fd, bp, o, bf, af)
58+
(mc, fd, bp, o, bf, af) => {
59+
CucumberOptions(mc, fd, bp, o, bf, af)
5960
}
6061
}
6162

@@ -73,6 +74,9 @@ object CucumberPlugin extends Plugin with CucumberIntegration {
7374
private def cucumberVersion(scalaVersion: String) =
7475
if ( scalaVersion.startsWith("2.10") ) CucumberVersionForScala2_10 else CucumberVersionForScala2_9
7576

77+
private def cucumberMain(scalaVersion: String) =
78+
if ( scalaVersion.startsWith("2.10") ) "cucumber.api.cli.Main" else "cucumber.cli.Main"
79+
7680
val cucumberSettings = Seq(
7781
libraryDependencies <+= scalaVersion { sv =>
7882
"info.cukes" % "cucumber-scala" % cucumberVersion(sv) % "test"
@@ -88,6 +92,7 @@ object CucumberPlugin extends Plugin with CucumberIntegration {
8892
cucumberSystemProperties := Map.empty[String, String],
8993
cucumberJVMOptions := Nil,
9094

95+
cucumberMainClass <<= (scalaVersion) { sv => cucumberMain(sv) },
9196
cucumberFeaturesDir <<= (baseDirectory) { _ / "src" / "test" / "features" },
9297
cucumberStepsBasePackage := "",
9398
cucumberExtraOptions := List.empty[String],

Diff for: testProjects/multiModuleTestProject/project/Build.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import templemore.xsbt.cucumber.CucumberPlugin
55
object BuildSettings {
66
val buildOrganization = "templemore"
77
val buildScalaVersion = "2.9.2"
8-
val buildVersion = "0.6.1"
8+
val buildVersion = "0.6.2"
99

1010
val buildSettings = Defaults.defaultSettings ++
1111
Seq (organization := buildOrganization,
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
resolvers += Resolver.file("Local Repo", file((Path.userHome / ".m2" / "repository").toString))
22

3-
addSbtPlugin("templemore" % "xsbt-cucumber-plugin" % "0.6.1")
3+
addSbtPlugin("templemore" % "xsbt-cucumber-plugin" % "0.6.2")

Diff for: testProjects/testProject/build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name := "test-project"
22

3-
version := "0.6.1"
3+
version := "0.6.2"
44

55
organization := "templemore"
66

Diff for: testProjects/testProject/project/plugin.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
resolvers += "Templemore Repository" at "http://templemore.co.uk/repo"
22

3-
addSbtPlugin("templemore" % "xsbt-cucumber-plugin" % "0.6.1")
3+
addSbtPlugin("templemore" % "xsbt-cucumber-plugin" % "0.6.2")
44

55

Diff for: testProjects/testProject2_10/build.sbt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
name := "test-project"
22

3-
version := "0.6.1"
3+
version := "0.6.2"
44

55
organization := "templemore"
66

7-
scalaVersion := "2.10.0-M6"
7+
scalaVersion := "2.10.0-RC1"
88

99
libraryDependencies ++= Seq(
10-
"org.scalatest" % "scalatest_2.10.0-M6" % "1.9-2.10.0-M6-B2" % "test"
10+
"org.scalatest" % "scalatest_2.10.0-RC1" % "1.8-2.10.0-RC1-B1" % "test"
1111
)
1212

1313
seq(cucumberSettings : _*)

Diff for: testProjects/testProject2_10/project/plugin.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
resolvers += Resolver.file("Local Repo", file((Path.userHome / ".m2" / "repository").toString))
22

3-
addSbtPlugin("templemore" % "xsbt-cucumber-plugin" % "0.6.1")
3+
addSbtPlugin("templemore" % "xsbt-cucumber-plugin" % "0.6.2")

Diff for: testProjects/testProject2_10/src/test/scala/test/CucumberJarStepDefinitions.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package test
22

3-
import cucumber.runtime.{EN, ScalaDsl}
3+
import cucumber.api.scala.{ScalaDsl, EN}
44
import org.scalatest.matchers.ShouldMatchers
55

66
class CucumberJarStepDefinitions extends ScalaDsl with EN with ShouldMatchers {

0 commit comments

Comments
 (0)