Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use composite projects #2619

Merged
merged 3 commits into from
Nov 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -302,47 +302,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 @@ -352,30 +352,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 @@ -389,9 +389,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 @@ -405,9 +402,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 @@ -422,9 +416,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 @@ -436,9 +427,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 @@ -450,9 +438,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 @@ -461,9 +446,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 @@ -473,9 +455,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 @@ -488,9 +467,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 @@ -509,9 +485,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 @@ -527,9 +500,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 @@ -540,13 +510,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 @@ -576,19 +543,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