forked from softwaremill/quicklens
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
88 lines (83 loc) · 3.16 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
import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}
val scala211 = "2.11.12"
val scala212 = "2.12.8"
val scala213 = "2.13.0"
val buildSettings = Defaults.coreDefaultSettings ++ Seq(
organization := "com.softwaremill.quicklens",
scalaVersion := scala212,
crossScalaVersions := Seq(scalaVersion.value, scala211, scala213),
scalacOptions := Seq("-deprecation", "-feature", "-unchecked"),
scalafmtOnCompile := true,
// Sonatype OSS deployment
publishTo := Some(
if (isSnapshot.value)
Opts.resolver.sonatypeSnapshots
else
Opts.resolver.sonatypeStaging
),
credentials += Credentials(Path.userHome / ".ivy2" / ".credentials"),
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := { _ =>
false
},
developers := List(
Developer("adamw", "Adam Warski", "[email protected]", url("http://www.warski.org"))
),
scmInfo := Some(
ScmInfo(
browseUrl = url("https://github.com/adamw/quicklens"),
connection = "scm:git:[email protected]:adamw/quicklens.git"
)
),
licenses := Seq("Apache2" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt")),
homepage := Some(url("http://www.softwaremill.com")),
sonatypeProfileName := "com.softwaremill",
// sbt-release
releaseCrossBuild := true,
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
releaseIgnoreUntrackedFiles := true,
releaseProcess := QuicklensRelease.steps
)
lazy val root =
project
.in(file("."))
.settings(buildSettings)
.settings(publishArtifact := false)
.aggregate(quicklensJVM, quicklensJS, quicklensNative)
lazy val quicklens = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.crossType(CrossType.Pure)
.settings(buildSettings)
.settings(
name := "quicklens",
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value,
Test / publishArtifact := false,
libraryDependencies ++= Seq("org.scala-lang" % "scala-compiler" % scalaVersion.value % Test),
// Adds a `src/main/scala-2.13+` source directory for Scala 2.13 and newer
// and a `src/main/scala-2.13-` source directory for Scala version older than 2.13
unmanagedSourceDirectories in Compile += {
// sourceDirectory returns a platform-scoped directory, e.g. /.jvm
val sourceDir = (baseDirectory in Compile).value / ".." / "src" / "main"
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) if n >= 13 => sourceDir / "scala-2.13+"
case _ => sourceDir / "scala-2.13-"
}
}
)
.jvmSettings(
// Otherwise when running tests in sbt, the macro is not visible
// (both macro and usages are compiled in the same compiler run)
Test / fork := true
)
.platformsSettings(JVMPlatform, JSPlatform)(
libraryDependencies += "org.scalatest" %%% "scalatest" % "3.1.0-SNAP13" % Test
)
.nativeSettings(
libraryDependencies += "org.scalatest" %%% "scalatest" % "3.2.0-SNAP10" % Test,
scalaVersion := scala211,
crossScalaVersions := Seq(scala211),
nativeLinkStubs := true
)
lazy val quicklensJVM = quicklens.jvm
lazy val quicklensJS = quicklens.js
lazy val quicklensNative = quicklens.native