-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
executable file
·99 lines (70 loc) · 2.52 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
import bintray.Keys._
organization := "com.agilogy"
name := "play-json-helpers"
version := "2.2"
javaVersion := "1.8"
scalaVersion := "2.12.6"
crossScalaVersions := Seq("2.10.7","2.11.12","2.12.6")
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
libraryDependencies ++= Seq(
"com.typesafe.play" %% "play-json" % "2.6.7",
"org.scalactic" %% "scalactic" % "3.0.5",
"org.scalatest" %% "scalatest" % "3.0.5" % "test"
)
// --> Linters
// See tinyurl.com/sd15lint
// https://tpolecat.github.io/2014/04/11/scalac-flags.html
scalacOptions ++= Seq(
"-deprecation",
"-encoding", "UTF-8", // yes, this is 2 args
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-unchecked",
"-Xlint",
"-Yno-adapted-args",
"-Ywarn-numeric-widen",
"-Ywarn-value-discard",
"-Xfuture"
)
// Execute static analysis via `lint:compile`
val LintTarget = config("lint").extend(Compile)
inConfig(LintTarget) {
Defaults.compileSettings ++
Seq(
sources in LintTarget := {
val lintSources = (sources in LintTarget).value
lintSources ++ (sources in Compile).value
},
scalacOptions in LintTarget ++= Seq(
"-Xfatal-warnings",
"-Ywarn-unused-import",
"-Ywarn-dead-code",
"-P:linter:disable:PreferIfToBooleanMatch"
),
wartremoverErrors ++= Warts.allBut(Wart.DefaultArguments, Wart.MutableDataStructures)
)
}
scalacOptions in Compile := (scalacOptions in Compile).value filterNot { switch =>
switch.startsWith("-P:wartremover:") ||
"^-Xplugin:.*/org[.]brianmckenna/.*wartremover.*[.]jar$".r.pattern.matcher(switch).find ||
switch.startsWith("-P:linter:") ||
"^-Xplugin:.*/com[.]foursquare[.]lint/.*linter.*[.]jar$".r.pattern.matcher(switch).find
}
resolvers += "Linter Repository" at "https://hairyfotr.github.io/linteRepo/releases"
addCompilerPlugin("org.psywerx.hairyfotr" %% "linter" % "0.1.17")
scalastyleFailOnError := true
// <-- Linters
// Reformat at every compile.
// See https://github.com/sbt/sbt-scalariform
scalariformSettings
coverageExcludedPackages := "<empty>"
publishMavenStyle := false
// --> bintray
seq(bintrayPublishSettings:_*)
repository in bintray := "scala"
bintrayOrganization in bintray := Some("agilogy")
packageLabels in bintray := Seq("scala")
licenses += ("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0.html"))
// <-- bintray