Skip to content

Commit 38dcbf0

Browse files
committed
Generated scalatest-shouldmatchers module for jvm.
1 parent 97f143c commit 38dcbf0

File tree

3 files changed

+46
-3
lines changed

3 files changed

+46
-3
lines changed

build.sbt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,5 @@ lazy val scalatestPropSpec = ScalatestBuild.scalatestPropSpec
5757
lazy val scalatestRefSpec = ScalatestBuild.scalatestRefSpec
5858
lazy val scalatestWordSpec = ScalatestBuild.scalatestWordSpec
5959
lazy val scalatestDiagrams = ScalatestBuild.scalatestDiagrams
60-
lazy val scalatestMatchersCore = ScalatestBuild.scalatestMatchersCore
60+
lazy val scalatestMatchersCore = ScalatestBuild.scalatestMatchersCore
61+
lazy val scalatestShouldMatchers = ScalatestBuild.scalatestShouldMatchers

project/GenModules.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,8 @@ object GenModules {
9191

9292
def genScalaTestMatchersCore(targetDir: File, version: String, scalaVersion: String): Seq[File] =
9393
copyDir("scalatest/src/main/scala/org/scalatest/matchers", "org/scalatest/matchers", targetDir, List.empty) ++
94-
copyDir("scalatest/src/main/scala/org/scalatest/matchers/dsl", "org/scalatest/matchers/dsl", targetDir, List.empty)
94+
copyDir("scalatest/src/main/scala/org/scalatest/matchers/dsl", "org/scalatest/matchers/dsl", targetDir, List.empty)
95+
96+
def genScalaTestShouldMatchers(targetDir: File, version: String, scalaVersion: String): Seq[File] =
97+
copyDir("scalatest/src/main/scala/org/scalatest/matchers/should", "org/scalatest/matchers/should", targetDir, List.empty)
9598
}

project/scalatest.scala

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,46 @@ object ScalatestBuild extends BuildCommons with DottyBuild with NativeBuild with
998998
"Bundle-DocURL" -> "http://www.scalatest.org/",
999999
"Bundle-Vendor" -> "Artima, Inc."
10001000
)
1001-
).dependsOn(scalatestCore)
1001+
).dependsOn(scalatestCore)
1002+
1003+
lazy val scalatestShouldMatchers = Project("scalatestShouldMatchers", file("modules/scalatest-shouldmatchers"))
1004+
.enablePlugins(SbtOsgi)
1005+
.settings(sharedSettings: _*)
1006+
.settings(scalatestDocSettings: _*)
1007+
.settings(
1008+
projectTitle := "ScalaTest Should Matchers",
1009+
name := "scalatest-shouldmatchers",
1010+
organization := "org.scalatest",
1011+
sourceGenerators in Compile += {
1012+
// Little trick to get rid of bnd error when publish.
1013+
Def.task{
1014+
(new File(crossTarget.value, "classes")).mkdirs()
1015+
Seq.empty[File]
1016+
}.taskValue
1017+
},
1018+
sourceGenerators in Compile += {
1019+
Def.task{
1020+
GenModules.genScalaTestShouldMatchers((sourceManaged in Compile).value, version.value, scalaVersion.value)
1021+
}.taskValue
1022+
},
1023+
scalatestDocSettings,
1024+
mimaPreviousArtifacts := Set(organization.value %% name.value % previousReleaseVersion),
1025+
mimaCurrentClassfiles := (classDirectory in Compile).value.getParentFile / (name.value + "_" + scalaBinaryVersion.value + "-" + releaseVersion + ".jar")
1026+
).settings(osgiSettings: _*).settings(
1027+
OsgiKeys.exportPackage := Seq(
1028+
"org.scalatest.matchers.should"
1029+
),
1030+
OsgiKeys.importPackage := Seq(
1031+
"org.scalatest.*",
1032+
"*;resolution:=optional"
1033+
),
1034+
OsgiKeys.additionalHeaders:= Map(
1035+
"Bundle-Name" -> "ScalaTest Should Matchers",
1036+
"Bundle-Description" -> "ScalaTest is an open-source test framework for the Java Platform designed to increase your productivity by letting you write fewer lines of test code that more clearly reveal your intent.",
1037+
"Bundle-DocURL" -> "http://www.scalatest.org/",
1038+
"Bundle-Vendor" -> "Artima, Inc."
1039+
)
1040+
).dependsOn(scalatestMatchersCore)
10021041

10031042
def gentestsLibraryDependencies =
10041043
Seq(

0 commit comments

Comments
 (0)