-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathbuild.sbt
More file actions
149 lines (142 loc) · 7.63 KB
/
Copy pathbuild.sbt
File metadata and controls
149 lines (142 loc) · 7.63 KB
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
//import xerial.sbt.pack.PackPlugin._
lazy val psforeverSettings = Seq(
organization := "net.psforever",
version := "1.0.2-SNAPSHOT",
scalaVersion := "2.13.16",
Global / cancelable := false,
// Disabled: sbt-scalafix 0.10.4 pins semanticdb 4.6.0, which has no build for Scala 2.13.16.
// Re-enable alongside an sbt-scalafix bump that supplies a 2.13.16-compatible semanticdb.
// This only affects the scalafix linter, not compilation or tests.
semanticdbEnabled := false,
//semanticdbVersion := scalafixSemanticdb.revision,
scalacOptions := Seq(
"-unchecked",
"-feature",
"-deprecation",
"-encoding",
"utf8",
"-language:postfixOps",
"-Wunused:imports",
"-Xmacro-settings:materialize-derivations"
),
// Quiet test options
// https://github.com/etorreborre/specs2/blob/8305db76c5084e4b3ce5827ce23117f6fb6beee4/common/shared/src/main/scala/org/specs2/main/Report.scala#L94
// https://etorreborre.github.io/specs2/guide/SPECS2-2.4.17/org.specs2.guide.Runners.html
QuietTest / testOptions += Tests.Argument(TestFrameworks.Specs2, "showOnly", "x!"),
// http://www.scalatest.org/user_guide/using_the_runner
QuietTest / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-oCEHILMNOPQRX"),
// Trick taken from https://groups.google.com/d/msg/scala-user/mxV9ok7J_Eg/kt-LnsrD0bkJ
// scaladoc flags: https://github.com/scala/scala/blob/2.11.x/src/scaladoc/scala/tools/nsc/doc/Settings.scala
Compile / doc / scalacOptions ++= Seq(
"-groups",
"-doc-title",
"PSF-LoginServer - ",
"-doc-version",
"master",
// For non unidoc builds, you may need bd.getName before the template parameter
"-doc-source-url",
"https://github.com/psforever/PSF-LoginServer/blob/master/€{FILE_PATH}.scala",
"-sourcepath",
baseDirectory.value.getAbsolutePath // needed for scaladoc relative source paths
),
classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.Flat,
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
libraryDependencies ++= Seq(
// Apache Pekko: the Apache-2.0 licensed fork of Akka 2.6.x (drop-in namespace change).
// NOTE: pekko-protobuf-v3 / pekko-stream / pekko-cluster-typed / pekko-cluster-tools /
// pekko-coordination / pekko-http currently have 0 direct imports in the source tree and
// are kept only for behavioral parity with the Akka set; they are removal candidates once
// the test suite is green.
"org.apache.pekko" %% "pekko-actor" % "1.1.3",
"org.apache.pekko" %% "pekko-slf4j" % "1.1.3",
"org.apache.pekko" %% "pekko-protobuf-v3" % "1.1.3",
"org.apache.pekko" %% "pekko-stream" % "1.1.3",
"org.apache.pekko" %% "pekko-testkit" % "1.1.3" % "test",
"org.apache.pekko" %% "pekko-actor-typed" % "1.1.3",
"org.apache.pekko" %% "pekko-actor-testkit-typed" % "1.1.3" % "test",
"org.apache.pekko" %% "pekko-cluster-typed" % "1.1.3",
"org.apache.pekko" %% "pekko-coordination" % "1.1.3",
"org.apache.pekko" %% "pekko-cluster-tools" % "1.1.3",
"org.apache.pekko" %% "pekko-http" % "1.1.0",
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.5",
"org.specs2" %% "specs2-core" % "4.20.9" % "test",
"org.scalatest" %% "scalatest" % "3.2.19" % "test",
"org.scodec" %% "scodec-core" % "1.11.10",
"ch.qos.logback" % "logback-classic" % "1.5.18",
"org.log4s" %% "log4s" % "1.10.0",
"org.fusesource.jansi" % "jansi" % "2.4.1",
"com.github.nscala-time" %% "nscala-time" % "2.34.0",
"com.github.t3hnar" %% "scala-bcrypt" % "4.3.0",
"org.scala-graph" %% "graph-core" % "1.13.5",
"io.kamon" %% "kamon-bundle" % "2.7.7",
"io.kamon" %% "kamon-apm-reporter" % "2.7.7",
"org.json4s" %% "json4s-native" % "4.0.7",
"io.getquill" %% "quill-jasync-postgres" % "3.18.0",
"org.flywaydb" % "flyway-core" % "10.20.1",
// Flyway 10 is modular: the PostgreSQL dialect moved into its own artifact.
"org.flywaydb" % "flyway-database-postgresql" % "10.20.1",
"org.postgresql" % "postgresql" % "42.7.4",
"com.typesafe" % "config" % "1.4.3",
"com.github.pureconfig" %% "pureconfig" % "0.17.7",
"com.beachape" %% "enumeratum" % "1.7.3",
"commons-io" % "commons-io" % "2.16.1",
"com.github.scopt" %% "scopt" % "4.1.0",
"io.sentry" % "sentry-logback" % "6.34.0",
"io.circe" %% "circe-core" % "0.14.9",
"io.circe" %% "circe-generic" % "0.14.9",
"io.circe" %% "circe-parser" % "0.14.9",
"org.scala-lang.modules" %% "scala-parallel-collections" % "1.0.4",
"org.bouncycastle" % "bcprov-jdk18on" % "1.78.1"
),
dependencyOverrides ++= Seq(
"com.github.jasync-sql" % "jasync-postgresql" % "1.2.3",
"org.scala-lang.modules" %% "scala-java8-compat" % "1.0.2"
)
// TODO(chord): remove exclusion when SessionActor is refactored: https://github.com/psforever/PSF-LoginServer/issues/279
// coverageExcludedPackages := "net\\.psforever\\.actors\\.session\\.SessionActor.*"
)
lazy val psforever = (project in file("."))
.configs(QuietTest)
.settings(psforeverSettings: _*)
.settings(
name := "psforever",
// Copy all tests from Test -> QuietTest (we're only changing the run options)
inConfig(QuietTest)(Defaults.testTasks)
)
lazy val server = (project in file("server"))
.configs(QuietTest)
.enablePlugins(PackPlugin)
.settings(psforeverSettings: _*)
.settings(
name := "server",
// ActorTests have specific timing requirements and will be flaky if run in parallel
Test / parallelExecution := false,
// Copy all tests from Test -> QuietTest (we're only changing the run options)
inConfig(QuietTest)(Defaults.testTasks),
packMain := Map("psforever-server" -> "net.psforever.server.Server"),
packArchivePrefix := "psforever-server",
packJvmOpts := Map("psforever-server" -> Seq("-Dstacktrace.app.packages=net.psforever")),
packExtraClasspath := Map("psforever-server" -> Seq("${PROG_HOME}/config")),
packResourceDir += ((psforever / baseDirectory).value / "config" -> "config")
)
.dependsOn(psforever)
lazy val decodePackets = (project in file("tools/decode-packets"))
.enablePlugins(PackPlugin)
.settings(psforeverSettings: _*)
.settings(
packMain := Map("psforever-decode-packets" -> "net.psforever.tools.decodePackets.DecodePackets")
)
.dependsOn(psforever)
lazy val client = (project in file("tools/client"))
.enablePlugins(PackPlugin)
.settings(psforeverSettings: _*)
.dependsOn(psforever)
// Special test configuration for really quiet tests (used in CI)
lazy val QuietTest = config("quiet") extend Test
lazy val docs = (project in file("docs"))
.settings(psforeverSettings: _*)
//.enablePlugins(ScalaUnidocPlugin)
.settings(
name := "psforever"
)
.aggregate(psforever, server, decodePackets)