-
Notifications
You must be signed in to change notification settings - Fork 51
/
tutorials.sbt
83 lines (78 loc) · 2.35 KB
/
tutorials.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
import Versions._
lazy val `sbt-migration-tutorial` = project
.in(file("tutorials/sbt-migration"))
.settings(
scalaVersion := scala3,
crossScalaVersions := Seq(scala213, scala3),
libraryDependencies ++= Seq(
"org.typelevel" % "cats-core_2.13" % "2.1.1",
"com.lihaoyi" %% "os-lib" % osLib,
"com.lihaoyi" %% "sourcecode" % sourcecode
),
scalacOptions ++= {
Seq(
"-encoding",
"UTF-8",
"-feature",
"-language:implicitConversions",
// "-Xfatal-warnings" disabled during the migration,
) ++
(CrossVersion.partialVersion(scalaVersion.value) match {
case Some((3, _)) => Seq(
"-unchecked",
"-source:3.0-migration"
)
case _ => Seq(
"-deprecation",
"-Xfatal-warnings",
"-Wunused:imports,privates,locals",
"-Wvalue-discard"
)
})
}
)
lazy val `macro-cross-building-example` = project
.in(file("tutorials/macro-cross-building/example"))
.settings(
scalaVersion := scala3,
crossScalaVersions := Seq(scala213, scala3),
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 13)) => Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
)
case _ => Seq.empty
}
},
libraryDependencies ++= Seq(
"org.scalameta" %% "munit" % Versions.munit % Test
)
)
lazy val `macro-mixing-example` = project
.in(file("tutorials/macro-mixing/example"))
.settings(
scalaVersion := scala3
)
.dependsOn(`macro-mixing-example-compat`)
lazy val `macro-mixing-example-compat` = project
.in(file("tutorials/macro-mixing/example-compat"))
.settings(
scalaVersion := scala213,
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value
)
)
lazy val `macro-mixing-example-test` = project
.in(file("tutorials/macro-mixing/example-test"))
.settings(
scalaVersion := scala3,
crossScalaVersions := Seq(scala3, scala213),
scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 13)) => Seq("-Ytasty-reader")
case _ => Seq.empty
}
},
libraryDependencies += "org.scalameta" %% "munit" % munit % Test
)
.dependsOn(`macro-mixing-example`)