2020-01-13 22:59:24 +00:00
|
|
|
import xerial.sbt.pack.PackPlugin._
|
|
|
|
|
|
2016-02-05 08:19:13 +00:00
|
|
|
lazy val commonSettings = Seq(
|
2016-05-03 08:04:36 +00:00
|
|
|
organization := "net.psforever",
|
2016-08-05 22:11:46 +00:00
|
|
|
version := "1.0.2-SNAPSHOT",
|
2016-07-29 06:42:10 +00:00
|
|
|
scalaVersion := "2.11.8",
|
2019-10-11 15:50:00 +00:00
|
|
|
scalacOptions := Seq("-unchecked", "-feature", "-deprecation", "-encoding", "utf8", "-language:postfixOps"),
|
2020-01-08 13:33:25 +00:00
|
|
|
|
|
|
|
|
// 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
|
|
|
|
|
testOptions in QuietTest += Tests.Argument(TestFrameworks.Specs2, "showOnly", "x!"),
|
|
|
|
|
// http://www.scalatest.org/user_guide/using_the_runner
|
|
|
|
|
testOptions in QuietTest += Tests.Argument(TestFrameworks.ScalaTest, "-oCEHILMNOPQRX"),
|
2019-10-21 20:29:36 +00:00
|
|
|
// Trick taken from https://groups.google.com/d/msg/scala-user/mxV9ok7J_Eg/kt-LnsrD0bkJ
|
2020-01-08 13:33:25 +00:00
|
|
|
// scaladoc flags: https://github.com/scala/scala/blob/2.11.x/src/scaladoc/scala/tools/nsc/doc/Settings.scala
|
2020-01-13 22:59:24 +00:00
|
|
|
scalacOptions in (Compile,doc) := { Seq(
|
2019-10-21 20:29:36 +00:00
|
|
|
"-groups",
|
|
|
|
|
"-implicits",
|
|
|
|
|
"-doc-title", "PSF-LoginServer - ",
|
|
|
|
|
"-doc-version", "master",
|
|
|
|
|
"-doc-footer", "Copyright PSForever",
|
|
|
|
|
// 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",
|
2020-01-13 22:59:24 +00:00
|
|
|
"-sourcepath", baseDirectory.value.getAbsolutePath // needed for scaladoc relative source paths
|
2019-10-21 20:29:36 +00:00
|
|
|
)
|
|
|
|
|
},
|
2016-02-05 08:19:13 +00:00
|
|
|
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
|
2016-07-27 02:31:54 +00:00
|
|
|
libraryDependencies ++= Seq(
|
2016-06-04 01:47:45 +00:00
|
|
|
"com.typesafe.akka" %% "akka-actor" % "2.4.4",
|
2017-08-16 22:23:09 +00:00
|
|
|
"com.typesafe.akka" %% "akka-testkit" % "2.4.8" % "test",
|
2016-02-05 08:19:13 +00:00
|
|
|
"com.typesafe.scala-logging" %% "scala-logging" % "3.1.0",
|
2016-06-04 01:47:45 +00:00
|
|
|
"org.specs2" %% "specs2-core" % "3.8.3" % "test",
|
2017-08-16 22:23:09 +00:00
|
|
|
"org.scalatest" %% "scalatest" % "3.0.1" % "test",
|
2016-06-04 17:23:37 +00:00
|
|
|
"org.scodec" %% "scodec-core" % "1.10.0",
|
|
|
|
|
"org.scodec" %% "scodec-akka" % "0.2.0",
|
2016-05-01 08:37:36 +00:00
|
|
|
"net.java.dev.jna" % "jna" % "4.2.1",
|
2016-05-02 01:12:42 +00:00
|
|
|
"com.typesafe.akka" %% "akka-slf4j" % "2.4.4",
|
2016-05-01 08:37:36 +00:00
|
|
|
"ch.qos.logback" % "logback-classic" % "1.1.7",
|
|
|
|
|
"org.log4s" %% "log4s" % "1.3.0",
|
2016-07-27 02:31:54 +00:00
|
|
|
"org.fusesource.jansi" % "jansi" % "1.12",
|
2016-07-31 01:08:40 +00:00
|
|
|
"org.scoverage" %% "scalac-scoverage-plugin" % "1.1.1",
|
2017-03-04 19:55:43 +00:00
|
|
|
"com.github.nscala-time" %% "nscala-time" % "2.12.0",
|
2020-01-10 16:13:37 +00:00
|
|
|
"com.github.mauricio" %% "postgresql-async" % "0.2.21",
|
|
|
|
|
"com.github.t3hnar" %% "scala-bcrypt" % "3.1",
|
2019-12-10 14:17:55 +00:00
|
|
|
"org.ini4j" % "ini4j" % "0.5.4",
|
2020-04-29 18:59:12 +00:00
|
|
|
"org.scala-graph" %% "graph-core" % "1.12.5",
|
|
|
|
|
"io.kamon" %% "kamon-bundle" % "2.1.0",
|
|
|
|
|
"io.kamon" %% "kamon-apm-reporter" % "2.1.0"
|
2020-05-04 04:27:41 +00:00
|
|
|
),
|
|
|
|
|
classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.Flat
|
2016-02-05 08:19:13 +00:00
|
|
|
)
|
|
|
|
|
|
2016-07-25 22:34:40 +00:00
|
|
|
lazy val pscryptoSettings = Seq(
|
2016-07-27 01:32:31 +00:00
|
|
|
unmanagedClasspath in Test += (baseDirectory in ThisBuild).value / "pscrypto-lib",
|
2016-08-27 03:46:57 +00:00
|
|
|
unmanagedClasspath in Runtime += (baseDirectory in ThisBuild).value / "pscrypto-lib",
|
|
|
|
|
unmanagedClasspath in Compile += (baseDirectory in ThisBuild).value / "pscrypto-lib"
|
2016-07-27 01:32:31 +00:00
|
|
|
)
|
|
|
|
|
|
2020-01-13 22:59:24 +00:00
|
|
|
lazy val psloginPackSettings = Seq(
|
|
|
|
|
packMain := Map("ps-login" -> "PsLogin"),
|
2016-07-27 01:32:31 +00:00
|
|
|
packArchivePrefix := "pslogin",
|
|
|
|
|
packExtraClasspath := Map("ps-login" -> Seq("${PROG_HOME}/pscrypto-lib",
|
|
|
|
|
"${PROG_HOME}/config")),
|
|
|
|
|
packResourceDir += (baseDirectory.value / "pscrypto-lib" -> "pscrypto-lib"),
|
|
|
|
|
packResourceDir += (baseDirectory.value / "config" -> "config")
|
2016-07-25 22:34:40 +00:00
|
|
|
)
|
|
|
|
|
|
2016-02-05 08:19:13 +00:00
|
|
|
lazy val root = (project in file(".")).
|
2020-01-08 13:33:25 +00:00
|
|
|
configs(QuietTest).
|
2020-01-13 22:59:24 +00:00
|
|
|
enablePlugins(PackPlugin).
|
2016-02-05 08:19:13 +00:00
|
|
|
settings(commonSettings: _*).
|
2016-07-27 01:32:31 +00:00
|
|
|
settings(psloginPackSettings: _*).
|
2020-01-13 22:59:24 +00:00
|
|
|
//enablePlugins(ScalaUnidocPlugin).
|
|
|
|
|
aggregate(pslogin, common).
|
|
|
|
|
dependsOn(pslogin, common)
|
2016-02-05 08:19:13 +00:00
|
|
|
|
|
|
|
|
lazy val pslogin = (project in file("pslogin")).
|
2020-01-08 13:33:25 +00:00
|
|
|
configs(QuietTest).
|
2016-02-05 08:19:13 +00:00
|
|
|
settings(commonSettings: _*).
|
|
|
|
|
settings(
|
2019-10-22 18:35:17 +00:00
|
|
|
name := "pslogin",
|
|
|
|
|
// ActorTests have specific timing requirements and will be flaky if run in parallel
|
2019-12-13 18:48:15 +00:00
|
|
|
parallelExecution in Test := false,
|
|
|
|
|
// TODO(chord): remove exclusion when WorldSessionActor is refactored: https://github.com/psforever/PSF-LoginServer/issues/279
|
2020-01-08 13:33:25 +00:00
|
|
|
coverageExcludedPackages := "WorldSessionActor.*;zonemaps.*",
|
|
|
|
|
// Copy all tests from Test -> QuietTest (we're only changing the run options)
|
|
|
|
|
inConfig(QuietTest)(Defaults.testTasks)
|
2016-07-25 22:34:40 +00:00
|
|
|
).
|
|
|
|
|
settings(pscryptoSettings: _*).
|
2016-07-27 01:32:31 +00:00
|
|
|
dependsOn(common)
|
2016-02-05 08:19:13 +00:00
|
|
|
|
|
|
|
|
lazy val common = (project in file("common")).
|
2020-01-08 13:33:25 +00:00
|
|
|
configs(QuietTest).
|
2016-02-05 08:19:13 +00:00
|
|
|
settings(commonSettings: _*).
|
|
|
|
|
settings(
|
2020-01-08 13:33:25 +00:00
|
|
|
name := "common",
|
|
|
|
|
// Copy all tests from Test -> QuietTest (we're only changing the run options)
|
|
|
|
|
inConfig(QuietTest)(Defaults.testTasks)
|
2016-07-25 22:34:40 +00:00
|
|
|
).
|
|
|
|
|
settings(pscryptoSettings: _*)
|
2020-01-08 13:33:25 +00:00
|
|
|
|
|
|
|
|
// Special test configuration for really quiet tests (used in CI)
|
|
|
|
|
lazy val QuietTest = config("quiet") extend(Test)
|