forked from softprops/northeast-scala-symposium
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.sbt
60 lines (52 loc) · 2.07 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
import com.typesafe.sbt.packager.archetypes.JavaAppPackaging
//seq(lsSettings :_*)
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.1" % "test"
libraryDependencies ++= Seq(
"net.databinder" %% "unfiltered-filter" % "0.7.1",
"net.databinder" %% "unfiltered-jetty" % "0.7.1",
// json
"org.json4s" % "json4s-native_2.10" % "3.5.0",
"net.databinder" %% "unfiltered-json4s" % "0.7.1",
// http client
"net.databinder.dispatch" %% "dispatch-core" % "0.10.0",
// persistance
"net.debasishg" %% "redisclient" % "2.13",
// loging
"org.slf4j" % "slf4j-jdk14" % "1.6.2",
// date math
"joda-time" % "joda-time" % "2.1",
"org.joda" % "joda-convert" % "1.2",
"org.clapper" %% "markwrap" % "1.1.0",
"com.github.tototoshi" %% "scala-csv" % "1.2.2",
"io.backchat.inflector" %% "scala-inflector" % "1.3.5",
// local cache
"com.google.guava" % "guava" % "14.0",
"com.google.code.findbugs" % "jsr305" % "3.0.0" // http://stackoverflow.com/questions/19030954/cant-find-nullable-inside-javax-annotation
)
scalacOptions ++= Seq("-deprecation", "-unchecked", "-Xfatal-warnings")
seq(Revolver.settings: _*)
lazy val root = (project in file(".")).
enablePlugins(BuildInfoPlugin).
enablePlugins(SbtWeb).
enablePlugins(JavaAppPackaging).
settings(
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion),
buildInfoPackage := "nescala"
)
includeFilter in (Assets, LessKeys.less) := "*.less"
def exec(command: String) = {
import sys.process._
println(s"Running: $command")
print(command.!!)
}
// Use this task instead of "assembly" to build a fat jar (e.g., for testing
// on a server that isn't Heroku). It ensures that sbt-less files end up in
// the jar.
addCommandAlias("fatjar", ";copyAssets;package;assembly")
val copyAssets = taskKey[Unit]("run copyAssets")
copyAssets := {
val scalaMajor = scalaVersion.value.split("""\.""").take(2).mkString(".")
val targetDir = s"target/scala-${scalaMajor}/classes/resources/webjars/root/${version.value}"
exec(s"mkdir -p ${targetDir}")
exec(s"cp -r target/web/less/main/css ${targetDir}")
}