-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sbt
83 lines (77 loc) · 2.66 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
import sbt._
import scala.sys.process._
lazy val oldVersion = "git describe --abbrev=0".!!.trim.replaceAll("^v", "")
lazy val commonSettings = Seq(
organization := "com.github.plokhotnyuk.expression-evaluator",
organizationHomepage := Some(url("https://github.com/plokhotnyuk")),
homepage := Some(url("https://github.com/plokhotnyuk/expression-evaluator")),
licenses := Seq(("Apache License 2.0", url("https://www.apache.org/licenses/LICENSE-2.0"))),
startYear := Some(2019),
developers := List(
Developer(
id = "plokhotnyuk",
name = "Andriy Plokhotnyuk",
email = "plokhotnyuk@gmail.com",
url = url("https://twitter.com/aplokhotnyuk")
)
),
scalaVersion := "2.13.13",
javacOptions ++= Seq("-source", "1.8", "-target", "1.8"),
scalacOptions ++= Seq(
"-deprecation",
"-encoding", "UTF-8",
"-target:jvm-1.8",
"-feature",
"-unchecked",
"-Ywarn-dead-code",
"-Xlint",
"-Xmacro-settings:print-expr-results"
) ++ (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, x)) if x == 11 => Seq(
"-Ybackend:GenBCode",
"-Ydelambdafy:inline"
)
case _ => Seq()
}),
(Test / testOptions) += Tests.Argument("-oDF"),
publishTo := sonatypePublishToBundle.value,
sonatypeProfileName := "com.github.plokhotnyuk",
scmInfo := Some(
ScmInfo(
url("https://github.com/plokhotnyuk/expression-evaluator"),
"scm:git@github.com:plokhotnyuk/expression-evaluator.git"
)
),
publishMavenStyle := true,
pomIncludeRepository := { _ => false },
)
lazy val publishSettings = Seq(
packageOptions += Package.ManifestAttributes("Automatic-Module-Name" -> moduleName.value),
mimaCheckDirection := {
def isPatch: Boolean = {
val Array(newMajor, newMinor, _) = version.value.split('.')
val Array(oldMajor, oldMinor, _) = oldVersion.split('.')
newMajor == oldMajor && newMinor == oldMinor
}
if (isPatch) "both" else "backward"
},
mimaPreviousArtifacts := {
def isCheckingRequired: Boolean = {
val Array(newMajor, newMinor, _) = version.value.split('.')
val Array(oldMajor, oldMinor, _) = oldVersion.split('.')
newMajor == oldMajor && (newMajor != "0" || newMinor == oldMinor)
}
if (isCheckingRequired) Set(organization.value %% moduleName.value % oldVersion)
else Set()
}
)
lazy val `expression-evaluator` = project.in(file("."))
.settings(commonSettings)
.settings(publishSettings)
.settings(
crossScalaVersions := Seq("2.13.13", "2.12.20", "2.11.12"),
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"org.scalatest" %% "scalatest" % "3.2.19" % Test
)
)