-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
85 lines (70 loc) · 3.44 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
name := "Babel"
/************ Test Options *************/
scalacOptions in Test ++= Seq("-Yrangepos")
parallelExecution in Test := true
testOptions += Tests.Argument(TestFrameworks.JUnit, "-q", "-v", "-s", "-a")
/******** Static Code Analyzer **********/
wartremoverErrors in (Compile, compile) ++= Warts.allBut(Wart.FinalCaseClass)
wartremoverErrors in (Test, test) ++= Warts.allBut(Wart.FinalCaseClass, Wart.NonUnitStatements)
/********* Bintray Publishing *********/
val bintraySettings = Seq(
bintrayOrganization := Some("dama-upc"),
bintrayRepository := "Babel-Platform",
licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
homepage := Some(url("https://github.com/DAMA-UPC/Babel"))
)
/********** Common settings ***********/
lazy val commonDependencies: Seq[Def.Setting[_]] = Seq(
libraryDependencies ++= {
val shapelessVersion = "2.3.3"
val circeVersion = "0.9.3"
val specs2Version = "4.2.0"
val scalaCheckVersion = "1.14.0"
Seq(
// https://github.com/milessabin/shapeless
"com.chuusai" %% "shapeless" % shapelessVersion,
// https://github.com/circe/circe
"io.circe" %% "circe-core" % circeVersion,
"io.circe" %% "circe-generic" % circeVersion,
"io.circe" %% "circe-parser" % circeVersion,
"io.circe" %% "circe-java8" % circeVersion,
// Specs2 Test Framework - https://etorreborre.github.io/specs2/
"org.specs2" %% "specs2-core" % specs2Version % "test",
"org.specs2" %% "specs2-matcher-extra" % specs2Version % "test",
"org.specs2" %% "specs2-junit" % specs2Version % "test",
"org.specs2" %% "specs2-scalacheck" % specs2Version % "test",
// ScalaCheck - https://scalacheck.org/
"org.scalacheck" %% "scalacheck" % scalaCheckVersion % "test"
)
},
addCompilerPlugin("org.scalameta" % "paradise" % "3.0.0-M11" cross CrossVersion.full)
)
lazy val commonSettings: Seq[Def.Setting[_]] = Seq(
scalaVersion := "2.12.4",
organization := "edu.upc.dama",
scalacOptions += "-Ypartial-unification"
) ++ bintraySettings ++ commonDependencies
lazy val macroBasedModuleSettings: Seq[Def.Setting[_]] = Seq(
// A dependency on macro paradise 3.x is required to both write and expand
// new-style macros. This is similar to how it works for old-style macro
// annotations and a dependency on macro paradise 2.x.
scalacOptions += "-Xplugin-require:macroparadise",
// temporary workaround for https://github.com/scalameta/paradise/issues/10
scalacOptions in (Compile, console) := Seq(), // macroparadise plugin doesn't work in repl yet.
// temporary workaround for https://github.com/scalameta/paradise/issues/55
sources in (Compile, doc) := Nil, // macroparadise doesn't work with scaladoc yet.
// A dependency on scala.meta is required to write new-style macros, but not
// to expand such macros. This is similar to how it works for old-style
// macros and a dependency on scala.reflect.
libraryDependencies += "org.scalameta" %% "scalameta" % "1.8.0",
libraryDependencies += "org.scalameta" %% "contrib" % "1.8.0"
) ++ commonSettings
/************** Modules ***************/
lazy val types = project.settings(macroBasedModuleSettings)
lazy val generators = project.settings(commonSettings)
lazy val graph = project.settings(commonSettings)
// Main module, depends on all the other modules
lazy val root =
(project in file("."))
.settings(commonSettings)
.aggregate(types, generators, graph)