Skip to content

Commit

Permalink
Merge pull request #2619 from Alistair-Johnson/compo
Browse files Browse the repository at this point in the history
Use composite projects
  • Loading branch information
ceedubs authored Nov 20, 2018
2 parents 21fa985 + 127be19 commit e9c2b9b
Showing 1 changed file with 51 additions and 84 deletions.
135 changes: 51 additions & 84 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ lazy val docSettings = Seq(
"white-color" -> "#FFFFFF"
),
autoAPIMappings := true,
unidocProjectFilter in (ScalaUnidoc, unidoc) := inProjects(kernelJVM, coreJVM, freeJVM),
unidocProjectFilter in (ScalaUnidoc, unidoc) := inProjects(kernel.jvm, core.jvm, free.jvm),
docsMappingsAPIDir := "api",
addMappingsToSiteDir(mappings in (ScalaUnidoc, packageDoc), docsMappingsAPIDir),
ghpagesNoJekyll := false,
Expand Down Expand Up @@ -384,47 +384,47 @@ lazy val docs = project
.settings(noPublishSettings)
.settings(docSettings)
.settings(commonJvmSettings)
.dependsOn(coreJVM, freeJVM, kernelLawsJVM, lawsJVM, testkitJVM)
.dependsOn(core.jvm, free.jvm, kernelLaws.jvm, laws.jvm, testkit.jvm)

lazy val cats = project
.in(file("."))
.settings(moduleName := "root")
.settings(catsSettings)
.settings(noPublishSettings)
.aggregate(catsJVM, catsJS)
.dependsOn(catsJVM, catsJS, testsJVM % "test-internal -> test")
.dependsOn(catsJVM, catsJS, tests.jvm % "test-internal -> test")

lazy val catsJVM = project
.in(file(".catsJVM"))
.settings(moduleName := "cats")
.settings(noPublishSettings)
.settings(catsSettings)
.settings(commonJvmSettings)
.aggregate(macrosJVM,
kernelJVM,
kernelLawsJVM,
coreJVM,
lawsJVM,
freeJVM,
testkitJVM,
testsJVM,
alleycatsCoreJVM,
alleycatsLawsJVM,
alleycatsTestsJVM,
.aggregate(macros.jvm,
kernel.jvm,
kernelLaws.jvm,
core.jvm,
laws.jvm,
free.jvm,
testkit.jvm,
tests.jvm,
alleycatsCore.jvm,
alleycatsLaws.jvm,
alleycatsTests.jvm,
jvm,
docs)
.dependsOn(
macrosJVM,
kernelJVM,
kernelLawsJVM,
coreJVM,
lawsJVM,
freeJVM,
testkitJVM,
testsJVM % "test-internal -> test",
alleycatsCoreJVM,
alleycatsLawsJVM,
alleycatsTestsJVM % "test-internal -> test",
macros.jvm,
kernel.jvm,
kernelLaws.jvm,
core.jvm,
laws.jvm,
free.jvm,
testkit.jvm,
tests.jvm % "test-internal -> test",
alleycatsCore.jvm,
alleycatsLaws.jvm,
alleycatsTests.jvm % "test-internal -> test",
jvm
)

Expand All @@ -434,30 +434,30 @@ lazy val catsJS = project
.settings(noPublishSettings)
.settings(catsSettings)
.settings(commonJsSettings)
.aggregate(macrosJS,
kernelJS,
kernelLawsJS,
coreJS,
lawsJS,
freeJS,
testkitJS,
testsJS,
alleycatsCoreJS,
alleycatsLawsJS,
alleycatsTestsJS,
.aggregate(macros.js,
kernel.js,
kernelLaws.js,
core.js,
laws.js,
free.js,
testkit.js,
tests.js,
alleycatsCore.js,
alleycatsLaws.js,
alleycatsTests.js,
js)
.dependsOn(
macrosJS,
kernelJS,
kernelLawsJS,
coreJS,
lawsJS,
freeJS,
testkitJS,
testsJS % "test-internal -> test",
alleycatsCoreJS,
alleycatsLawsJS,
alleycatsTestsJS % "test-internal -> test",
macros.js,
kernel.js,
kernelLaws.js,
core.js,
laws.js,
free.js,
testkit.js,
tests.js % "test-internal -> test",
alleycatsCore.js,
alleycatsLaws.js,
alleycatsTests.js % "test-internal -> test",
js
)
.enablePlugins(ScalaJSPlugin)
Expand All @@ -471,9 +471,6 @@ lazy val macros = crossProject(JSPlatform, JVMPlatform)
.jsSettings(coverageEnabled := false)
.settings(scalacOptions := scalacOptions.value.filter(_ != "-Xfatal-warnings"))

lazy val macrosJVM = macros.jvm
lazy val macrosJS = macros.js

lazy val kernel = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.in(file("kernel"))
Expand All @@ -487,9 +484,6 @@ lazy val kernel = crossProject(JSPlatform, JVMPlatform)
.jvmSettings(commonJvmSettings ++ mimaSettings("cats-kernel"))
.settings(libraryDependencies += "org.scalacheck" %%% "scalacheck" % scalaCheckVersion(scalaVersion.value) % "test")

lazy val kernelJVM = kernel.jvm
lazy val kernelJS = kernel.js

lazy val kernelLaws = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.in(file("kernel-laws"))
Expand All @@ -504,9 +498,6 @@ lazy val kernelLaws = crossProject(JSPlatform, JVMPlatform)
.jsSettings(coverageEnabled := false)
.dependsOn(kernel)

lazy val kernelLawsJVM = kernelLaws.jvm
lazy val kernelLawsJS = kernelLaws.js

lazy val core = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.dependsOn(macros, kernel)
Expand All @@ -518,9 +509,6 @@ lazy val core = crossProject(JSPlatform, JVMPlatform)
.jsSettings(commonJsSettings)
.jvmSettings(commonJvmSettings ++ mimaSettings("cats-core"))

lazy val coreJVM = core.jvm
lazy val coreJS = core.js

lazy val laws = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.dependsOn(macros, kernel, core, kernelLaws)
Expand All @@ -532,9 +520,6 @@ lazy val laws = crossProject(JSPlatform, JVMPlatform)
.jvmSettings(commonJvmSettings)
.jsSettings(coverageEnabled := false)

lazy val lawsJVM = laws.jvm
lazy val lawsJS = laws.js

lazy val free = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.dependsOn(macros, core, tests % "test-internal -> test")
Expand All @@ -543,9 +528,6 @@ lazy val free = crossProject(JSPlatform, JVMPlatform)
.jsSettings(commonJsSettings)
.jvmSettings(commonJvmSettings ++ mimaSettings("cats-free"))

lazy val freeJVM = free.jvm
lazy val freeJS = free.js

lazy val tests = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.dependsOn(testkit % "test")
Expand All @@ -555,9 +537,6 @@ lazy val tests = crossProject(JSPlatform, JVMPlatform)
.jsSettings(commonJsSettings)
.jvmSettings(commonJvmSettings)

lazy val testsJVM = tests.jvm
lazy val testsJS = tests.js

lazy val testkit = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.dependsOn(macros, core, laws)
Expand All @@ -570,9 +549,6 @@ lazy val testkit = crossProject(JSPlatform, JVMPlatform)
.jsSettings(commonJsSettings)
.jvmSettings(commonJvmSettings)

lazy val testkitJVM = testkit.jvm
lazy val testkitJS = testkit.js

lazy val alleycatsCore = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.in(file("alleycats-core"))
Expand All @@ -591,9 +567,6 @@ lazy val alleycatsCore = crossProject(JSPlatform, JVMPlatform)
.jvmSettings(commonJvmSettings)
.settings(scalacOptions ~= { _.filterNot(Set("-Ywarn-unused-import", "-Ywarn-unused:imports")) }) //export-hook triggers unused import

lazy val alleycatsCoreJVM = alleycatsCore.jvm
lazy val alleycatsCoreJS = alleycatsCore.js

lazy val alleycatsLaws = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.in(file("alleycats-laws"))
Expand All @@ -609,9 +582,6 @@ lazy val alleycatsLaws = crossProject(JSPlatform, JVMPlatform)
.jsSettings(coverageEnabled := false)
.dependsOn(alleycatsCore)

lazy val alleycatsLawsJVM = alleycatsLaws.jvm
lazy val alleycatsLawsJS = alleycatsLaws.js

lazy val alleycatsTests = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.in(file("alleycats-tests"))
Expand All @@ -622,13 +592,10 @@ lazy val alleycatsTests = crossProject(JSPlatform, JVMPlatform)
.jsSettings(commonJsSettings)
.jvmSettings(commonJvmSettings)

lazy val alleycatsTestsJVM = alleycatsTests.jvm
lazy val alleycatsTestsJS = alleycatsTests.js

// bench is currently JVM-only

lazy val bench = project
.dependsOn(macrosJVM, coreJVM, freeJVM, lawsJVM)
.dependsOn(macros.jvm, core.jvm, free.jvm, laws.jvm)
.settings(moduleName := "cats-bench")
.settings(catsSettings)
.settings(noPublishSettings)
Expand Down Expand Up @@ -658,19 +625,19 @@ lazy val binCompatTest = project
"org.scalatest" %%% "scalatest" % scalatestVersion(scalaVersion.value) % Test
)
)
.dependsOn(coreJVM % Test)
.dependsOn(core.jvm % Test)

// cats-js is JS-only
lazy val js = project
.dependsOn(macrosJS, coreJS, testsJS % "test-internal -> test")
.dependsOn(macros.js, core.js, tests.js % "test-internal -> test")
.settings(moduleName := "cats-js")
.settings(catsSettings)
.settings(commonJsSettings)
.enablePlugins(ScalaJSPlugin)

// cats-jvm is JVM-only
lazy val jvm = project
.dependsOn(macrosJVM, coreJVM, testsJVM % "test-internal -> test")
.dependsOn(macros.jvm, core.jvm, tests.jvm % "test-internal -> test")
.settings(moduleName := "cats-jvm")
.settings(catsSettings)
.settings(commonJvmSettings)
Expand Down

0 comments on commit e9c2b9b

Please sign in to comment.