-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.sbt
65 lines (60 loc) · 1.73 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
lazy val scalaMacroDependencies: Seq[Setting[_]] = Seq(
version := "0.3.0",
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value % "provided",
"org.scala-lang" % "scala-compiler" % scalaVersion.value % "provided"
),
scalacOptions ++= PartialFunction.condOpt(CrossVersion.partialVersion(scalaVersion.value)) {
case Some((2, n)) if n >= 13 =>
Seq(
"-Ymacro-annotations"
)
}.toList.flatten,
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
// if scala 2.13.0-M4+ is used, paradise are merged into scala-reflect
case Some((2, scalaMajor)) if scalaMajor >= 13 =>
Seq()
case _ =>
Seq(compilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full))
}
},
)
lazy val notPublish = Seq(
publish / skip := true,
publishArtifact := false,
publish := {},
publishLocal := {}
)
val buildSettings = Seq(
scalaVersion := "2.11.12",
crossScalaVersions := Seq("2.11.12", "2.12.20", "2.13.15"),
resolvers += Resolver.sonatypeRepo("snapshots"),
resolvers += Resolver.sonatypeRepo("releases"),
scalacOptions ++= Seq("-deprecation"),
licenses := Seq("MIT" -> url("http://opensource.org/licenses/MIT")),
publishMavenStyle := true
) ++ scalaMacroDependencies
lazy val root: Project = Project(
"root",
file(".")
).settings(
buildSettings,
notPublish,
run := (tests / Compile / run).evaluated
).aggregate(macros, tests)
lazy val macros: Project = Project(
"macros",
file("macros")
).settings(
buildSettings,
organization := "com.higher-order",
name := "latr"
)
lazy val tests: Project = Project(
"tests",
file("tests")
).settings(
buildSettings,
notPublish
).dependsOn(macros)