-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sbt
154 lines (139 loc) · 4.02 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
val scalaV = "2.12.2"
val crossScalaV = Seq("2.11.11", "2.12.2")
// ---- kind projector for nicer type lambdas ----
val kindProjectorPlugin = Seq(
addCompilerPlugin("org.spire-math" %% "kind-projector" % "0.9.3")
)
// ---- library for nicer typeclasses
val simulacrumPlugin = Seq(
addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full),
libraryDependencies += "com.github.mpilquist" %% "simulacrum" % "0.10.0"
)
// ---- formatting ----
scalaVersion in ThisBuild := scalaV
// ---- ammonite ----
val ammonite = Seq(
libraryDependencies += "com.lihaoyi" % "ammonite" % "0.7.8" % "test" cross CrossVersion.full,
initialCommands in (Test, console) := """ammonite.Main().run()"""
)
// ---- enable wartremover ----
import wartremover.Wart._
val wartRemover = Seq(
wartremoverWarnings in (Compile, compile) := Seq(
Any,
AsInstanceOf,
DefaultArguments,
EitherProjectionPartial,
Enumeration,
Equals,
ExplicitImplicitTypes,
FinalCaseClass,
ImplicitConversion,
IsInstanceOf,
JavaConversions,
LeakingSealed,
MutableDataStructures,
Null,
Option2Iterable,
OptionPartial,
Product,
Return,
Serializable,
ToString,
TryPartial,
Var,
While
)
)
// ---- common settings ----
val commonSettings = Seq(
organization := "com.marekkadek",
scalaVersion := scalaV,
crossScalaVersions := crossScalaV,
releaseCrossBuild := true,
scalacOptions := Seq(
// following two lines must be "together"
"-encoding",
"UTF-8",
"-Xlint",
"-Xlint:missing-interpolator",
"-deprecation",
"-feature",
"-unchecked",
"-Ywarn-dead-code",
"-Yno-adapted-args",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-Ywarn-value-discard",
"-Ywarn-unused-import",
"-Ywarn-unused",
"-Ywarn-numeric-widen"
)
// Ammonite is not yet for scala 2.12
) ++ wartRemover ++ kindProjectorPlugin ++ simulacrumPlugin // ++ ammonite
// ---- publising ----
val noPublishSettings = Seq(
publish := (),
publishLocal := (),
publishArtifact := false
)
val publishSettings = Seq(
homepage := Some(url("https://github.com/KadekM/scrawler")),
organizationHomepage := Some(url("https://github.com/KadekM/scrawler")),
licenses += ("MIT license", url("http://www.opensource.org/licenses/mit-license.php")),
publishMavenStyle := true,
publishArtifact in Test := false,
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
pomIncludeRepository := { _ =>
false
},
pomExtra :=
<scm>
<url>[email protected]:kadekm/scrawler.git</url>
<connection>scm:git:[email protected]:kadekm/scrawler.git</connection>
</scm>
<developers>
<developer>
<id>kadekm</id>
<name>Marek Kadek</name>
<url>https://github.com/KadekM</url>
</developer>
</developers>
)
// ---- modules ----
lazy val scraper = Project(id = "scraper", base = file("modules/scraper")).settings(
commonSettings,
publishSettings,
libraryDependencies ++= Seq(
"co.fs2" %% "fs2-core" % "0.9.7",
"org.jsoup" % "jsoup" % "1.10.3",
"net.sourceforge.htmlunit" % "htmlunit" % "2.26",
//"org.typelevel" %% "cats" % "0.7.2",
"org.scalatest" %% "scalatest" % "3.0.3" % Test
)
)
lazy val scrawler = Project(id = "scrawler", base = file("modules/scrawler"))
.settings(
commonSettings,
publishSettings,
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "3.0.0" % Test
)
)
.dependsOn(scraper)
.aggregate(scraper)
lazy val root = Project(id = "root", base = file("."))
.settings(
commonSettings,
noPublishSettings
)
.dependsOn(scraper, scrawler)
.aggregate(scraper, scrawler)