-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
222 lines (195 loc) · 7.13 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
enablePlugins(com.lucidchart.sbt.scalafmt.ScalafmtPlugin)
resolvers += "Artima Maven Repository" at "http://repo.artima.com/releases"
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
evictionWarningOptions in update := EvictionWarningOptions.default
.withWarnTransitiveEvictions(false)
.withWarnDirectEvictions(false)
.withWarnScalaVersionEviction(false)
scapegoatVersion in ThisBuild := "1.3.4"
wartremoverErrors ++= Warts.unsafe
scalacOptions ++= Seq(
"-deprecation",
"-explaintypes",
"-feature",
"-language:postfixOps",
"-language:implicitConversions",
"-target:jvm-1.8",
"-unchecked",
"-Xcheckinit",
"-Xfatal-warnings",
"-Xfuture",
"-Xlint",
"-Xverify",
"-Ypartial-unification",
"-Ywarn-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-inaccessible",
"-Ywarn-infer-any",
"-Ywarn-nullary-override",
"-Ywarn-nullary-unit",
"-Ypartial-unification",
"-Ywarn-unused",
"-Ywarn-unused-import",
)
scalastyleFailOnWarning := true
scalastyleFailOnError := true
val ScalaticVersion = "3.0.4"
val ScalaLibraryVersion = "2.12.4"
val AkkaVersion = "2.5.12"
lazy val versionSnapshot = s"$ScalaticVersion-SNAPSHOT"
lazy val commonSettings = Seq(
organization := "pl.writeonly.scalaops",
scalaVersion := ScalaLibraryVersion,
version := versionSnapshot
)
lazy val IntegrationTest = config("it") extend Test
lazy val End2EndTest = config("et") extend Test
logBuffered in Test := false
testOptions in Test ++= Seq(
Tests.Argument(TestFrameworks.ScalaTest, "-o"),
Tests.Argument(TestFrameworks.ScalaTest, "-u", "target/test-reports"),
Tests.Argument(TestFrameworks.ScalaTest, "-h", "target/test-reports")
)
lazy val integrationInConfig = inConfig(IntegrationTest)(Defaults.testTasks)
lazy val end2endInConfig = inConfig(End2EndTest)(Defaults.testTasks)
def whiteFilter(name: String): Boolean = (name endsWith "AssertSpec") || (name endsWith "FutureSpec")
def grayFilter(name: String): Boolean = (name endsWith "ScalarSpec") || (name endsWith "VectorSpec")
def blackFilter(name: String): Boolean = (name endsWith "FunSpec") || (name endsWith "FeatureSpec")
lazy val whiteSetting = testOptions in Test := Seq(Tests.Filter(whiteFilter))
lazy val graySetting = testOptions in IntegrationTest := Seq(Tests.Filter(grayFilter))
lazy val blackSetting = testOptions in End2EndTest := Seq(Tests.Filter(blackFilter))
lazy val inConfigs = Seq(integrationInConfig, end2endInConfig)
lazy val settings = Seq(whiteSetting, graySetting, blackSetting)
lazy val scallops = (project in file("."))
// .enablePlugins(JacocoItPlugin)
.aggregate(specs, ops, pipe, monoidSpecs, monoid, monoidExternal, loggingCommon, loggingActor, loggingTyped)
.dependsOn(specs, ops, pipe, monoidSpecs, monoid, monoidExternal, loggingCommon, loggingActor, loggingTyped)
.configs(IntegrationTest, End2EndTest)
.settings(
name := "scalaops",
commonSettings,
integrationInConfig, end2endInConfig,
whiteSetting, graySetting, blackSetting,
coverageEnabled := true,
coverageMinimum := 0,
coverageFailOnMinimum := true,
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-library" % ScalaLibraryVersion,
)
)
lazy val loggingTyped = (project in file("scallops-logging-typed"))
.dependsOn(specs, pipe, ops, loggingCommon)
.configs(IntegrationTest, End2EndTest)
.settings(
name := "scallops-logging-typed",
commonSettings,
integrationInConfig, end2endInConfig,
whiteSetting, graySetting, blackSetting,
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor-typed" % AkkaVersion,
)
)
lazy val loggingActor = (project in file("scallops-logging-actor"))
.dependsOn(specs, pipe, ops, loggingCommon)
.configs(IntegrationTest, End2EndTest)
.settings(
name := "scallops-logging-actor",
commonSettings,
integrationInConfig, end2endInConfig,
whiteSetting, graySetting, blackSetting,
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % AkkaVersion,
)
)
lazy val loggingCommon = (project in file("scallops-logging-common"))
.dependsOn(specs, pipe, ops)
.configs(IntegrationTest, End2EndTest)
.settings(
name := "scallops-logging-common",
commonSettings,
integrationInConfig, end2endInConfig,
whiteSetting, graySetting, blackSetting,
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-library" % ScalaLibraryVersion,
"com.typesafe.akka" %% "akka-slf4j" % AkkaVersion,
"ch.qos.logback" % "logback-classic" % "1.2.3"
)
)
lazy val monoidExternal = (project in file("scallops-monoid-external"))
.dependsOn(specs, pipe, ops, monoidSpecs, monoid)
.configs(IntegrationTest, End2EndTest)
.settings(
name := "scala-for-future-external",
commonSettings,
integrationInConfig, end2endInConfig,
whiteSetting, graySetting, blackSetting,
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-library" % ScalaLibraryVersion,
"org.scalactic" %% "scalactic" % ScalaticVersion,
"org.typelevel" %% "cats-core" % "1.1.0",
"org.scalaz" %% "scalaz-core" % "7.2.22"
)
)
lazy val monoid = (project in file("scallops-monoid"))
.dependsOn(specs, pipe, ops, monoidSpecs)
.configs(IntegrationTest, End2EndTest)
.settings(
name := "scala-for-future",
commonSettings,
integrationInConfig, end2endInConfig,
whiteSetting, graySetting, blackSetting,
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-library" % ScalaLibraryVersion,
)
)
lazy val monoidSpecs = (project in file("scallops-monoid-specs"))
.dependsOn(specs, pipe, ops)
.configs(IntegrationTest, End2EndTest)
.settings(
name := "scala-for-future-specs",
commonSettings,
integrationInConfig, end2endInConfig,
whiteSetting, graySetting, blackSetting,
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-library" % ScalaLibraryVersion,
)
)
lazy val ops = (project in file("scala-ops"))
.dependsOn(specs, pipe)
.configs(IntegrationTest, End2EndTest)
.settings(
name := "scala-ops",
commonSettings,
integrationInConfig, end2endInConfig,
whiteSetting, graySetting, blackSetting,
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-library" % ScalaLibraryVersion,
// "org.scalactic" %% "scalactic" % ScalaticVersion,
// "org.typelevel" %% "cats-core" % "1.1.0"
)
)
lazy val pipe = (project in file("scala-pipe"))
.dependsOn(specs)
.configs(IntegrationTest, End2EndTest)
.settings(
name := "scala-pipe",
commonSettings,
integrationInConfig, end2endInConfig,
whiteSetting, graySetting, blackSetting,
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-library" % ScalaLibraryVersion,
)
)
lazy val specs = (project in file("scala-specs"))
.settings(
name := "scala-specs",
commonSettings,
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-library" % ScalaLibraryVersion,
"com.typesafe.scala-logging" %% "scala-logging" % "3.7.2",
"org.scalamock" %% "scalamock-scalatest-support" % "3.6.0",
"org.scalacheck" %% "scalacheck" % "1.13.5",
"org.pegdown" % "pegdown" % "1.6.0",
"ch.qos.logback" % "logback-classic" % "1.2.3"
)
)