-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.sbt
99 lines (81 loc) · 4.42 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
name := "lambda-days"
version := "1.0"
scalaVersion := "2.11.5"
//scalaSource in Test := baseDirectory.value / "test"
//resourceDirectory in Test := (scalaSource in Test).value / "resources"
scalacOptions ++= Seq(
"-deprecation" // Emit warning and location for usages of deprecated APIs
, "-encoding", "UTF-8" // Specify character encoding used by source files
, "-feature" // Emit warning and location for usages of features that should be imported explicitly
// , "-language:_" // Enable or disable language features (see list below)
// , "-optimise" // Generates faster bytecode by applying optimisations to the program
, "-target:jvm-1.7" // Target platform for object files
, "-unchecked" // Enable additional warnings where generated code depends on assumptions
// Doesn't play well with ScalaTest
// , "-Xdev" // Indicates user is a developer - issue warnings about anything which seems amiss
// , "-Xfatal-warnings" // Fail the compilation if there are any warnings
, "-Xlint:_,-nullary-unit" // Enable or disable specific warnings (see list below)
, "-Yno-adapted-args" // Do not adapt an argument list to match the receiver
, "-Ywarn-dead-code" // Warn when dead code is identified
, "-language:higherKinds"
// Not really useful
// , "-Ywarn-numeric-widen" // Warn when numerics are widened
// , "-Ywarn-unused" // Warn when local and private vals, vars, defs, and types are are unused
// , "-Ywarn-unused-import" // Warn when imports are unused
// , "-Ywarn-value-discard" // Warn when non-Unit expression results are unused
)
/*
scalac -language:help
dynamics Allow direct or indirect subclasses of scala.Dynamic
existentials Existential types (besides wildcard types) can be written and inferred
experimental.macros Allow macro defintion (besides implementation and application)
higherKinds Allow higher-kinded types
implicitConversions Allow definition of implicit functions called views
postfixOps Allow postfix operator notation, such as `1 to 10 toList'
reflectiveCalls Allow reflective access to members of structural types
*/
/*
scalac -Xlint:help
adapted-args Warn if an argument list is modified to match the receiver
by-name-right-associative By-name parameter of right associative operator
delayedinit-select Selecting member of DelayedInit
doc-detached A ScalaDoc comment appears to be detached from its element
inaccessible Warn about inaccessible types in method signatures
infer-any Warn when a type argument is inferred to be `Any`
missing-interpolator A string literal appears to be missing an interpolator id
nullary-override Warn when non-nullary `def f()' overrides nullary `def f'
nullary-unit Warn when nullary methods return Unit
option-implicit Option.apply used implicit view
package-object-classes Class or object defined in package object
poly-implicit-overload Parameterized overloaded implicit methods are not visible as view bounds
private-shadow A private field (or class parameter) shadows a superclass field
type-parameter-shadow A local type parameter shadows a type already in scope
unsound-match Pattern match may not be typesafe
*/
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-compiler" % "2.11.5" % Compile,
"org.scalatest" %% "scalatest" % "2.2.4" % Test,
"org.scalaz" %% "scalaz-core" % "7.1.1",
"net.databinder.dispatch" %% "dispatch-core" % "0.11.2",
"commons-codec" % "commons-codec" % "1.4",
"io.argonaut" %% "argonaut" % "6.1-M4",
"org.scalacheck" %% "scalacheck" % "1.12.2",
"org.typelevel" %% "shapeless-scalacheck" % "0.3"
)
// Improved incremental compilation
incOptions := incOptions.value.withNameHashing(true)
// Improved dependency management
updateOptions := updateOptions.value.withCachedResolution(true)
// Download and create Eclipse source attachments for library dependencies
// EclipseKeys.withSource := true
// Uncomment to enable offline mode
// offline := true
showSuccess := true
showTiming := true
shellPrompt := { state =>
import scala.Console.{CYAN,RESET}
val p = Project.extract(state)
val name = p.getOpt(sbt.Keys.name) getOrElse p.currentProject.id
s"[$CYAN$name$RESET] $$ "
}
javaOptions in console += "-Dscala.color"