-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
121 lines (113 loc) · 4.17 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
import fs2.grpc.buildinfo.BuildInfo
val scalaVersion_ = "3.2.0"
val http4sVersion = "0.23.14"
val configVersion = "1.3.1"
val catsEffectVersion = "3.4.8"
val scalatestVersion = "3.2.15"
val circeVersion = "0.14.4"
val pureConfigVersion = "0.17.2"
val scalaLogVersion = "3.9.5"
val slf4jVersion = "2.0.7"
val sangriaVersion = "3.5.3"
val sangriaCirceVersion = "1.3.2"
ThisBuild / scalaVersion := scalaVersion_
lazy val commonSettings =
Seq(
organization := "org.bitlap",
scalaVersion := scalaVersion_,
scalacOptions ++= Seq(
"-unchecked",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-language:postfixOps",
"-deprecation"
)
)
lazy val assemblySettings = Seq(
assembly / assemblyJarName := name.value + ".jar",
assembly / assemblyMergeStrategy := {
case PathList("META-INF", xs @ _*) => MergeStrategy.discard
case "application.conf" => MergeStrategy.concat
case x =>
val oldStrategy = (assembly / assemblyMergeStrategy).value
oldStrategy(x)
}
)
lazy val weather = project
.in(file("."))
.settings(commonSettings)
.disablePlugins(AssemblyPlugin)
.aggregate(
`weather-protobuf`,
`weather-client`,
`weather-server`
)
addCommandAlias("fmt", "all scalafmtSbt scalafmt test:scalafmt")
lazy val `weather-protobuf` = project
.in(file("weather-protobuf"))
.settings(commonSettings)
.settings(
name := "weather-protobuf",
// Compile / PB.targets := Seq(
// scalapb.gen(grpc = true) -> (Compile / sourceManaged).value, {
// protocbridge.SandboxedJvmGenerator.forModule(
// "scala-fs2-grpc",
// protocbridge.Artifact(
// BuildInfo.organization,
// s"${BuildInfo.codeGeneratorName}_${CrossVersion.binaryScalaVersion(BuildInfo.scalaVersion)}",
// BuildInfo.version
// ),
// BuildInfo.codeGeneratorFullName + "$",
// Nil
// )
// } -> (Compile / sourceManaged).value / "fs2-grpc"
// ),
libraryDependencies ++= Seq(
"io.grpc" % "grpc-netty-shaded" % scalapb.compiler.Version.grpcJavaVersion,
"com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % "protobuf"
)
)
.enablePlugins(Fs2Grpc)
.disablePlugins(AssemblyPlugin)
lazy val `weather-client` = project
.in(file("weather-client"))
.settings(
name := "weather-client",
commonSettings,
assemblySettings,
libraryDependencies ++= Seq(
"com.typesafe" % "config" % configVersion withSources (),
"org.typelevel" %% "cats-effect" % catsEffectVersion withSources ()
)
)
.dependsOn(
`weather-protobuf`
)
lazy val `weather-server` = project
.in(file("weather-server"))
.settings(
name := "weather-server",
commonSettings,
assemblySettings,
libraryDependencies ++= Seq(
"com.typesafe" % "config" % configVersion withSources (),
"org.typelevel" %% "cats-effect" % catsEffectVersion withSources (),
"com.github.pureconfig" %% "pureconfig-core" % pureConfigVersion withSources (),
"org.http4s" %% "http4s-dsl" % http4sVersion withSources (),
"org.http4s" %% "http4s-blaze-client" % http4sVersion withSources (),
"org.http4s" %% "http4s-blaze-server" % http4sVersion withSources (),
"org.http4s" %% "http4s-circe" % http4sVersion withSources (),
"io.circe" %% "circe-parser" % circeVersion withSources (),
"io.circe" %% "circe-generic" % circeVersion withSources (),
"io.circe" %% "circe-core" % circeVersion withSources (),
"org.slf4j" % "slf4j-api" % slf4jVersion withSources (),
"org.slf4j" % "slf4j-simple" % slf4jVersion withSources (),
"org.sangria-graphql" %% "sangria" % sangriaVersion withSources (),
"org.sangria-graphql" %% "sangria-circe" % sangriaCirceVersion withSources ()
)
)
.dependsOn(
`weather-protobuf`
)