Skip to content

Commit

Permalink
Fixes #204: require explicitly enabling ScalaPactPlugin on projects. (#…
Browse files Browse the repository at this point in the history
…210)

* Fixes #204: require explicitly enabling ScalaPactPlugin on projects.
  • Loading branch information
solarmosaic-kflorence authored Jan 19, 2021
1 parent 69bd4c3 commit da2173a
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions broker-integration-tests/provider/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ name := "provider"

scalaVersion := "2.13.3"

enablePlugins(ScalaPactPlugin)

lazy val pactVersionFile: SettingKey[File] = settingKey[File]("location of scala-pact version for these tests")
pactVersionFile := baseDirectory.value.getParentFile.getParentFile / "version.sbt"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"version" : "2.0.0"
},
"scala-pact" : {
"version" : "2.4.1-SNAPSHOT"
"version" : "3.0.2-SNAPSHOT"
}
}
}
2 changes: 2 additions & 0 deletions example/provider/pact.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import com.itv.scalapact.shared.ProviderStateResult

import scala.concurrent.duration._

enablePlugins(ScalaPactPlugin)

scalaPactEnv :=
ScalaPactEnv.defaults
.withPort(8080)
Expand Down
3 changes: 2 additions & 1 deletion example/provider_pact-for-verification/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ organization := "com.example"

name := "provider_pacts-for-verification"


scalaVersion := "2.13.3"

enablePlugins(ScalaPactPlugin)

lazy val pactVersionFile: SettingKey[File] = settingKey[File]("location of scala-pact version for examples")
pactVersionFile := baseDirectory.value.getParentFile.getParentFile / "version.sbt"

Expand Down
1 change: 0 additions & 1 deletion example/provider_tests/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ organization := "com.example"

name := "provider_tests"


scalaVersion := "2.13.3"

lazy val pactVersionFile: SettingKey[File] = settingKey[File]("location of scala-pact version for examples")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"version" : "2.0.0"
},
"scala-pact" : {
"version" : "2.4.1-SNAPSHOT"
"version" : "3.0.2-SNAPSHOT"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import scala.language.implicitConversions

object ScalaPactPlugin extends AutoPlugin {
override def requires: JvmPlugin.type = plugins.JvmPlugin
override def trigger: PluginTrigger = allRequirements
override def trigger: PluginTrigger = noTrigger

@SuppressWarnings(Array("org.wartremover.warts.ImplicitConversion"))
implicit def booleanToProviderStateResult(bool: Boolean): ProviderStateResult = ProviderStateResult(bool)
Expand Down
2 changes: 2 additions & 0 deletions scripts/test-verifier.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ echo "addSbtPlugin(\"com.itv\" % \"sbt-scalapact\" % \"$CORE_VERSION\")" >> $PLU
cat > $PACT_CONFIG_FILE <<EOL
import com.itv.scalapact.plugin.ScalaPactPlugin._
enablePlugins(ScalaPactPlugin)
providerStates := Seq(
("Resource with ID 1234 exists", (_: String) => {
println("Injecting key 1234 into the database...")
Expand Down

0 comments on commit da2173a

Please sign in to comment.