-
Notifications
You must be signed in to change notification settings - Fork 15
/
build.sbt
131 lines (121 loc) · 4.93 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
ThisBuild / organization := "io.higherkindness"
ThisBuild / githubOrganization := "47degrees"
ThisBuild / scalaVersion := "2.13.15"
ThisBuild / crossScalaVersions := Seq("2.12.20", "2.13.15")
addCommandAlias("ci-test", "scalafmtCheckAll; scalafmtSbtCheck; microsite/mdoc; +test")
addCommandAlias("ci-docs", "github; documentation/mdoc; headerCreateAll; microsite/publishMicrosite")
addCommandAlias("ci-publish", "github; ci-release")
lazy val skeuomorph = project
.in(file("."))
.settings(commonSettings)
.settings(moduleName := "skeuomorph")
lazy val microsite = project
.dependsOn(skeuomorph)
.settings(commonSettings)
.settings(publish / skip := true)
.settings(mdocSettings)
.settings(
micrositeName := "Skeuomorph",
micrositeDescription := "Skeuomorph is a library for transforming different schemas in Scala",
micrositeBaseUrl := "/skeuomorph",
micrositeHighlightTheme := "tomorrow",
micrositeDocumentationUrl := "docs",
Jekyll / includeFilter := "*.html" | "*.css" | "*.png" | "*.jpg" | "*.gif" | "*.js" | "*.swf" | "*.md" | "*.svg",
micrositeGithubToken := Option(System.getenv().get("GITHUB_TOKEN")),
micrositePushSiteWith := GitHub4s,
micrositeFavicons := Seq(microsites.MicrositeFavicon("favicon.png", "32x32")),
micrositePalette := Map(
"brand-primary" -> "#4A00D8",
"brand-secondary" -> "#FC00CD",
"white-color" -> "#FFF"
),
micrositeExtraMdFiles := Map(
file("CHANGELOG.md") -> microsites.ExtraMdFileConfig(
"changelog.md",
"docs",
Map("title" -> "changelog", "permalink" -> "docs/changelog/")
)
)
)
.enablePlugins(MicrositesPlugin)
lazy val documentation = project
.settings(mdocOut := file("."))
.settings(publish / skip := true)
.enablePlugins(MdocPlugin)
lazy val filterConsoleScalacOptions = { options: Seq[String] =>
options.filterNot(
Set(
"-Werror",
"-Wdead-code",
"-Wunused:imports",
"-Ywarn-unused",
"-Ywarn-unused:imports",
"-Ywarn-unused-import",
"-Ywarn-dead-code",
"-Xfatal-warnings"
)
)
}
// General Settings
lazy val commonSettings = Seq(
scalacOptions ~= (_ filterNot Set("-Xfuture", "-Xfatal-warnings").contains),
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-core" % "2.12.0",
"org.typelevel" %% "cats-effect" % "3.5.5",
"io.higherkindness" %% "droste-core" % "0.9.0",
"io.higherkindness" %% "droste-macros" % "0.9.0",
"org.apache.avro" % "avro" % "1.12.0",
"com.github.os72" % "protoc-jar" % "3.11.4",
"com.google.protobuf" % "protobuf-java" % "4.28.3",
"io.circe" %% "circe-core" % "0.14.10",
"io.circe" %% "circe-parser" % "0.14.10",
"io.circe" %% "circe-yaml" % "1.15.0",
"com.julianpeeters" %% "avrohugger-core" % "2.8.3" % Test,
"org.typelevel" %% "cats-laws" % "2.12.0" % Test,
"io.circe" %% "circe-testing" % "0.14.10" % Test,
"org.typelevel" %% "discipline-specs2" % "1.4.0" % Test,
"org.specs2" %% "specs2-core" % "4.12.4-js-ec" % Test,
"org.specs2" %% "specs2-scalacheck" % "4.12.4-js-ec" % Test,
"org.scalacheck" %% "scalacheck" % "1.18.1" % Test,
"io.chrisdavenport" %% "cats-scalacheck" % "0.3.2" % Test,
"org.scalatra.scalate" %% "scalate-core" % "1.10.1" % Test
)
) ++ compilerPlugins ++ macroSettings ++ Seq(
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, _)) =>
Seq(
"org.scalameta" %% "scalameta" % "4.9.7"
)
case _ => Seq.empty
})
)
lazy val mdocSettings = Seq(
scalacOptions ~= filterConsoleScalacOptions,
scalacOptions ~= (_ filterNot Set("-Xfatal-warnings", "-Ywarn-unused-import", "-Xlint").contains)
)
lazy val compilerPlugins = Seq(
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, _)) =>
Seq(
compilerPlugin("org.typelevel" % "kind-projector" % "0.13.3" cross CrossVersion.full),
compilerPlugin("com.olegpy" %% "better-monadic-for" % "0.3.1")
)
case _ => Seq.empty
})
)
lazy val macroSettings: Seq[Setting[_]] = Seq(
libraryDependencies ++= Seq(
scalaOrganization.value % "scala-compiler" % scalaVersion.value % Provided
),
libraryDependencies ++= on(2, 12)(
compilerPlugin("org.scalamacros" %% "paradise" % "2.1.1" cross CrossVersion.full)
).value,
scalacOptions ++= on(2, 13)("-Ymacro-annotations").value
)
def on[A](major: Int, minor: Int)(a: A): Def.Initialize[Seq[A]] =
Def.setting {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some(v) if v == (major, minor) => Seq(a)
case _ => Nil
}
}