-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
79 lines (73 loc) · 2.49 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
import xerial.sbt.Sonatype._
lazy val commonSettings = Seq(
scalaVersion := "2.12.12",
organization := "io.github.dos65",
version := "0.1.0-SNAPSHOT",
crossScalaVersions := Seq("2.12.12", "2.13.3"),
libraryDependencies ++= {
if (is213(scalaVersion.value))
Seq.empty
else
Seq(compilerPlugin(("org.scalamacros" % "paradise" % "2.1.1").cross(CrossVersion.patch)))
},
scalacOptions ++= {
if(is213(scalaVersion.value))
Seq("-Ymacro-annotations")
else
Seq("-Ypartial-unification")
},
libraryDependencies += "org.scalameta" %% "munit" % "0.4.3" % "test",
testFrameworks += new TestFramework("munit.Framework"),
)
lazy val publishSettings = Seq(
publishMavenStyle := true,
publishTo := sonatypePublishToBundle.value,
sonatypeProfileName := "io.github.dos65",
sonatypeProjectHosting := Some(GitHubHosting("dos65", "make", "[email protected]")),
licenses := Seq("Apache 2.0 License" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
sonatypeBundleDirectory := (ThisBuild / baseDirectory).value / "target" / "sonatype-staging" / s"${version.value}"
)
lazy val make = project.in(file("modules/core"))
.settings(commonSettings)
.settings(publishSettings)
.settings(
name := "make",
scalacOptions ++= Seq(
"-language:experimental.macros",
),
sourceGenerators in Compile += (sourceManaged in Compile).map(dir => Boilerplate.gen(dir)).taskValue,
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"org.scala-lang" % "scala-compiler" % scalaVersion.value,
"org.typelevel" %% "cats-core" % "2.1.1",
"com.chuusai" %% "shapeless" % "2.3.3" % "test",
"org.typelevel" %% "cats-effect" % "2.1.3" % "test",
),
)
lazy val example = project.in(file("modules/example"))
.dependsOn(make)
.settings(commonSettings)
.settings(
name := "make-example",
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-effect" % "2.1.3",
"dev.zio" %% "zio" % "1.0.1",
"dev.zio" %% "zio-interop-cats" % "2.1.4.0",
),
addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.11.0" cross CrossVersion.full),
skip in publish := true
)
lazy val rootProject = project.in(file("."))
.settings(commonSettings)
.settings(publishSettings)
.settings(
name := "make-root",
skip in publish := true
)
.aggregate(make)
def is213(v: String): Boolean = {
CrossVersion.partialVersion(v) match {
case Some((2, 13)) => true
case _ => false
}
}