This repository has been archived by the owner on Nov 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
180 lines (172 loc) · 7.31 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
177
178
179
180
import microsites._
import sbtorgpolicies.OrgPoliciesPlugin.autoImport._
import sbtorgpolicies.model._
import sbtorgpolicies.runnable.syntax._
import sbtorgpolicies.templates._
import sbtorgpolicies.templates.badges._
lazy val V = new {
val betterMonadicFor: String = "0.3.1"
val cats: String = "2.1.1"
val catsEffect: String = "2.1.4"
val catsScalacheck: String = "0.3.0"
val contextApplied: String = "0.1.4"
val mouse: String = "0.25"
val circe: String = "0.13.0"
val kindProjector: String = "0.11.0"
val paradise: String = "2.1.1"
val scala: String = "2.13.2"
val skeumorph: String = "0.0.24"
val specs2: String = "4.10.0"
val enumeratum: String = "1.6.1"
val enumeratumCirce: String = "1.6.1"
val http4s: String = "0.21.6"
val shapeless: String = "2.3.3"
val pureConfig: String = "0.13.0"
val doobie: String = "0.9.0"
val flyway: String = "6.5.1"
val refined: String = "0.9.14"
val slf4j: String = "1.7.30"
}
lazy val root = project
.enablePlugins(UniversalPlugin, JavaAppPackaging, BuildInfoPlugin)
.in(file("."))
.settings(commonSettings)
.settings(serverSettings)
.settings(noPublishSettings)
.settings(
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion),
buildInfoPackage := "buildinfo",
name := "compendium-server",
scalacOptions -= "-Xfuture"
)
lazy val docs = project
.in(file("docs"))
.dependsOn(root)
.settings(moduleName := "compendium-docs")
.settings(commonSettings)
.settings(noPublishSettings)
.settings(
micrositeName := "Compendium",
micrositeDescription := "IDL protocol management and distribution at speed of light",
micrositeBaseUrl := "/compendium",
micrositeGithubOwner := "higherkindness",
micrositeGithubRepo := "compendium",
micrositeHighlightTheme := "dracula",
micrositeDocumentationUrl := "docs",
micrositeOrganizationHomepage := "http://www.47deg.com",
includeFilter in Jekyll := "*.html" | "*.css" | "*.png" | "*.jpg" | "*.gif" | "*.js" | "*.swf" | "*.md" | "*.svg",
micrositeGithubToken := getEnvVar(orgGithubTokenSetting.value),
micrositePushSiteWith := GitHub4s,
micrositePalette := Map(
"brand-primary" -> "#3d5afe",
"brand-secondary" -> "#0125ed",
"white-color" -> "#FFF"
),
scalacOptions in console ~= filterConsoleScalacOptions,
scalacOptions in doc ~= filterConsoleScalacOptions,
scalacOptions in Tut ~= filterConsoleScalacOptions,
scalacOptions in Tut += "-language:postfixOps"
)
.enablePlugins(MicrositesPlugin)
pgpPassphrase := Some(getEnvVar("PGP_PASSPHRASE").getOrElse("").toCharArray)
//General Settings
lazy val commonSettings = Seq(
orgProjectName := "compendium",
orgGithubSetting := GitHubSettings(
organization = "higherkindness",
project = (name in LocalRootProject).value,
organizationName = "47 Degrees",
groupId = "io.higherkindness",
organizationHomePage = url("http://47deg.com"),
organizationEmail = "[email protected]"
),
startYear := Some(2018),
scalaVersion := V.scala,
crossScalaVersions := Seq(scalaVersion.value),
ThisBuild / scalacOptions -= "-Xplugin-require:macroparadise",
libraryDependencies ++= Seq(
%%("cats-core", V.cats),
%%("cats-effect", V.catsEffect),
"org.typelevel" %% "mouse" % V.mouse,
%%("shapeless", V.shapeless),
%%("pureconfig", V.pureConfig),
"com.github.pureconfig" %% "pureconfig-generic" % V.pureConfig,
"com.github.pureconfig" %% "pureconfig-cats-effect" % V.pureConfig,
"com.github.pureconfig" %% "pureconfig-enumeratum" % V.pureConfig,
"io.higherkindness" %% "skeuomorph" % V.skeumorph,
"org.tpolecat" %% "doobie-refined" % V.doobie,
"com.beachape" %% "enumeratum" % V.enumeratum,
"com.beachape" %% "enumeratum-circe" % V.enumeratumCirce,
"org.flywaydb" % "flyway-core" % V.flyway,
"org.typelevel" %% "mouse" % V.mouse,
%%("cats-core", V.cats),
%%("cats-effect", V.catsEffect),
%%("shapeless", V.shapeless),
%%("pureconfig", V.pureConfig),
%%("http4s-dsl", V.http4s),
%%("http4s-blaze-server", V.http4s),
%%("http4s-circe", V.http4s),
%%("circe-core", V.circe),
%%("circe-generic", V.circe),
%%("doobie-core", V.doobie),
%%("doobie-postgres", V.doobie),
%%("doobie-hikari", V.doobie),
%%("specs2-core", V.specs2) % Test,
%%("specs2-scalacheck", V.specs2) % Test,
%%("doobie-specs2", V.doobie) % Test,
"io.chrisdavenport" %% "cats-scalacheck" % V.catsScalacheck % Test,
"io.chrisdavenport" %% "testcontainers-specs2" % "0.2.0-M2" % Test,
"org.testcontainers" % "postgresql" % "1.14.3" % Test
),
orgScriptTaskListSetting := List(
(clean in Global).asRunnableItemFull,
(compile in Compile).asRunnableItemFull,
(test in Test).asRunnableItemFull,
"docs/tut".asRunnableItem
),
orgMaintainersSetting := List(
Dev("47degdev", Some("47 Degrees (twitter: @47deg)"), Some("[email protected]"))
),
// format: OFF
orgBadgeListSetting := List(
TravisBadge.apply,
CodecovBadge.apply, { info => MavenCentralBadge.apply(info.copy(libName = "compendium")) },
ScalaLangBadge.apply,
LicenseBadge.apply, { info => GitterBadge.apply(info.copy(owner = "higherkindness", repo = "compendium")) },
GitHubIssuesBadge.apply
),
orgEnforcedFilesSetting := List(
LicenseFileType(orgGithubSetting.value, orgLicenseSetting.value, startYear.value),
ContributingFileType( orgProjectName.value, orgGithubSetting.value.copy(organization = "higherkindness", project = "compendium")),
AuthorsFileType(name.value, orgGithubSetting.value, orgMaintainersSetting.value, orgContributorsSetting.value),
NoticeFileType(orgProjectName.value, orgGithubSetting.value, orgLicenseSetting.value, startYear.value),
VersionSbtFileType,
ChangelogFileType,
ReadmeFileType(orgProjectName.value, orgGithubSetting.value, startYear.value, orgLicenseSetting.value, orgCommitBranchSetting.value, sbtPlugin.value, name.value, version.value, scalaBinaryVersion.value, sbtBinaryVersion.value, orgSupportedScalaJSVersion.value, orgBadgeListSetting.value ),
ScalafmtFileType,
TravisFileType(crossScalaVersions.value, orgScriptCICommandKey, orgAfterCISuccessCommandKey)
// format: ON
)
) ++ compilerPlugins
lazy val serverSettings = Seq(
parallelExecution in Test := false,
libraryDependencies ++= Seq(
"org.slf4j" % "slf4j-simple" % V.slf4j,
"eu.timepit" %% "refined" % V.refined,
"eu.timepit" %% "refined-scalacheck" % V.refined,
"io.chrisdavenport" %% "cats-scalacheck" % V.catsScalacheck % Test
)
)
lazy val compilerPlugins = Seq(
libraryDependencies ++= Seq(
compilerPlugin("org.typelevel" % "kind-projector" % V.kindProjector cross CrossVersion.full),
compilerPlugin("com.olegpy" %% "better-monadic-for" % V.betterMonadicFor),
compilerPlugin("org.augustjune" %% "context-applied" % V.contextApplied)
)
)
val noPublishSettings = Seq(
publish := {},
publishLocal := {},
publishArtifact := false,
skip in publish := true
)