-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.sbt
123 lines (111 loc) · 4.02 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
import ReleaseTransformations._
import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}
ThisBuild / scalaVersion := "2.12.19"
ThisBuild / crossScalaVersions := Seq("2.12.19", "2.13.14")
lazy val claimantSettings = Seq(
organization := "org.typelevel",
libraryDependencies ++=
"org.scala-lang" % "scala-reflect" % scalaVersion.value ::
"org.scalacheck" %%% "scalacheck" % "1.18.0" ::
Nil,
scalacOptions ++=
"-deprecation" ::
"-encoding" :: "UTF-8" ::
"-feature" ::
"-language:existentials" ::
"-language:higherKinds" ::
"-language:implicitConversions" ::
"-language:experimental.macros" ::
"-unchecked" ::
// "-Xfatal-warnings" :: // kind of brutal in 2.13
"-Xlint" ::
"-Ywarn-dead-code" ::
"-Ywarn-numeric-widen" ::
"-Ywarn-value-discard" ::
Nil,
scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, v)) if v <= 12 =>
Seq("-Xfuture")
case _ =>
Nil
}
},
// HACK: without these lines, the console is basically unusable,
// since all imports are reported as being unused (and then become
// fatal errors).
Compile / console / scalacOptions ~= { _.filterNot("-Xlint" == _) },
Test / console / scalacOptions := (Compile / console / scalacOptions).value,
// release stuff
releaseCrossBuild := true,
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
publishMavenStyle := true,
Test / publishArtifact := false,
pomIncludeRepository := Function.const(false),
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
publishArtifacts,
setNextVersion,
commitNextVersion,
ReleaseStep(action = Command.process("sonatypeReleaseAll", _)),
pushChanges
),
credentials += Credentials(
Option(System.getProperty("build.publish.credentials"))
.map(new File(_))
.getOrElse(Path.userHome / ".ivy2" / ".credentials")
),
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"))
},
scmInfo := Some(ScmInfo(url("https://github.com/non/claimant"), "scm:git:[email protected]:non/claimant.git")),
homepage := Some(url("https://github.com/non/claimant/")),
licenses := Seq("Apache 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
developers := List(Developer("non", "Erik Osheim", "[email protected]", url("https://github.com/non/")))
)
lazy val noPublish = Seq(publish := {}, publishLocal := {}, publishArtifact := false)
lazy val root = project
.in(file("."))
.settings(name := "root")
.settings(claimantSettings: _*)
.settings(noPublish: _*)
.aggregate(mcJVM, mcJS, mcNative, coreJVM, coreJS, coreNative)
.dependsOn(mcJVM, mcJS, mcNative, coreJVM, coreJS, coreNative)
lazy val mc = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.crossType(CrossType.Pure)
.in(file("mc"))
.settings(name := "claimant-mc")
.settings(claimantSettings: _*)
.jsSettings(Global / scalaJSStage := FastOptStage,
parallelExecution := false,
coverageEnabled := false,
jsEnv := new org.scalajs.jsenv.nodejs.NodeJSEnv()
)
lazy val mcJVM = mc.jvm
lazy val mcJS = mc.js
lazy val mcNative = mc.native
lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.crossType(CrossType.Pure)
.in(file("core"))
.dependsOn(mc)
.settings(name := "claimant")
.settings(claimantSettings: _*)
.settings(Compile / sourceGenerators += (Compile / sourceManaged).map(Boilerplate.gen).taskValue)
.jsSettings(Global / scalaJSStage := FastOptStage,
parallelExecution := false,
coverageEnabled := false,
jsEnv := new org.scalajs.jsenv.nodejs.NodeJSEnv()
)
lazy val coreJVM = core.jvm
lazy val coreJS = core.js
lazy val coreNative = core.native