-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.sbt
88 lines (67 loc) · 3 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
ThisBuild / crossScalaVersions := Seq("2.12.18", "2.13.12")
ThisBuild / scalaVersion := crossScalaVersions.value.last
ThisBuild / githubWorkflowArtifactUpload := false
ThisBuild / githubWorkflowBuild := Seq(
WorkflowStep.Sbt(List("test")),
)
ThisBuild / githubWorkflowPublishTargetBranches := Seq.empty
ThisBuild / scalacOptions ++= Seq(
"-deprecation"
)
val http4sV = "0.23.16"
val circeV = "0.14.6"
val logbackClassicV = "1.4.4"
val munitCatsEffectV = "1.0.7"
val kindProjectorV = "0.13.2"
val betterMonadicForV = "0.3.1"
// Projects
lazy val `guardrail-sample-http4s` = project.in(file("."))
.settings(commonSettings)
.settings(
name := "guardrail-sample-http4s",
// Where all the magic lives
// Translates the openapi documentation into code generation targets
// after `sbt compile` files will be populated in
// `/src/target/scala-2.13/src_managed/main/example`
// with folder for server and client which hold their respective generated code.
Compile / guardrailTasks := List(
ScalaServer(file("server.yaml"), pkg="example.server", framework="http4s", tagsBehaviour=tagsAsPackage),
ScalaClient(file("server.yaml"), pkg="example.client", framework="http4s", tagsBehaviour=tagsAsPackage),
)
)
// General Settings
lazy val commonSettings = Seq(
testFrameworks += new TestFramework("munit.Framework"),
libraryDependencies ++= {
Seq(
compilerPlugin("org.typelevel" % "kind-projector" % kindProjectorV cross CrossVersion.full),
compilerPlugin("com.olegpy" %% "better-monadic-for" % betterMonadicForV),
)
},
libraryDependencies ++= Seq(
"org.http4s" %% "http4s-dsl" % http4sV,
"org.http4s" %% "http4s-ember-server" % http4sV,
"org.http4s" %% "http4s-ember-client" % http4sV,
"org.http4s" %% "http4s-circe" % http4sV,
"io.circe" %% "circe-core" % circeV,
"io.circe" %% "circe-generic" % circeV,
"io.circe" %% "circe-parser" % circeV,
"ch.qos.logback" % "logback-classic" % logbackClassicV,
"org.typelevel" %% "munit-cats-effect-3" % munitCatsEffectV % Test,
)
)
Compile / doc / scalacOptions ++= Seq(
"-groups",
"-sourcepath", (LocalRootProject / baseDirectory).value.getAbsolutePath,
"-doc-source-url", "https://github.com/guardrail-dev/guardrail-sample-http4s/blob/v" + version.value + "€{FILE_PATH}.scala"
)
// General Settings
inThisBuild(List(
organization := "com.example",
developers := List(
Developer("ChristopherDavenport", "Christopher Davenport", "[email protected]", url("https://github.com/ChristopherDavenport"))
),
homepage := Some(url("https://github.com/guardrail-dev/guardrail-sample-http4s")),
licenses += ("MIT", url("http://opensource.org/licenses/MIT")),
pomIncludeRepository := { _ => false},
))