-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.sbt
183 lines (168 loc) · 5.86 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
import ReleaseTransformations._
import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}
def ScalaCheck = Def.setting("org.scalacheck" %%% "scalacheck" % "1.14.3")
def ScalaProps = Def.setting("com.github.scalaprops" %%% "scalaprops" % "0.8.0")
def Claimant = Def.setting("org.typelevel" %%% "claimant" % "0.1.3")
Global / semanticdbEnabled := true
lazy val antimirovSettings = Seq(
organization := "org.spire-math",
scalaVersion := "2.13.2",
crossScalaVersions := Seq("2.13.2", "2.12.11"),
libraryDependencies ++=
ScalaCheck.value % Test ::
Claimant.value % Test ::
Nil,
Test / testOptions +=
//Tests.Argument(TestFrameworks.ScalaCheck, "-verbosity", "1", "-w", "8"),
Tests.Argument(TestFrameworks.ScalaCheck, "-verbosity", "1"),
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
),
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/antimirov"),
"scm:git:[email protected]:non/antimirov.git")),
homepage := Some(url("https://github.com/non/antimirov/")),
licenses := Seq("Apache 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
developers := List(
Developer("non", "Erik Osheim", "[email protected]", url("http://github.com/non/"))))
lazy val noPublish = Seq(
publish := {},
publishLocal := {},
publishArtifact := false)
lazy val root = project
.in(file("."))
.settings(name := "root")
.settings(antimirovSettings: _*)
.settings(noPublish: _*)
.aggregate(coreJVM, coreJS, checkJVM, checkJS, propsJVM, propsJS, testsJVM, testsJS)
.dependsOn(coreJVM, coreJS, checkJVM, checkJS, propsJVM, propsJS, testsJVM, testsJS)
lazy val core = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.in(file("core"))
.settings(antimirovSettings: _*)
.settings(
name := "antimirov-core")
.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 check = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.in(file("check"))
.dependsOn(core)
.settings(antimirovSettings: _*)
.settings(
name := "antimirov-check",
libraryDependencies += ScalaCheck.value)
.jsSettings(
Global / scalaJSStage := FastOptStage,
parallelExecution := false,
coverageEnabled := false,
jsEnv := new org.scalajs.jsenv.nodejs.NodeJSEnv())
lazy val checkJVM = check.jvm
lazy val checkJS = check.js
lazy val props = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.in(file("props"))
.dependsOn(core)
.settings(antimirovSettings: _*)
.settings(
name := "antimirov-props",
libraryDependencies += ScalaProps.value,
// keep scalaprops testing separate so we can use parallel
// execution for all our other tests. otherwise we'd have to run
// all of tests sequentially.
testFrameworks += new TestFramework("scalaprops.ScalapropsFramework"),
Test / parallelExecution := false)
.jsSettings(
Global / scalaJSStage := FastOptStage,
coverageEnabled := false,
jsEnv := new org.scalajs.jsenv.nodejs.NodeJSEnv())
lazy val propsJVM = props.jvm
lazy val propsJS = props.js
lazy val tests = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Full)
.in(file("tests"))
.dependsOn(core, check)
.settings(antimirovSettings: _*)
.settings(noPublish: _*)
.settings(
name := "antimirov-tests",
libraryDependencies += ScalaCheck.value)
.jsSettings(
Global / scalaJSStage := FastOptStage,
parallelExecution := false,
coverageEnabled := false,
jsEnv := new org.scalajs.jsenv.nodejs.NodeJSEnv())
lazy val testsJVM = tests.jvm
lazy val testsJS = tests.js
lazy val web = project.in(file("web"))
.dependsOn(coreJS)
.settings(name := "antimirov-web")
.settings(antimirovSettings: _*)
.settings(noPublish: _*)
.settings(coverageEnabled := false)
.settings(scalaJSUseMainModuleInitializer := true)
.settings(libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "1.0.0")
.enablePlugins(ScalaJSPlugin)
lazy val bench = project.in(file("bench"))
.dependsOn(coreJVM)
.settings(name := "antimirov-bench")
.settings(antimirovSettings: _*)
.settings(noPublish: _*)
.settings(coverageEnabled := false)
.enablePlugins(JmhPlugin)