-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
78 lines (61 loc) · 2.65 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
// basic project settings
name := "facsimile"
organization := "info.raack.facsimile"
version := "1.0.x-SNAPSHOT"
scalaVersion := "2.11.6"
// activate scalastyle
lazy val compileScalastyle = taskKey[Unit]("compileScalastyle")
compileScalastyle := org.scalastyle.sbt.ScalastylePlugin.scalastyle.in(Compile).toTask("").value
(compile in Compile) <<= (compile in Compile) dependsOn compileScalastyle
scalacOptions ++= Seq(
"-target:jvm-1.8",
"-encoding", "UTF-8",
"-unchecked",
"-deprecation",
"-Xfuture",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Ywarn-value-discard",
"-Ywarn-unused"
)
lazy val testScalastyle = taskKey[Unit]("testScalastyle")
testScalastyle := org.scalastyle.sbt.ScalastylePlugin.scalastyle.in(Test).toTask("").value
(test in Test) <<= (test in Test) dependsOn testScalastyle
testOptions in Test += Tests.Argument("-oF")
// activate scalariform, with some format tweaks
import scalariform.formatter.preferences._
scalariformPreferences := scalariformPreferences.value
.setPreference(AlignParameters, false)
.setPreference(FormatXml, true)
.setPreference(PreserveDanglingCloseParenthesis, false)
.setPreference(SpaceInsideBrackets, false)
.setPreference(IndentWithTabs, false)
.setPreference(SpaceInsideParentheses, false)
.setPreference(MultilineScaladocCommentsStartOnFirstLine, false)
.setPreference(AlignSingleLineCaseStatements, false)
.setPreference(CompactStringConcatenation, false)
.setPreference(PlaceScaladocAsterisksBeneathSecondAsterisk, false)
.setPreference(IndentPackageBlocks, true)
.setPreference(CompactControlReadability, false)
.setPreference(SpacesWithinPatternBinders, true)
.setPreference(DoubleIndentClassDeclaration, true)
.setPreference(PreserveSpaceBeforeArguments, false)
.setPreference(SpaceBeforeColon, false)
.setPreference(RewriteArrowSymbols, false)
.setPreference(IndentLocalDefs, false)
.setPreference(SpacesAroundMultiImports, false)
// linting (static code analysis) - https://github.com/HairyFotr/linter
addCompilerPlugin("org.psywerx.hairyfotr" %% "linter" % "0.1.12")
// use pack plugin to pack all libraries for easy deployment with roller deploytool and no nasty uberjar file collissions
packAutoSettings
libraryDependencies ++= Seq(
"org.json4s" %% "json4s-ext" % "[3.4.0]",
"org.json4s" %% "json4s-jackson" % "[3.4.0]",
"org.scalatest" %% "scalatest" % "[2.2.6,3)" % "test",
"org.scalactic" %% "scalactic" % "[2.2.6,3)" % "test"
)
// for specs2
scalacOptions in Test ++= Seq("-Yrangepos")
// need this so that tests which access the testing database don't happen at the same moment and interfere with each other
parallelExecution in Test := false