-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
138 lines (129 loc) · 4.36 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
import com.typesafe.sbt.pgp.PgpKeys.publishSigned
import Dependencies._
lazy val contributors = Seq(
"kryptt" -> "Rodolfo Hansen"
)
scalacOptions in ThisBuild ++= Seq(
"-deprecation",
"-encoding", "utf8",
"-explaintypes",
"-feature",
"-language:existentials",
"-language:postfixOps",
"-language:implicitConversions",
"-language:higherKinds",
"-language:experimental.macros",
"-unchecked",
"-Xcheckinit",
"-Xfatal-warnings",
"-Xfuture",
"-Xlint:adapted-args",
"-Xlint:by-name-right-associative",
"-Xlint:delayedinit-select",
"-Xlint:doc-detached",
"-Xlint:inaccessible",
"-Xlint:infer-any",
"-Xlint:missing-interpolator",
"-Xlint:nullary-override",
"-Xlint:nullary-unit",
"-Xlint:option-implicit",
"-Xlint:package-object-classes",
"-Xlint:poly-implicit-overload",
"-Xlint:private-shadow",
"-Xlint:stars-align",
"-Xlint:type-parameter-shadow",
"-Xlint:unsound-match",
"-Yno-adapted-args",
"-Ypartial-unification",
"-Ywarn-dead-code",
"-Ywarn-inaccessible",
"-Ywarn-infer-any",
"-Ywarn-nullary-override",
"-Ywarn-nullary-unit",
"-Ywarn-numeric-widen",
"-Ywarn-value-discard") ++ (
if (scalaVersion.value.startsWith("2.12")) Seq(
"-Xlint:constant",
"-Ybackend-parallelism", "4",
"-Ywarn-extra-implicit",
"-Ywarn-unused:implicits",
"-Ywarn-unused:imports",
"-Ywarn-unused:locals",
"-Ywarn-unused:params",
"-Ywarn-unused:patvars",
"-Ywarn-unused:privates",
) else Seq())
def getInteractive(q: Seq[String]) =
q.filterNot(Set("-Ywarn-unused:imports", "-Xfatal-warnings")) ++
Seq("-Yrangepos", "-Ydelambdafy:inline")
scalacOptions in (Compile, console) ~= getInteractive
scalacOptions in (Test, console) ~= getInteractive
addCompilerPlugin("org.spire-math" %% "kind-projector" % "0.9.7")
lazy val scaladocSettings = Seq(
scalacOptions in (Compile, doc) ++= Seq(
"-doc-source-url", scmInfo.value.get.browseUrl + "/tree/master€{FILE_PATH}.scala",
"-sourcepath", baseDirectory.in(LocalRootProject).value.getAbsolutePath,
"-implicits",
"-implicits-show-all"
),
scalacOptions in (Compile, doc) ~= { _ filterNot { _ == "-Xfatal-warnings" } },
autoAPIMappings := true
)
lazy val publishingSettings = Seq(
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (version.value.trim.endsWith("SNAPSHOT"))
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
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,
publishMavenStyle := true,
pomIncludeRepository := { _ => false },
pomExtra := {
<url>https://github.com/krpytt/fs2-hdfs</url>
<developers>
{for ((username, name) <- contributors) yield
<developer>
<id>{username}</id>
<name>{name}</name>
<url>http://github.com/{username}</url>
</developer>
}
</developers>
},
pomPostProcess := { node =>
import scala.xml._
import scala.xml.transform._
def stripIf(f: Node => Boolean) = new RewriteRule {
override def transform(n: Node) =
if (f(n)) NodeSeq.Empty else n
}
val stripTestScope = stripIf { n => n.label == "dependency" && (n \ "scope").text == "test" }
new RuleTransformer(stripTestScope).transform(node)(0)
}
)
lazy val releaseSettings = Seq(
releaseCrossBuild := true,
releasePublishArtifactsAction := PgpKeys.publishSigned.value
)
lazy val root = (project in file("."))
.settings(scaladocSettings)
.settings(publishingSettings)
.settings(releaseSettings)
.settings(organization := "net.kindleit",
name := "fs2-hdfs",
scalaVersion := "2.12.6",
crossScalaVersions := Seq("2.11.12", "2.12.6"),
scmInfo := Some(ScmInfo(url("https://github.com/kindleit/fs2-hdfs"), "[email protected]:kindleit/fs2-hdfs.git")),
homepage := None,
licenses += ("MIT", url("http://opensource.org/licenses/MIT")),
libraryDependencies ++= fs2,
libraryDependencies += hdfsCli % "provided",
libraryDependencies ++= logging,
libraryDependencies ++= hdfsSrv.map(_ % "test"),
libraryDependencies += specs2 % "test",
)