Skip to content

Commit

Permalink
Initial version of separating out scalactic.
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeseng committed Feb 9, 2015
1 parent fcf3314 commit 523a604
Show file tree
Hide file tree
Showing 1,140 changed files with 124 additions and 65 deletions.
2 changes: 1 addition & 1 deletion project/GenMatchers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ object GenMatchers {
val mustMatchersFile = new File(targetDir, "MustMatchers.scala")
val mustMatchersWriter = new BufferedWriter(new FileWriter(mustMatchersFile))
try {
val lines = Source.fromFile(new File("src/main/scala/org/scalatest/Matchers.scala")).getLines.toList
val lines = Source.fromFile(new File("scalatest/src/main/scala/org/scalatest/Matchers.scala")).getLines.toList
for (line <- lines) {
val mustLine = translateShouldToMust(line)
mustMatchersWriter.write(mustLine)
Expand Down
4 changes: 3 additions & 1 deletion project/GenVersions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import java.io.{File, FileWriter, BufferedWriter}

object GenVersions {

def genScalacticVersions(targetDir: File, version: String, scalaVersion: String): Unit = {
def genScalacticVersions(targetDir: File, version: String, scalaVersion: String): Seq[File] = {
val shortScalaVersion = scalaVersion.split("\\.").take(2).mkString(".")
targetDir.mkdirs()

Expand All @@ -22,6 +22,8 @@ object GenVersions {
scalacticVersionsFileWriter.flush()
scalacticVersionsFileWriter.close()
println("Generated " + scalacticVersionsFile.getAbsolutePath)
Seq(scalacticVersionsFile)

}

def genScalaTestVersions(targetDir: File, version: String, scalaVersion: String): Unit = {
Expand Down
137 changes: 77 additions & 60 deletions project/scalatest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,45 @@ object ScalatestBuild extends Build {
"org.pegdown" % "pegdown" % "1.4.2" % "optional"
)

lazy val scalatest = Project("scalatest", file("."))
lazy val commonTest = Project("common-test", file("common-test"))
.settings(sharedSettings: _*)
.settings(
projectTitle := "Common test classes used by scalactic and scalatest"
).dependsOn(LocalProject("scalatest"))

lazy val scalactic = Project("scalactic", file("scalactic"))
.settings(sharedSettings: _*)
.settings(
projectTitle := "Scalactic",
organization := "org.scalactic",
initialCommands in console := "import org.scalactic._",
sourceGenerators in Compile += {
Def.task{
GenVersions.genScalacticVersions((sourceManaged in Compile).value / "scala" / "org" / "scalactic", version.value, scalaVersion.value)
}.taskValue
},
scalacticDocTaskSetting
).settings(osgiSettings: _*).settings(
OsgiKeys.exportPackage := Seq(
"org.scalactic",
"org.scalautils"
),
OsgiKeys.additionalHeaders:= Map(
"Bundle-Name" -> "Scalactic",
"Bundle-Description" -> "Scalactic is an open-source library for Scala projects.",
"Bundle-DocURL" -> "http://www.scalactic.org/",
"Bundle-Vendor" -> "Artima, Inc."
)
)

lazy val scalacticTest = Project("scalactic-test", file("scalactic-test"))
.settings(sharedSettings: _*)
.settings(
projectTitle := "Scalactic Test",
organization := "org.scalactic"
).dependsOn(scalactic, scalatest % "test", commonTest % "test")

lazy val scalatest = Project("scalatest", file("scalatest"))
.settings(sharedSettings: _*)
.settings(
projectTitle := "ScalaTest",
Expand Down Expand Up @@ -187,30 +225,6 @@ object ScalatestBuild extends Build {
(baseDirectory, sourceManaged in Compile, version, scalaVersion) map genFiles("gencompcls", "GenCompatibleClasses.scala")(GenCompatibleClasses.genMain),
sourceGenerators in Compile <+=
(baseDirectory, sourceManaged in Compile, version, scalaVersion) map genFiles("genversions", "GenVersions.scala")(GenVersions.genScalaTestVersions),
testOptions in Test := Seq(Tests.Argument("-l", "org.scalatest.tags.Slow",
"-m", "org.scalatest",
"-m", "org.scalactic",
"-m", "org.scalatest.fixture",
"-m", "org.scalatest.concurrent",
"-m", "org.scalatest.testng",
"-m", "org.scalatest.junit",
"-m", "org.scalatest.events",
"-m", "org.scalatest.prop",
"-m", "org.scalatest.tools",
"-m", "org.scalatest.matchers",
"-m", "org.scalatest.suiteprop",
"-m", "org.scalatest.mock",
"-m", "org.scalatest.path",
"-m", "org.scalatest.selenium",
"-m", "org.scalatest.exceptions",
"-m", "org.scalatest.time",
"-m", "org.scalatest.words",
"-m", "org.scalatest.enablers",
"-m", "org.scalautils",
"-oDI",
"-h", "target/html",
"-u", "target/junit",
"-fW", "target/result.txt")),
scalatestDocTaskSetting
).settings(osgiSettings: _*).settings(
OsgiKeys.exportPackage := Seq(
Expand Down Expand Up @@ -243,44 +257,47 @@ object ScalatestBuild extends Build {
"Bundle-Vendor" -> "Artima, Inc.",
"Main-Class" -> "org.scalatest.tools.Runner"
)
)
).dependsOn(scalactic)

lazy val scalactic = Project("scalactic", file("genscalactic"))
lazy val scalatestTest = Project("scalatest-test", file("scalatest-test"))
.settings(sharedSettings: _*)
.settings(
projectTitle := "Scalactic",
organization := "org.scalactic",
initialCommands in console := "import org.scalactic._",
sourceGenerators in Compile <+=
(baseDirectory, sourceManaged in Compile, version, scalaVersion) map genFiles("", "GenScalactic.scala")(GenScalactic.genMain),
sourceGenerators in Test <+=
(baseDirectory, sourceManaged in Test, version, scalaVersion) map genFiles("", "GenScalactic.scala")(GenScalactic.genTest),
resourceDirectories in Compile += {
(sourceManaged in Compile).value / "resources"
},
// TODO - This is a hack to get us on the resources list..
resourceGenerators in Compile += {
Def.task{
Seq((sourceManaged in Compile).value / "resources" / "org" / "scalactic" / "ScalacticBundle.properties")
}.taskValue
},
// Note this should be removable.
mappings in (Compile, packageBin) += {
((sourceManaged in Compile).value / "resources" / "org" / "scalactic" / "ScalacticBundle.properties") -> "org/scalactic/ScalacticBundle.properties"
},
scalacticDocTaskSetting
).settings(osgiSettings: _*).settings(
OsgiKeys.exportPackage := Seq(
"org.scalactic",
"org.scalautils"
),
OsgiKeys.additionalHeaders:= Map(
"Bundle-Name" -> "Scalactic",
"Bundle-Description" -> "Scalactic is an open-source library for Scala projects.",
"Bundle-DocURL" -> "http://www.scalactic.org/",
"Bundle-Vendor" -> "Artima, Inc."
)
).dependsOn(scalatest % "test")
projectTitle := "ScalaTest Test",
organization := "org.scalatest",
libraryDependencies ++= crossBuildLibraryDependencies(scalaVersion.value),
libraryDependencies ++= scalatestLibraryDependencies,
testOptions in Test := Seq(Tests.Argument("-l", "org.scalatest.tags.Slow",
"-m", "org.scalatest",
"-m", "org.scalactic",
"-m", "org.scalatest.fixture",
"-m", "org.scalatest.concurrent",
"-m", "org.scalatest.testng",
"-m", "org.scalatest.junit",
"-m", "org.scalatest.events",
"-m", "org.scalatest.prop",
"-m", "org.scalatest.tools",
"-m", "org.scalatest.matchers",
"-m", "org.scalatest.suiteprop",
"-m", "org.scalatest.mock",
"-m", "org.scalatest.path",
"-m", "org.scalatest.selenium",
"-m", "org.scalatest.exceptions",
"-m", "org.scalatest.time",
"-m", "org.scalatest.words",
"-m", "org.scalatest.enablers",
"-m", "org.scalautils",
"-oDI",
"-h", "target/html",
"-u", "target/junit",
"-fW", "target/result.txt"))
).dependsOn(scalatest % "test", commonTest % "test")

lazy val scalatestAll = Project("scalatest-all", file("."))
.settings(sharedSettings: _*)
.settings(
projectTitle := "ScalaTest All",
organization := "org.scalatest"
).dependsOn(scalactic % "compile-internal", scalatest % "compile-internal").aggregate(scalactic, scalatest, scalacticTest, scalatestTest)

def gentestsLibraryDependencies =
Seq(
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
package org.scalactic

import org.scalatest._
import org.scalatest.events._
import SharedHelpers._

class TimesOnIntSpec extends FunSpec with TimesOnInt {

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 523a604

Please sign in to comment.