-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
114 lines (98 loc) · 3.26 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
import sbt._
import sbt.Keys._
import xerial.sbt.Sonatype._
import ReleaseTransformations._
import spray.boilerplate.BoilerplatePlugin
// https://github.com/xerial/sbt-sonatype/issues/71
publishTo in ThisBuild := sonatypePublishTo.value
enablePlugins(BoilerplatePlugin)
lazy val scala213 = "2.13.2"
lazy val scala212 = "2.12.11"
lazy val scala211 = "2.11.12"
organization := "com.github.andyglow"
homepage := Some(new URL("http://github.com/andyglow/scala-tuples"))
startYear := Some(2020)
organizationName := "andyglow"
name := "scala-tuples"
version := "0.1.0"
scalaVersion := scala211
crossScalaVersions := List(scala213, scala212, scala211)
publishMavenStyle := true
publishArtifact := true
scalacOptions ++= {
val options = Seq(
"-encoding", "UTF-8",
"-feature",
"-unchecked",
"-deprecation",
"-language:experimental.macros",
"-Xfatal-warnings",
"-Xlint",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Xfuture")
// WORKAROUND https://github.com/scala/scala/pull/5402
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 12)) => options.map {
case "-Xlint" => "-Xlint:-unused,_"
case "-Ywarn-unused-import" => "-Ywarn-unused:imports,-patvars,-privates,-locals,-params,-implicits"
case other => other
}
case Some((2, minor)) if minor >= 13 =>
val non213 = Set("-Xfuture", "-Yno-adapted-args")
options.filterNot(non213.apply)
case _ => options
}
}
scalacOptions in (Compile,doc) ++= Seq(
"-groups",
"-implicits",
"-no-link-warnings")
licenses := Seq(("LGPL-3.0", url("http://opensource.org/licenses/LGPL-3.0")))
sonatypeProfileName := "com.github.andyglow"
sonatypeProjectHosting := Some(
GitHubHosting(
"andyglow",
"scala-patch",
scmInfo := Some(
ScmInfo(
url("https://github.com/andyglow/scala-tuples"),
"scm:[email protected]:andyglow/scala-tuples.git"))
developers := List(
Developer(
id = "andyglow",
name = "Andriy Onyshchuk",
email = "[email protected]",
url = url("https://ua.linkedin.com/in/andyglow")))
releasePublishArtifactsAction := PgpKeys.publishSigned.value
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
ReleaseStep(action = Command.process("publishSigned", _), enableCrossBuild = true),
setNextVersion,
commitNextVersion,
ReleaseStep(action = Command.process("sonatypeReleaseAll", _), enableCrossBuild = true),
pushChanges)
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "3.1.1" % Test,
"org.scalacheck" %% "scalacheck" % "1.14.1" % Test) ++ Seq(
(scalaVersion apply ("org.scala-lang" % "scala-reflect" % _ % Compile)).value.withSources.withJavadoc)
sourceGenerators in Compile += Def.task {
val v = (scalaVersion in Compile).value
val s = (sourceManaged in Compile).value
val log = Keys.streams.value.log
Boiler.gen(s, v, log)
}
mappings in (Compile, packageSrc) ++= {
val base = (sourceManaged in Compile).value
(managedSources in Compile).value.map { file =>
file -> file.relativeTo(base).get.getPath
}
}