-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.sbt
106 lines (90 loc) · 2.67 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
95
96
97
98
99
100
101
102
103
104
105
106
name := "pascal"
organization := "com.github.tomasmikula"
licenses += ("MIT", url("http://opensource.org/licenses/MIT"))
homepage := Some(url("http://github.com/TomasMikula/pascal"))
scalaVersion := crossScalaVersions.value.head
crossScalaVersions := Seq("2.12.15", "2.13.8")
crossVersion := CrossVersion.full
crossTarget := {
// workarond for https://github.com/sbt/sbt/issues/5097
target.value / s"scala-${scalaVersion.value}"
}
Compile / unmanagedSourceDirectories += {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2L, v)) if v >= 13 =>
(Compile / baseDirectory).value / s"src/main/scala-2.13+"
case _ =>
(Compile / baseDirectory).value / s"src/main/scala-2.13-"
}
}
addCompilerPlugin("org.typelevel" % "kind-projector" % "0.13.2" cross CrossVersion.full)
libraryDependencies ++= Seq(
scalaOrganization.value % "scala-compiler" % scalaVersion.value,
"org.scalatest" %% "scalatest" % "3.0.8" % Test
)
scalacOptions ++= Seq(
//"-Xfatal-warnings",
"-Xlint",
"-feature",
"-language:higherKinds",
"-deprecation",
"-unchecked"
)
List(Compile, Test) flatMap { config =>
Seq(
// Notice this is :=, not += - all the warning/lint options are simply
// impediments in the repl.
config / console / scalacOptions := Seq(
"-language:_",
"-Xplugin:" + (Compile / packageBin).value
)
)
}
Test / scalacOptions ++= {
val jar = (Compile / packageBin).value
Seq(s"-Xplugin:${jar.getAbsolutePath}", s"-Jdummy=${jar.lastModified}") // ensures recompile
}
Test / scalacOptions += "-Yrangepos"
Test / fork := true
/******************
*** Publishing ***
******************/
import ReleaseTransformations._
releaseCrossBuild := true
releasePublishArtifactsAction := PgpKeys.publishSigned.value
Test / publishArtifact := false
publishMavenStyle := true
pomIncludeRepository := Function.const(false)
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
pomExtra := (
<scm>
<url>[email protected]:TomasMikula/pascal.git</url>
<connection>scm:git:[email protected]:TomasMikula/pascal.git</connection>
</scm>
<developers>
<developer>
<id>TomasMikula</id>
<name>Tomas Mikula</name>
<url>http://github.com/TomasMikula/</url>
</developer>
</developers>
)
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
publishArtifacts,
setNextVersion,
commitNextVersion,
releaseStepCommand("sonatypeReleaseAll"),
pushChanges)