-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
130 lines (117 loc) · 3.86 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
name := "project20"
organization in ThisBuild := "se.kth.id2203"
version in ThisBuild := "1.2.1-SNAPSHOT"
scalaVersion in ThisBuild := "2.13.1"
// PROJECTS
lazy val global = project
.in(file("."))
.settings(settings)
.aggregate(
common,
server,
client
)
lazy val common = (project in file("common"))
.settings(
name := "common",
settings,
libraryDependencies ++= commonDependencies
)
lazy val server = (project in file("server"))
.settings(
name := "server",
settings,
assemblySettings,
libraryDependencies ++= commonDependencies ++ Seq(
deps.logback,
deps.kSim % "test"
)
)
.dependsOn(
common
)
lazy val client = (project in file("client"))
.settings(
name := "client",
settings,
assemblySettings,
libraryDependencies ++= commonDependencies ++ Seq(
deps.log4j,
deps.log4jSlf4j,
deps.jline,
deps.fastparse
)
)
.dependsOn(
common
)
// DEPENDENCIES
lazy val deps =
new {
val logbackV = "1.2.+"
val scalaLoggingV = "3.9.+"
val scalatestV = "3.1.0"
val kompicsV = "1.2.1"
val kompicsScalaV = "2.0.+"
val commonUtilsV = "2.1.0"
val scallopV = "3.3.0"
val jlineV = "3.5.1"
val log4jV = "1.2.+"
val slf4jV = "1.7.+"
val fastparseV = "2.1.3"
val logback = "ch.qos.logback" % "logback-classic" % logbackV
val scalaLogging = "com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingV
val scalatest = "org.scalatest" %% "scalatest" % scalatestV
val kompics = "se.sics.kompics" %% "kompics-scala" % kompicsScalaV
val kNetwork = "se.sics.kompics.basic" % "kompics-port-network" % kompicsV
val nettyNetwork = "se.sics.kompics.basic" % "kompics-component-netty-network" % kompicsV
val kTimer = "se.sics.kompics.basic" % "kompics-port-timer" % kompicsV
val javaTimer = "se.sics.kompics.basic" % "kompics-component-java-timer" % kompicsV
val kSim = "se.sics.kompics" %% "kompics-scala-simulator" % kompicsScalaV
val commonUtils = "com.larskroll" %% "common-utils-scala" % commonUtilsV
val scallop = "org.rogach" %% "scallop" % scallopV
val jline = "org.jline" % "jline" % jlineV
val log4j = "log4j" % "log4j" % log4jV
val log4jSlf4j = "org.slf4j" % "slf4j-log4j12" % slf4jV
val fastparse = "com.lihaoyi" %% "fastparse" % fastparseV
}
lazy val commonDependencies = Seq(
deps.scalaLogging,
deps.kompics,
deps.kNetwork,
deps.nettyNetwork,
deps.kTimer,
deps.javaTimer,
deps.commonUtils,
deps.scallop,
deps.scalatest % "test"
)
// SETTINGS
lazy val compilerOptions = Seq(
"-unchecked",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-language:postfixOps",
"-deprecation",
"-encoding",
"utf8"
)
lazy val settings = Seq(
scalacOptions ++= compilerOptions,
resolvers ++= Seq(
Resolver.jcenterRepo,
Resolver.bintrayRepo("kompics", "Maven"),
Resolver.bintrayRepo("lkrollcom", "maven"),
Resolver.mavenLocal
),
updateOptions := updateOptions.value.withCachedResolution(false)
)
lazy val assemblySettings = Seq(
assemblyJarName in assembly := name.value + ".jar",
assemblyMergeStrategy in assembly := {
case PathList("META-INF", xs @ _*) => MergeStrategy.discard
case _ => MergeStrategy.first
}
)