forked from typelevel/skunk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
176 lines (160 loc) · 6.36 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
174
175
176
// This is used in a couple places
lazy val fs2Version = "2.4.4"
// Global Settings
lazy val commonSettings = Seq(
// Resolvers
resolvers += Resolver.sonatypeRepo("public"),
resolvers += Resolver.sonatypeRepo("snapshots"),
// Publishing
organization := "org.tpolecat",
licenses ++= Seq(("MIT", url("http://opensource.org/licenses/MIT"))),
homepage := Some(url("https://github.com/tpolecat/skunk")),
developers := List(
Developer("tpolecat", "Rob Norris", "rob_norris@mac.com", url("http://www.tpolecat.org"))
),
// Headers
headerMappings := headerMappings.value + (HeaderFileType.scala -> HeaderCommentStyle.cppStyleLineComment),
headerLicense := Some(HeaderLicense.Custom(
"""|Copyright (c) 2018-2020 by Rob Norris
|This software is licensed under the MIT License (MIT).
|For more information see LICENSE or https://opensource.org/licenses/MIT
|""".stripMargin
)
),
// Compilation
scalaVersion := "2.13.3",
crossScalaVersions := Seq("2.12.11", scalaVersion.value),
scalacOptions -= "-language:experimental.macros", // doesn't work cross-version
Compile / doc / scalacOptions --= Seq("-Xfatal-warnings"),
Compile / doc / scalacOptions ++= Seq(
"-groups",
"-sourcepath", (baseDirectory in LocalRootProject).value.getAbsolutePath,
"-doc-source-url", "https://github.com/tpolecat/skunk/blob/v" + version.value + "€{FILE_PATH}.scala",
),
addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.11.0" cross CrossVersion.full),
// Coverage Exclusions
coverageExcludedPackages := "ffstest.*;tests.*;example.*;natchez.http4s.*",
)
lazy val skunk = project
.in(file("."))
.enablePlugins(AutomateHeaderPlugin)
.settings(commonSettings)
.settings(publish / skip := true)
.dependsOn(macros, core, tests, circe, refined, example)
.aggregate(macros, core, tests, circe, refined, example)
lazy val macros = project
.in(file("modules/macros"))
.enablePlugins(AutomateHeaderPlugin)
.settings(commonSettings)
.settings(
name := "skunk-macros",
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value
)
)
lazy val core = project
.in(file("modules/core"))
.dependsOn(macros)
.enablePlugins(AutomateHeaderPlugin)
.settings(commonSettings)
.settings(
name := "skunk-core",
description := "Tagless, non-blocking data access library for Postgres.",
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-core" % "2.1.1",
"org.typelevel" %% "cats-effect" % "2.1.4",
"co.fs2" %% "fs2-core" % fs2Version,
"co.fs2" %% "fs2-io" % fs2Version,
"org.scodec" %% "scodec-core" % "1.11.7",
"org.scodec" %% "scodec-cats" % "1.0.0",
"com.beachape" %% "enumeratum" % "1.6.1",
"org.tpolecat" %% "natchez-core" % "0.0.12",
)
)
lazy val refined = project
.in(file("modules/refined"))
.dependsOn(core)
.enablePlugins(AutomateHeaderPlugin)
.settings(commonSettings)
.settings(
publish / skip := true,
libraryDependencies += "eu.timepit" %% "refined" % "0.9.15",
)
lazy val circe = project
.in(file("modules/circe"))
.dependsOn(core)
.enablePlugins(AutomateHeaderPlugin)
.settings(commonSettings)
.settings(
name := "skunk-circe",
libraryDependencies ++= Seq(
"io.circe" %% "circe-core" % "0.13.0",
"io.circe" %% "circe-parser" % "0.13.0"
)
)
lazy val tests = project
.in(file("modules/tests"))
.dependsOn(core, circe)
.enablePlugins(AutomateHeaderPlugin)
.settings(commonSettings)
.settings(
publish / skip := true,
test / parallelExecution := false, // why? fix this!
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-free" % "2.1.1",
"org.scala-sbt" % "test-interface" % "1.0",
"io.chrisdavenport" %% "cats-time" % "0.3.4"
),
testFrameworks += new TestFramework("ffstest.FFramework")
)
lazy val example = project
.in(file("modules/example"))
.dependsOn(core)
.enablePlugins(AutomateHeaderPlugin)
.settings(commonSettings)
.settings(
publish / skip := true,
libraryDependencies ++= Seq(
"org.tpolecat" %% "natchez-honeycomb" % "0.0.12",
"org.tpolecat" %% "natchez-jaeger" % "0.0.12",
"org.http4s" %% "http4s-dsl" % "0.21.7",
"org.http4s" %% "http4s-blaze-server" % "0.21.7",
"org.http4s" %% "http4s-circe" % "0.21.7",
"io.circe" %% "circe-generic" % "0.13.0",
)
)
lazy val docs = project
.in(file("modules/docs"))
.dependsOn(core)
.enablePlugins(AutomateHeaderPlugin)
.enablePlugins(ParadoxPlugin)
.enablePlugins(ParadoxSitePlugin)
.enablePlugins(GhpagesPlugin)
.enablePlugins(MdocPlugin)
.settings(commonSettings)
.settings(
scalacOptions := Nil,
git.remoteRepo := "git@github.com:tpolecat/skunk.git",
ghpagesNoJekyll := true,
publish / skip := true,
paradoxTheme := Some(builtinParadoxTheme("generic")),
version := version.value.takeWhile(_ != '+'), // strip off the +3-f22dca22+20191110-1520-SNAPSHOT business
paradoxProperties ++= Map(
"scala-versions" -> (crossScalaVersions in core).value.map(CrossVersion.partialVersion).flatten.map(_._2).mkString("2.", "/", ""),
"org" -> organization.value,
"scala.binary.version" -> s"2.${CrossVersion.partialVersion(scalaVersion.value).get._2}",
"core-dep" -> s"${(core / name).value}_2.${CrossVersion.partialVersion(scalaVersion.value).get._2}",
"circe-dep" -> s"${(circe / name).value}_2.${CrossVersion.partialVersion(scalaVersion.value).get._2}",
"version" -> version.value,
"scaladoc.skunk.base_url" -> s"https://static.javadoc.io/org.tpolecat/skunk-core_2.12/${version.value}",
"scaladoc.fs2.io.base_url"-> s"https://static.javadoc.io/co.fs2/fs2-io_2.12/${fs2Version}",
),
mdocIn := (baseDirectory.value) / "src" / "main" / "paradox",
Compile / paradox / sourceDirectory := mdocOut.value,
makeSite := makeSite.dependsOn(mdoc.toTask("")).value,
mdocExtraArguments := Seq("--no-link-hygiene"), // paradox handles this
libraryDependencies ++= Seq(
"org.tpolecat" %% "natchez-jaeger" % "0.0.12",
),
)