-
Notifications
You must be signed in to change notification settings - Fork 15
/
build.sbt
126 lines (114 loc) · 4.01 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
import Dependencies._
import microsites.ExtraMdFileConfig
ThisBuild / organizationName := "ProfunKtor"
ThisBuild / crossScalaVersions := List("2.12.20", "2.13.15", "3.3.4")
// publishing
ThisBuild / name := """http4s-jwt-auth"""
ThisBuild / organization := "dev.profunktor"
ThisBuild / homepage := Some(url("https://http4s-jwt-auth.profunktor.dev/"))
ThisBuild / licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0"))
ThisBuild / developers := List(
Developer(
"gvolpe",
"Gabriel Volpe",
url("https://gvolpe.com")
)
)
ThisBuild / versionScheme := Some("early-semver")
def maxClassFileName(v: String) = CrossVersion.partialVersion(v) match {
case Some((2, 13)) | Some((3, _)) => List.empty[String]
case _ => List("-Xmax-classfile-name", "100")
}
def scalacVaryingOptions(scalaVersion: String) = CrossVersion.partialVersion(scalaVersion) match {
case Some((3, _)) => List("-source:future")
case _ => List("-Xsource:3")
}
def compilerPlugins(scalaVersion: String) = CrossVersion.partialVersion(scalaVersion) match {
case Some((3, _)) => List()
case _ => List(CompilerPlugins.kindProjector, CompilerPlugins.betterMonadicFor)
}
val commonSettings = List(
organizationName := "Opinionated JWT authentication library for Http4s",
startYear := Some(2019),
licenses += ("Apache-2.0", new URL("https://www.apache.org/licenses/LICENSE-2.0.txt")),
homepage := Some(url("https://http4s-jwt-auth.profunktor.dev/")),
headerLicense := Some(HeaderLicense.ALv2("2019", "ProfunKtor")),
resolvers += "Apache public" at "https://repository.apache.org/content/groups/public/",
scalacOptions ++= maxClassFileName(scalaVersion.value),
scalafmtOnCompile := true,
testFrameworks += new TestFramework("munit.Framework")
)
lazy val noPublish = List(
publish := {},
publishLocal := {},
publishArtifact := false,
publish / skip := true
)
lazy val noMima = List(
mimaPreviousArtifacts := Set.empty
)
lazy val root = (project in file("."))
.aggregate(core, microsite)
.settings(noPublish)
.settings(noMima)
lazy val core = project
.in(file("core"))
.settings(
name := "http4s-jwt-auth",
mimaPreviousArtifacts := Set("dev.profunktor" %% "http4s-jwt-auth" % "2.0.0"),
scalacOptions ++= scalacVaryingOptions(scalaVersion.value),
libraryDependencies ++=
compilerPlugins(scalaVersion.value) :::
List(
Libraries.cats,
Libraries.catsEffect,
Libraries.fs2,
Libraries.http4sDsl,
Libraries.http4sServer,
Libraries.jwtCore,
Libraries.munit % Test
)
)
.settings(commonSettings: _*)
lazy val microsite = project
.in(file("site"))
.enablePlugins(MicrositesPlugin)
.settings(commonSettings: _*)
.settings(noPublish)
.settings(noMima)
.settings(publishLocalConfiguration := publishLocalConfiguration.value.withOverwrite(true))
.settings(
micrositeName := "Http4s Jwt Auth",
micrositeDescription := "Opinionated JWT authentication library for Http4s",
micrositeAuthor := "ProfunKtor",
micrositeGithubOwner := "profunktor",
micrositeGithubRepo := "http4s-jwt-auth",
micrositeBaseUrl := "",
micrositeExtraMdFiles := Map(
file("README.md") -> ExtraMdFileConfig(
"index.md",
"home",
Map("title" -> "Home", "position" -> "0")
),
file("CODE_OF_CONDUCT.md") -> ExtraMdFileConfig(
"CODE_OF_CONDUCT.md",
"page",
Map("title" -> "Code of Conduct")
)
),
micrositeExtraMdFilesOutput := (Compile / resourceManaged).value / "jekyll",
micrositeGitterChannel := true,
micrositeGitterChannelUrl := "profunktor-dev/http4s-jwt-auth",
scalacOptions --= List(
"-Werror",
"-Xfatal-warnings",
"-Ywarn-unused-import",
"-Ywarn-numeric-widen",
"-Ywarn-dead-code",
"-Xlint:-missing-interpolator,_"
)
)
.dependsOn(core)
// CI build
addCommandAlias("fullBuild", ";clean;+test;+mimaReportBinaryIssues;mdoc")