-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
55 lines (47 loc) · 1.68 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
import sbt.{Resolver, _}
import Keys._
//General block
lazy val commonSettings = Seq(
name := "remote-debug-tool",
version := "0.1",
organization := "com.github.unknownnpc",
scalaVersion := "2.12.17"
)
lazy val projectConfig = (project in file("."))
.enablePlugins(JavaAppPackaging)
.settings(commonSettings: _*)
.settings(packageSettings)
.settings(libraryDependencies ++= projectDependencies)
.settings(resolvers ++= projectResolvers)
lazy val projectDependencies = Seq(
"com.typesafe" % "config" % "1.4.2"
, "com.typesafe.akka" %% "akka-actor" % "2.8.0"
, "com.typesafe.akka" %% "akka-slf4j" % "2.8.0"
, "ch.qos.logback" % "logback-classic" % "1.4.6"
, "org.scalatest" %% "scalatest" % "3.0.6" % Test
, "com.typesafe.akka" %% "akka-testkit" % "2.8.0" % Test
, "org.scalamock" %% "scalamock-scalatest-support" % "3.6.0" % Test
)
lazy val projectResolvers = Seq(
Resolver.url("scoverage-bintray", url("https://dl.bintray.com/sksamuel/sbt-plugins/"))(Resolver.ivyStylePatterns)
)
//Packaging block
def packageSettings: Seq[Setting[_]] = {
Seq(
mappings in Universal ++= Seq(
resourceToConfigDir((resourceDirectory in Compile).value, "application.conf"),
resourceToConfigDir((resourceDirectory in Compile).value, "logback.xml"))
) ++ Seq(
mappings in Universal ~= { r =>
r.filterNot(f => resourcesToExcludeFromJar.contains(f._2))
}
) ++ Seq(
scriptClasspath := Seq("../conf") ++ NativePackagerKeys.scriptClasspath.value,
executableScriptName := "run"
)
}
def resourceToConfigDir(base: File, fileName: String) = (base / fileName) -> s"conf/$fileName"
def resourcesToExcludeFromJar = Seq(
"application.conf",
"logback.xml"
)