-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
90 lines (81 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
79
80
81
82
83
84
85
86
87
88
89
90
// *****************************************************************************
// Projects
// *****************************************************************************
lazy val `cats-andra` =
project
.in(file("."))
.enablePlugins(AutomateHeaderPlugin, GitVersioning)
.settings(settings)
.settings(
libraryDependencies ++= Seq(
library.cats,
library.scalaCheck % Test,
library.scalaTest % Test
)
)
// *****************************************************************************
// Library dependencies
// *****************************************************************************
lazy val library =
new {
object Version {
val cats = "0.9.0"
val scalaCheck = "1.13.4"
val scalaTest = "3.0.1"
}
val cats = "org.typelevel" %% "cats" % Version.cats
val scalaCheck = "org.scalacheck" %% "scalacheck" % Version.scalaCheck
val scalaTest = "org.scalatest" %% "scalatest" % Version.scalaTest
}
// *****************************************************************************
// Settings
// ***************************************************************************** |
lazy val settings =
commonSettings ++
scalafmtSettings ++
gitSettings ++
headerSettings
lazy val commonSettings =
Seq(
scalaVersion := "2.12.1",
crossScalaVersions := Seq(scalaVersion.value, "2.11.8"),
organization := "com.jgagnon",
licenses += ("Apache 2.0",
url("http://www.apache.org/licenses/LICENSE-2.0")),
mappings.in(Compile, packageBin) +=
baseDirectory.in(ThisBuild).value / "LICENSE" -> "LICENSE",
scalacOptions ++= Seq(
"-unchecked",
"-deprecation",
"-language:_",
"-target:jvm-1.8",
"-encoding", "UTF-8"
),
javacOptions ++= Seq(
"-source", "1.8",
"-target", "1.8"
),
unmanagedSourceDirectories.in(Compile) :=
Seq(scalaSource.in(Compile).value),
unmanagedSourceDirectories.in(Test) :=
Seq(scalaSource.in(Test).value)
)
lazy val scalafmtSettings =
reformatOnCompileSettings ++
Seq(
formatSbtFiles := false,
scalafmtConfig :=
Some(baseDirectory.in(ThisBuild).value / ".scalafmt.conf"),
ivyScala :=
ivyScala.value.map(_.copy(overrideScalaVersion = sbtPlugin.value)) // TODO Remove once this workaround no longer needed (https://github.com/sbt/sbt/issues/2786)!
)
lazy val gitSettings =
Seq(
git.useGitDescribe := true
)
import de.heikoseeberger.sbtheader.HeaderPattern
import de.heikoseeberger.sbtheader.license.Apache2_0
lazy val headerSettings =
Seq(
headers := Map("scala" -> Apache2_0("2017", "Jerome Gagnon"))
)