forked from typelevel/scalacheck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
136 lines (106 loc) · 4.04 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
sourceDirectory := file("dummy source directory")
scalaVersionSettings
lazy val versionNumber = "1.14.1"
lazy val isRelease = false
lazy val travisCommit = Option(System.getenv().get("TRAVIS_COMMIT"))
lazy val scalaVersionSettings = Seq(
scalaVersion := "2.12.6",
crossScalaVersions := Seq("2.10.7", "2.11.12", "2.13.0-M3", scalaVersion.value)
)
lazy val sharedSettings = MimaSettings.settings ++ scalaVersionSettings ++ Seq(
name := "scalacheck",
version := {
val suffix =
if (isRelease) ""
else travisCommit.map("-" + _.take(7)).getOrElse("") + "-SNAPSHOT"
versionNumber + suffix
},
isSnapshot := !isRelease,
organization := "org.scalacheck",
licenses := Seq("BSD-style" -> url("http://www.opensource.org/licenses/bsd-license.php")),
homepage := Some(url("http://www.scalacheck.org")),
credentials ++= (for {
username <- Option(System.getenv().get("SONATYPE_USERNAME"))
password <- Option(System.getenv().get("SONATYPE_PASSWORD"))
} yield Credentials(
"Sonatype Nexus Repository Manager",
"oss.sonatype.org",
username, password
)).toSeq,
unmanagedSourceDirectories in Compile += (baseDirectory in LocalRootProject).value / "src" / "main" / "scala",
unmanagedSourceDirectories in Test += (baseDirectory in LocalRootProject).value / "src" / "test" / "scala",
resolvers += "sonatype" at "https://oss.sonatype.org/content/repositories/releases",
javacOptions += "-Xmx1024M",
scalacOptions ++= Seq(
"-deprecation",
"-encoding", "UTF-8",
"-feature",
"-unchecked",
"-Xfatal-warnings",
"-Xfuture",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-inaccessible",
"-Ywarn-nullary-override",
"-Ywarn-nullary-unit",
"-Ywarn-numeric-widen") ++ {
scalaBinaryVersion.value match {
case "2.10" => Seq("-Xlint")
case "2.11" => Seq("-Xlint", "-Ywarn-infer-any", "-Ywarn-unused-import")
case _ => Seq("-Xlint:-unused", "-Ywarn-infer-any", "-Ywarn-unused-import", "-Ywarn-unused:-patvars,-implicits,-locals,-privates,-explicits")
}
},
// HACK: without these lines, the console is basically unusable,
// since all imports are reported as being unused (and then become
// fatal errors).
scalacOptions in (Compile, console) ~= {_.filterNot("-Ywarn-unused-import" == _)},
scalacOptions in (Test, console) := (scalacOptions in (Compile, console)).value,
// don't use fatal warnings in tests
scalacOptions in Test ~= (_ filterNot (_ == "-Xfatal-warnings")),
mimaPreviousArtifacts := Set("org.scalacheck" %% "scalacheck" % "1.14.0"),
publishTo := {
val nexus = "https://oss.sonatype.org/"
val (name, path) = if (isSnapshot.value) ("snapshots", "content/repositories/snapshots")
else ("releases", "service/local/staging/deploy/maven2")
Some(name at nexus + path)
},
publishMavenStyle := true,
// Travis should only publish snapshots
publishArtifact := !(isRelease && travisCommit.isDefined),
publishArtifact in Test := false,
pomIncludeRepository := { _ => false },
pomExtra := {
<scm>
<url>https://github.com/rickynils/scalacheck</url>
<connection>scm:git:[email protected]:rickynils/scalacheck.git</connection>
</scm>
<developers>
<developer>
<id>rickynils</id>
<name>Rickard Nilsson</name>
</developer>
</developers>
}
)
lazy val js = project.in(file("js"))
.settings(sharedSettings: _*)
.settings(
scalaJSStage in Global := FastOptStage,
libraryDependencies += "org.scala-js" %% "scalajs-test-interface" % scalaJSVersion
)
.enablePlugins(ScalaJSPlugin)
lazy val jvm = project.in(file("jvm"))
.settings(sharedSettings: _*)
.settings(
libraryDependencies += "org.scala-sbt" % "test-interface" % "1.0"
)
lazy val native = project.in(file("native"))
.settings(sharedSettings: _*)
.settings(
doc in Compile := (doc in Compile in jvm).value,
scalaVersion := "2.11.12",
libraryDependencies ++= Seq(
"org.scala-native" %% "test-interface_native0.3" % nativeVersion
)
)
.enablePlugins(ScalaNativePlugin)