-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
94 lines (84 loc) · 2.9 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
import sbt._
import Keys._
import xerial.sbt.Sonatype._
inThisBuild(
Seq(
organization := "com.github.mvv.sash",
version := "0.1-M7", // next is M8
homepage := Some(url("https://github.com/mvv/sash")),
scmInfo := Some(ScmInfo(url("https://github.com/mvv/sash"), "scm:[email protected]:mvv/sash.git")),
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
developers := List(
Developer(id = "mvv",
name = "Mikhail Vorozhtsov",
email = "[email protected]",
url = url("https://github.com/mvv"))),
sonatypeProjectHosting := Some(GitHubHosting("mvv", "sash", "[email protected]"))
))
ThisBuild / publishTo := sonatypePublishToBundle.value
ThisBuild / publishMavenStyle := true
lazy val sonatypeBundleReleaseIfNotSnapshot: Command = Command.command("sonatypeBundleReleaseIfNotSnapshot") { state =>
val extracted = Project.extract(state)
if (extracted.get(isSnapshot)) {
val log = extracted.get(sLog)
log.info("Snapshot version, doing nothing")
state
} else {
Command.process("sonatypeBundleRelease", state)
}
}
inThisBuild(
Seq(
crossScalaVersions := Seq("2.13.6", "2.12.14"),
scalaVersion := crossScalaVersions.value.head,
scalacOptions ++= Seq("-feature", "-deprecation", "-unchecked", "-Xfatal-warnings")
)
)
def isPriorTo2_13(version: String): Boolean =
CrossVersion.partialVersion(version) match {
case Some((2, minor)) => minor < 13
case _ => false
}
lazy val commonSettings = Seq(
scalacOptions ++= {
if (isPriorTo2_13(scalaVersion.value)) {
Nil
} else {
Seq("-Ymacro-annotations")
}
},
libraryDependencies ++=
Seq("org.scala-lang" % "scala-reflect" % scalaVersion.value, "org.specs2" %% "specs2-core" % "4.10.6" % Test),
libraryDependencies ++= {
if (isPriorTo2_13(scalaVersion.value)) {
Seq(compilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full))
} else {
Nil
}
}
)
lazy val sash = (project in file("."))
.settings(
skip in publish := true,
sonatypeProfileName := "com.github.mvv",
sonatypeSessionName := s"Sash_${version.value}",
commands += sonatypeBundleReleaseIfNotSnapshot
)
.aggregate(core, cats, zio)
lazy val core = (project in file("core"))
.settings(commonSettings)
.settings(name := "sash")
lazy val cats = (project in file("cats"))
.settings(commonSettings)
.settings(name := "sash-cats", libraryDependencies ++= Seq("org.typelevel" %% "cats-core" % "2.0.0" % Provided))
.dependsOn(core % "test->test;compile->compile")
lazy val zio = (project in file("zio"))
.settings(commonSettings)
.settings(
name := "sash-zio",
libraryDependencies ++= {
val zioVersion = "1.0.9"
Seq("dev.zio" %% "zio" % zioVersion % Provided, "dev.zio" %% "zio-streams" % zioVersion % Provided)
}
)
.dependsOn(core)