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

Make glue parameter a list instead of just string #4

Merged
merged 2 commits into from
May 30, 2019
Merged
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
2 changes: 1 addition & 1 deletion example/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ enablePlugins(CucumberPlugin)
CucumberPlugin.envProperties := Map("K"->"2049")

CucumberPlugin.monochrome := false
CucumberPlugin.glue := "com/waioeka/sbt/"
CucumberPlugin.glues := List("com/waioeka/sbt/")

def before() : Unit = { println("beforeAll") }
def after() : Unit = { println("afterAll") }
Expand Down
16 changes: 8 additions & 8 deletions src/main/scala/com/waioeka/sbt/CucumberParameters.scala
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ import java.io.File
* @param features the path(s) to the features.
* @param monochrome whether or not to use monochrome output.
* @param plugins what plugin(s) to use.
* @param glue where glue code is loaded from.
* @param glues where glue code is loaded from.
* @param additionalArgs additional arguments to pass through to Cucumber.
*/
case class CucumberParameters(
dryRun : Boolean,
features : List[String],
monochrome : Boolean,
plugins : List[Plugin],
glue : String,
additionalArgs: List[String]) {
dryRun : Boolean,
features : List[String],
monochrome : Boolean,
plugins : List[Plugin],
glues : List[String],
additionalArgs: List[String]) {

/**
* Create a list of one element
Expand All @@ -68,7 +68,7 @@ case class CucumberParameters(
def toList : List[String] = {
boolToParameter(dryRun,"dry-run") :::
boolToParameter(monochrome,"monochrome") :::
List("--glue",s"$glue") :::
glues.flatMap(glue => Seq("--glue", glue)) :::
plugins.map(_.toCucumberPlugin).flatMap(plugin => Seq("--plugin", plugin)) :::
additionalArgs :::
features
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/com/waioeka/sbt/CucumberPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ object CucumberPlugin extends AutoPlugin {
* Where glue code (step definitions, hooks and plugins)
* are loaded from.
*/
val glue = SettingKey[String]("cucumber-glue")
val glues = SettingKey[List[String]]("cucumber-glues")

/** A beforeAll hook for Cucumber tests. */
val beforeAll = SettingKey[() => Unit]("cucumber-before")
Expand Down Expand Up @@ -99,7 +99,7 @@ object CucumberPlugin extends AutoPlugin {
features.value,
monochrome.value,
plugin.value,
glue.value,
glues.value,
args.toList
)

Expand Down