-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathbuild.sbt
100 lines (82 loc) · 3.47 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import org.typelevel.{Dependencies => typelevel}
import org.typelevel.alleycats.{Dependencies => alleycats}
/**
* These aliases serialise the build for the benefit of Travis-CI, also useful for pre-PR testing.
* If new projects are added to the build, these must be updated.
*/
addCommandAlias("buildJVM", ";coreJVM/compile;lawsJVM/compile;testsJVM/test")
addCommandAlias("validateJVM", ";scalastyle;buildJVM")
addCommandAlias("validateJS", ";coreJS/compile;lawsJS/compile;testsJS/test")
addCommandAlias("validate", ";validateJS;validateJVM")
addCommandAlias("gitSnapshots", ";set version in ThisBuild := git.gitDescribedVersion.value.get + \"-SNAPSHOT\"")
/**
* Project settings
*/
val gh = GitHubSettings(org = "non", proj = "alleycats", publishOrg = "org.typelevel", license = mit)
val devs = Seq(Dev("Erik Osheim", "non"))
val vers = typelevel.versions ++ alleycats.versions
val libs = typelevel.libraries ++ alleycats.libraries
val addins = typelevel.scalacPlugins ++ alleycats.scalacPlugins
val vAll = Versions(vers, libs, addins)
/**
* alleycats - This is the root project that aggregates the alleycatsJVM and alleycatsJS sub projects
*/
lazy val rootSettings = buildSettings ++ commonSettings ++ publishSettings ++ scoverageSettings
lazy val module = mkModuleFactory(gh.proj, mkConfig(rootSettings, commonJvmSettings, commonJsSettings))
lazy val prj = mkPrjFactory(rootSettings)
lazy val rootPrj = project
.configure(mkRootConfig(rootSettings,rootJVM))
.aggregate(rootJVM, rootJS)
.dependsOn(rootJVM, rootJS, testsJVM % "test-internal -> test")
lazy val rootJVM = project
.configure(mkRootJvmConfig(gh.proj, rootSettings, commonJvmSettings))
.aggregate(coreJVM, lawsJVM, testsJVM)
.dependsOn(coreJVM, lawsJVM, testsJVM % "compile;test-internal -> test")
lazy val rootJS = project
.configure(mkRootJsConfig(gh.proj, rootSettings, commonJsSettings))
.aggregate(coreJS, lawsJS, testsJS)
/**
* Core project
*/
lazy val core = prj(coreM)
lazy val coreJVM = coreM.jvm
lazy val coreJS = coreM.js
lazy val coreM = module("core", CrossType.Pure)
.settings(typelevel.macroCompatSettings(vAll):_*)
.settings(addLibs(vAll, "algebra", "cats-core", "export-hook", "simulacrum"):_*)
/**
* Laws project
*/
lazy val laws = prj(lawsM)
lazy val lawsJVM = lawsM.jvm
lazy val lawsJS = lawsM.js
lazy val lawsM = module("laws", CrossType.Pure)
.dependsOn(coreM)
.settings(disciplineDependencies:_*)
.settings(addLibs(vAll, "cats-laws"):_*)
/**
* Tests project
*/
lazy val tests = prj(testsM)
lazy val testsJVM = testsM.jvm
lazy val testsJS = testsM.js
lazy val testsM = module("tests", CrossType.Pure)
.dependsOn(coreM, lawsM)
.settings(disciplineDependencies:_*)
.settings(noPublishSettings:_*)
.settings(addTestLibs(vAll, "scalatest" ):_*)
/**
* Settings
*/
lazy val buildSettings = sharedBuildSettings(gh, vAll)
lazy val commonSettings = sharedCommonSettings ++
addTestLibs(vAll, "simulacrum", "machinist") ++
addCompilerPlugins(vAll, "kind-projector") ++ Seq(
scalacOptions ++= scalacAllOptions,
parallelExecution in Test := false
) /* ++ warnUnusedImport */ ++ unidocCommonSettings // spurious warnings from macro annotations expected
lazy val commonJsSettings = sharedJsSettings
lazy val commonJvmSettings = sharedJvmSettings
lazy val disciplineDependencies = Seq(addLibs(vAll, "discipline", "scalacheck" ):_*)
lazy val publishSettings = sharedPublishSettings(gh, devs) ++ credentialSettings ++ sharedReleaseProcess
lazy val scoverageSettings = sharedScoverageSettings(60)