forked from typelevel/cats-tagless
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
173 lines (142 loc) · 6.61 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
import com.typesafe.sbt.SbtGit.git
import _root_.sbtcrossproject.CrossPlugin.autoImport.CrossType
addCommandAlias("gitSnapshots", ";set version in ThisBuild := git.gitDescribedVersion.value.get + \"-SNAPSHOT\"")
addCommandAlias("validateJVM", ";testsJVM/test ; docs/makeMicrosite")
lazy val libs = org.typelevel.libraries
.add("scalatestplus", version = "3.1.0.0-RC2", org = "org.scalatestplus", "scalatestplus-scalacheck")
.add("discipline-scalatest", version = "1.0.0-RC1", org = org.typelevel.typeLevelOrg)
val apache2 = "Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0.html")
val gh = GitHubSettings(org = "typelevel", proj = "cats-tagless", publishOrg = "org.typelevel", license = apache2)
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, docs)
.dependsOn(rootJVM, rootJS)
.settings(
noPublishSettings,
crossScalaVersions := Nil
)
lazy val rootJVM = project
.configure(mkRootJvmConfig(gh.proj, rootSettings, commonJvmSettings))
.aggregate(coreJVM, lawsJVM, testsJVM, macrosJVM)
.dependsOn(coreJVM, lawsJVM, testsJVM, macrosJVM)
.settings(noPublishSettings,
crossScalaVersions := Nil)
lazy val rootJS = project
.configure(mkRootJsConfig(gh.proj, rootSettings, commonJsSettings))
.aggregate(coreJS, lawsJS, testsJS, macrosJS)
.dependsOn(coreJS, lawsJS, testsJS, macrosJS)
.settings(
noPublishSettings,
crossScalaVersions := Nil
)
lazy val core = prj(coreM)
lazy val coreJVM = coreM.jvm
lazy val coreJS = coreM.js
lazy val coreM = module("core", CrossType.Pure)
.settings(libs.dependency("cats-core"))
.settings(simulacrumSettings(libs))
.enablePlugins(AutomateHeaderPlugin)
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(libs.dependency("cats-laws"))
.settings(disciplineDependencies)
.enablePlugins(AutomateHeaderPlugin)
lazy val macros = prj(macrosM)
lazy val macrosJVM = macrosM.jvm
lazy val macrosJS = macrosM.js
lazy val macrosM = module("macros", CrossType.Pure)
.dependsOn(coreM)
.aggregate(coreM)
.settings(scalaMacroDependencies(libs))
.settings(macroAnnotationsSettings)
.settings(copyrightHeader)
.settings(
libs.testDependencies("scalatest", "scalacheck"),
doctestTestFramework := DoctestTestFramework.ScalaCheck
)
.enablePlugins(AutomateHeaderPlugin)
lazy val tests = prj(testsM)
lazy val testsJVM = testsM.jvm
lazy val testsJS = testsM.js
lazy val testsM = module("tests", CrossType.Pure)
.dependsOn(macrosM, lawsM)
.settings(
libs.testDependencies("shapeless", "scalatest", "cats-free", "cats-effect", "cats-testkit", "scalatestplus-scalacheck", "discipline-scalatest"),
scalacOptions in Test := (scalacOptions in Test).value.filter(_ != "-Xfatal-warnings"),
scalaMacroDependencies(libs),
macroAnnotationsSettings,
noPublishSettings
)
.enablePlugins(AutomateHeaderPlugin)
/** Docs - Generates and publishes the scaladoc API documents and the project web site.*/
lazy val docs = project
.settings(rootSettings)
.settings(moduleName := gh.proj + "-docs")
.settings(noPublishSettings)
.settings(unidocCommonSettings)
.settings(commonJvmSettings)
.settings(scalaMacroDependencies(libs))
.settings(libs.dependency("cats-free"))
.dependsOn(List(macrosJVM).map( ClasspathDependency(_, Some("compile;test->test"))):_*)
.enablePlugins(MicrositesPlugin)
.enablePlugins(SiteScaladocPlugin)
.settings(
crossScalaVersions := crossScalaVersions.value.filterNot(_ == libs.vers("scalac_2.13")),
docsMappingsAPIDir := "api",
addMappingsToSiteDir(mappings in packageDoc in Compile in coreJVM, docsMappingsAPIDir),
organization := gh.organisation,
autoAPIMappings := true,
micrositeName := "Cats-tagless",
micrositeDescription := "A library of utilities for tagless final algebras",
micrositeBaseUrl := "cats-tagless",
micrositeGithubOwner := "typelevel",
micrositeGithubRepo := "cats-tagless",
micrositeHighlightTheme := "atom-one-light",
fork in tut := true,
micrositePalette := Map(
"brand-primary" -> "#51839A",
"brand-secondary" -> "#EDAF79",
"brand-tertiary" -> "#96A694",
"gray-dark" -> "#192946",
"gray" -> "#424F67",
"gray-light" -> "#E3E2E3",
"gray-lighter" -> "#F4F3F4",
"white-color" -> "#FFFFFF"),
ghpagesNoJekyll := false,
micrositeAuthor := "cats-tagless Contributors",
scalacOptions in Tut ~= (_.filterNot(Set("-Ywarn-unused-import", "-Ywarn-unused:imports", "-Ywarn-dead-code"))),
git.remoteRepo := gh.repo,
includeFilter in makeSite := "*.html" | "*.css" | "*.png" | "*.jpg" | "*.gif" | "*.js" | "*.swf" | "*.yml" | "*.md")
lazy val docsMappingsAPIDir = settingKey[String]("Name of subdirectory in site target directory for api docs")
lazy val buildSettings = sharedBuildSettings(gh, libs)
lazy val commonSettings = sharedCommonSettings ++ Seq(
parallelExecution in Test := false,
scalaVersion := libs.vers("scalac_2.12"),
crossScalaVersions := Seq(libs.vers("scalac_2.11"), scalaVersion.value, libs.vers("scalac_2.13")),
resolvers ++= Seq(Resolver.sonatypeRepo("releases"), Resolver.sonatypeRepo("snapshots")),
developers := List(
Developer("Georgi Krastev", "@joroKr21", "joro.kr.21@gmail.com", new java.net.URL("https://www.linkedin.com/in/georgykr")),
Developer("Kailuo Wang", "@kailuowang", "kailuo.wang@gmail.com", new java.net.URL("http://kailuowang.com")),
Developer("Luka Jacobowitz", "@LukaJCB", "luka.jacobowitz@fh-duesseldorf.de", new java.net.URL("http://stackoverflow.com/users/3795501/luka-jacobowitz")))
) ++ scalacAllSettings ++ unidocCommonSettings ++
addCompilerPlugins(libs, "kind-projector") ++ copyrightHeader
lazy val commonJsSettings = Seq(
scalaJSStage in Global := FastOptStage,
// currently sbt-doctest doesn't work in JS builds
// https://github.com/tkawachi/sbt-doctest/issues/52
doctestGenTests := Seq.empty
)
lazy val commonJvmSettings = Seq()
lazy val publishSettings = sharedPublishSettings(gh) ++ credentialSettings ++ sharedReleaseProcess
lazy val scoverageSettings = sharedScoverageSettings(60)
lazy val disciplineDependencies = libs.dependencies("discipline-core", "scalacheck")
lazy val copyrightHeader = Seq(
startYear := Some(2019),
organizationName := "cats-tagless maintainers"
)