-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sbt
112 lines (99 loc) · 3.21 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
name := "playground"
organization in ThisBuild := "edu.uic"
scalaVersion in ThisBuild := "2.13.5"
// PROJECTS
lazy val global = project
.in(file("."))
.settings(settings)
.disablePlugins(AssemblyPlugin)
.enablePlugins(CodegenPlugin)
.aggregate(
common,
example
)
lazy val common = project
.in(file("common"))
.settings(
name := "playground-common",
settings,
assemblySettings,
libraryDependencies ++= commonDependencies ++ Seq(
dependencies.scalaReflect,
dependencies.scalaGraphCore
)
)
lazy val example = project
.in(file("example"))
.settings(
name := "playground-example",
settings,
assemblySettings,
libraryDependencies ++= commonDependencies ++ Seq()
)
.dependsOn(common)
// DEPENDENCIES
lazy val dependencies =
new {
val scalaReflect = "org.scala-lang" % "scala-compiler" % "2.13.5"
val scalaGraphCore = "org.scala-graph" %% "graph-core" % "1.13.2"
val calibanClient = "com.github.ghostdogpr" %% "caliban-client" % "0.9.4"
val zioBackend = "com.softwaremill.sttp.client" %% "async-http-client-backend-zio" % "2.2.9"
val mongodbDriver = "org.mongodb.scala" %% "mongo-scala-driver" % "4.2.3"
val typesafeConfig = "com.typesafe" % "config" % "1.4.1"
val logbackClassic = "ch.qos.logback" % "logback-classic" % "1.2.3" % "runtime"
val scalaTest = "org.scalatest" %% "scalatest" % "3.2.3" % "test"
}
lazy val commonDependencies = Seq(
dependencies.typesafeConfig,
dependencies.logbackClassic,
dependencies.scalaTest,
dependencies.calibanClient,
dependencies.zioBackend,
dependencies.mongodbDriver
)
// SETTINGS
lazy val settings =
commonSettings //++ wartremoverSettings ++ scalafmtSettings
lazy val compilerOptions = Seq(
// format: off
"-deprecation",
"-encoding", "utf8",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-language:postfixOps",
"-unchecked",
"-Ymacro-annotations",
// format: on
)
lazy val commonSettings = Seq(
scalacOptions ++= compilerOptions,
resolvers ++= Seq(
"Local Maven Repository" at "file://" + Path.userHome.absolutePath + "/.m2/repository",
Resolver.sonatypeRepo("releases"),
Resolver.sonatypeRepo("snapshots")
)
)
//lazy val wartremoverSettings = Seq(
// wartremoverWarnings in (Compile, compile) ++= Warts.allBut(Wart.Throw),
// wartremoverExcluded ++= Seq(
// sourceManaged.value,
// baseDirectory.value / "common" / "src" / "main" / "scala" / "com" / "Github.scala"
// )
//)
//
//lazy val scalafmtSettings = Seq(
// scalafmtOnCompile := true,
// scalafmtTestOnCompile := true
//)
lazy val assemblySettings = Seq(
assemblyJarName in assembly := name.value + ".jar",
assemblyMergeStrategy in assembly := {
case PathList("META-INF", xs @ _*) => MergeStrategy.discard
case "application.conf" => MergeStrategy.concat
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
}
)