-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.sbt
77 lines (72 loc) · 2.61 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
import sbtcrossproject.CrossPlugin.autoImport.{CrossType, crossProject}
import xerial.sbt.Sonatype._
ThisBuild / scalacOptions ++= Seq( // use ++= to add to existing options
"-encoding",
"utf8", // if an option takes an arg, supply it on the same line
"-feature", // then put the next option on a new line for easy editing
"-language:implicitConversions",
"-language:existentials",
"-unchecked",
"-Xfatal-warnings",
"-deprecation"
)
inThisBuild(
List(
name := "url-dsl",
organization := "be.doeraene",
description := "A tiny library for parsing and creating urls in a type-safe way",
homepage := Some(url("https://github.com/sherpal/url-dsl")),
licenses := List("MIT" -> url("http://www.opensource.org/licenses/mit-license.php")),
developers := List(
Developer(
"sherpal",
"Antoine Doeraene",
url("https://github.com/sherpal")
)
),
crossScalaVersions := Seq("3.3.1", "2.13.14", "2.12.19"),
scalaVersion := crossScalaVersions.value.head,
autoAPIMappings := true
)
)
lazy val `url-dsl` = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.in(file("url-dsl"))
.settings(name := "url-dsl")
.settings(
libraryDependencies ++= Seq(
"app.tulz" %%% "tuplez-full-light" % "0.4.0",
"org.scalatest" %%% "scalatest" % "3.2.14" % Test,
"org.scalacheck" %%% "scalacheck" % "1.17.0" % Test,
"org.scalameta" %%% "munit" % "0.7.29" % Test
),
(Compile / doc / scalacOptions) ++= Seq(
"-no-link-warnings" // Suppress scaladoc "Could not find any member to link for" warnings
),
Compile / doc / scalacOptions ~= ((options: Seq[String]) => options.filterNot(_ == "-Xfatal-warnings"))
)
.jsSettings(
scalacOptions ++= sys.env.get("CI").map { _ =>
val localSourcesPath = (LocalRootProject / baseDirectory).value.toURI
val remoteSourcesPath = s"https://raw.githubusercontent.com/sherpal/url-dsl/${git.gitHeadCommit.value.get}/"
val sourcesOptionName =
if (scalaVersion.value.startsWith("2.")) "-P:scalajs:mapSourceURI" else "-scalajs-mapSourceURI"
s"${sourcesOptionName}:$localSourcesPath->$remoteSourcesPath"
}
)
.jvmSettings(
coverageFailOnMinimum := false,
coverageMinimumStmtTotal := 70,
coverageMinimumBranchTotal := 50,
coverageMinimumStmtPerPackage := 80,
coverageMinimumBranchPerPackage := 100,
coverageMinimumStmtPerFile := 60,
coverageMinimumBranchPerFile := 100
)
lazy val root = project
.in(file("."))
.aggregate(`url-dsl`.js, `url-dsl`.jvm)
.settings(
publish / skip := true
)