Skip to content

Commit

Permalink
Create a pureconfig-testkit project and simplify build (#844)
Browse files Browse the repository at this point in the history
* Create a pureconfig-testkit project and simplify build

* Move test suites for shapeless derivation to `generic` module
  • Loading branch information
ruippeixotog committed Oct 11, 2020
1 parent 35521a5 commit 770a7d4
Show file tree
Hide file tree
Showing 22 changed files with 23 additions and 20 deletions.
34 changes: 15 additions & 19 deletions build.sbt
Expand Up @@ -5,30 +5,21 @@ import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations._
organization in ThisBuild := "com.github.pureconfig"

lazy val core = (project in file("core"))
.enablePlugins(BoilerplatePlugin, SbtOsgi, TutPlugin)
.enablePlugins(BoilerplatePlugin, SbtOsgi)
.settings(commonSettings)
.dependsOn(macros)

// Two special modules for now, since `tests` depend on them. We should improve this organization later by separating
// the test helpers (which all projects' tests should depend on) from the core+generic test implementations.
lazy val `generic-base` = (project in file("modules/generic-base"))
.enablePlugins(SbtOsgi, TutPlugin)
.dependsOn(core)
.settings(commonSettings, tutTargetDirectory := baseDirectory.value)

lazy val generic = (project in file("modules/generic"))
.enablePlugins(SbtOsgi, TutPlugin)
.dependsOn(core, `generic-base`)
.settings(commonSettings, tutTargetDirectory := baseDirectory.value)
// -----
lazy val macros = (project in file("macros"))
.settings(commonSettings)

lazy val macros = (project in file("macros")).enablePlugins(TutPlugin).settings(commonSettings)
lazy val testkit = (project in file("testkit"))
.settings(commonSettings)
.dependsOn(core)

lazy val tests = (project in file("tests"))
.enablePlugins(BoilerplatePlugin)
.settings(commonSettings)
.dependsOn(core, generic)
.dependsOn(macros % "test->test") // provides helpers to test pureconfig macros
.dependsOn(core, testkit, generic)

// aggregates pureconfig-core and pureconfig-generic with the original "pureconfig" name
lazy val bundle = (project in file("bundle"))
Expand All @@ -42,13 +33,16 @@ lazy val docs = (project in file("docs"))
.settings(docsSettings)
.dependsOn(bundle)

def module(proj: Project) = proj
def genericModule(proj: Project) = proj
.enablePlugins(SbtOsgi, TutPlugin)
.dependsOn(core)
.dependsOn(tests % "test")
.dependsOn(generic % "Tut") // Allow auto-derivation in documentation
.dependsOn(testkit % "test")
.settings(commonSettings, tutTargetDirectory := baseDirectory.value)

def module(proj: Project) = genericModule(proj)
.dependsOn(generic % "test")
.dependsOn(generic % "Tut") // Allow auto-derivation in documentation

lazy val akka = module(project) in file("modules/akka")
lazy val `akka-http` = module(project) in file("modules/akka-http")
lazy val cats = module(project) in file("modules/cats")
Expand All @@ -58,6 +52,8 @@ lazy val cron4s = module(project) in file("modules/cron4s")
lazy val enum = module(project) in file("modules/enum")
lazy val enumeratum = module(project) in file("modules/enumeratum")
lazy val fs2 = module(project) in file("modules/fs2")
lazy val generic = genericModule(project) in file("modules/generic") dependsOn `generic-base`
lazy val `generic-base` = genericModule(project) in file("modules/generic-base")
lazy val hadoop = module(project) in file("modules/hadoop")
lazy val http4s = module(project) in file("modules/http4s")
lazy val javax = module(project) in file("modules/javax")
Expand Down
7 changes: 7 additions & 0 deletions testkit/build.sbt
@@ -0,0 +1,7 @@
import Dependencies._

name := "pureconfig-testkit"

libraryDependencies ++= Seq(scalaTest, scalaCheck, scalaTestPlusScalaCheck)

skip in publish := true
2 changes: 1 addition & 1 deletion tests/build.sbt
Expand Up @@ -2,6 +2,6 @@ import Dependencies._

name := "pureconfig-tests"

libraryDependencies ++= Seq(scalaTest, scalaCheck, scalaTestPlusScalaCheck, scalaCheckShapeless % "test")
libraryDependencies ++= Seq(scalaCheckShapeless % "test")

skip in publish := true

0 comments on commit 770a7d4

Please sign in to comment.