-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.sbt
97 lines (89 loc) · 2.89 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
import java.time.LocalDate
import Dependencies._
lazy val projectName = "money"
lazy val commonSettings = Seq(
moduleName := projectName,
organization := "com.lambdista",
description := "Scala DSL for money-related operations.",
homepage := Some(url("https://github.com/lambdista/money")),
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
developers := List(
Developer("lambdista", "Alessandro Lacava", "[email protected]", url("https://alessandrolacava.com"))
),
scalaVersion := projectScalaVersion,
crossScalaVersions := Seq(projectScalaVersion, "2.12.8"),
resolvers ++= Seq(Resolver.sonatypeRepo("releases"), Resolver.sonatypeRepo("snapshots")),
scalacOptions := (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 13)) =>
Seq(
"-feature",
"-language:higherKinds",
"-language:implicitConversions",
"-language:postfixOps",
"-encoding",
"utf8",
"-deprecation",
"-unchecked",
"-Ywarn-unused",
"-Ywarn-dead-code"
)
case _ =>
Seq(
"-feature",
"-language:higherKinds",
"-language:implicitConversions",
"-language:postfixOps",
"-Ypartial-unification",
"-encoding",
"utf8",
"-deprecation",
"-unchecked",
"-Ywarn-unused-import",
"-Ywarn-unused",
"-Ywarn-dead-code",
"-Yno-adapted-args"
)
}),
scalafmtOnCompile := true,
libraryDependencies ++= coreDeps,
console / initialCommands :=
"""
|import money._
| val conversion: Conversion = Map(
| (EUR, USD) -> 1.13,
| (EUR, GBP) -> 0.71,
| (USD, EUR) -> 0.88,
| (USD, GBP) -> 0.63,
| (GBP, EUR) -> 1.40,
| (GBP, USD) -> 1.59
| )
|
|implicit val converter = Converter(conversion)""".stripMargin
)
lazy val noPublishSettings = Seq(publish / skip := true)
lazy val money = (project in file("."))
.aggregate(core, examples)
.dependsOn(core, examples)
.settings(moduleName := s"$projectName-root", Compile / run / mainClass := Some("money.example.Usage"))
.settings(commonSettings)
.settings(noPublishSettings)
lazy val core =
(project in file("core"))
.settings(moduleName := projectName)
.settings(commonSettings)
lazy val examples = (project in file("examples"))
.dependsOn(core)
.settings(moduleName := s"$projectName-examples", Compile / run / mainClass := Some("money.example.Usage"))
.settings(commonSettings)
.settings(noPublishSettings)
lazy val docs = (project in file("docs"))
.dependsOn(core)
.enablePlugins(MdocPlugin)
.settings(commonSettings)
.settings(noPublishSettings)
.settings(
moduleName := s"$projectName-docs",
mdocIn := file("docs/src/mdoc"),
mdocOut := file("."),
mdocVariables := Map("YEAR" -> LocalDate.now.getYear.toString)
)