@@ -9,10 +9,10 @@ Global / onChangedBuildSource := ReloadOnSourceChanges
9
9
lazy val V = new {
10
10
val algebird = " 0.13.6"
11
11
val cats = " 2.1.0"
12
- val evilplot = " 0.7 .0"
12
+ val evilplot = " 0.9 .0"
13
13
val kindProjector = " 0.10.3"
14
14
val rainier = " 0.2.3"
15
- val scala = " 2.12.13 "
15
+ val scala = " 2.12.18 "
16
16
val scalacheck = " 1.15.3"
17
17
val scalatest = " 3.1.0"
18
18
val scalaTestPlus = " 3.1.0.1"
@@ -33,19 +33,20 @@ val compilerOptions = Seq(
33
33
34
34
// The console can't handle these.
35
35
val consoleExclusions = Seq (
36
- " -Ywarn-unused:imports" , " -Xfatal-warnings" , " -Xlint"
36
+ " -Ywarn-unused:imports" ,
37
+ " -Xfatal-warnings" ,
38
+ " -Xlint"
37
39
)
38
40
39
41
val ignoredWarts : Set [Wart ] =
40
- Set (Wart .DefaultArguments , Wart .TraversableOps , Wart .Any , Wart .NonUnitStatements )
42
+ Set (Wart .DefaultArguments , Wart .IterableOps , Wart .Any , Wart .NonUnitStatements )
41
43
42
44
def unsafeWartsExcept (ws : Set [wartremover.Wart ]): Seq [wartremover.Wart ] =
43
45
Warts .unsafe.filterNot(w => ws.exists(_.clazz == w.clazz))
44
46
45
47
val sharedSettings = Seq (
46
48
organization := " io.samritchie" ,
47
49
scalaVersion := V .scala,
48
-
49
50
// Lets me C-c out of the running process.
50
51
cancelable in Global := true ,
51
52
parallelExecution in Test := true ,
@@ -61,36 +62,32 @@ val sharedSettings = Seq(
61
62
" -Xlint" ,
62
63
" -language:implicitConversions" ,
63
64
" -language:higherKinds" ,
64
- " -language:existentials" ),
65
-
66
-
65
+ " -language:existentials"
66
+ ),
67
67
scalacOptions in (Compile , console) --= consoleExclusions,
68
68
scalacOptions in (Test , console) --= consoleExclusions,
69
-
70
69
// Publishing options:
71
70
releaseCrossBuild := true ,
72
71
releasePublishArtifactsAction := PgpKeys .publishSigned.value,
73
72
releaseVersionBump := sbtrelease.Version .Bump .Minor , // need to tweak based on mima results
74
73
publishMavenStyle := true ,
75
74
publishArtifact in Test := false ,
76
- pomIncludeRepository := { x => false },
77
-
75
+ pomIncludeRepository := { x =>
76
+ false
77
+ },
78
78
publishTo := Some (
79
- if (version.value.trim.endsWith(" SNAPSHOT" ))
80
- Opts .resolver.sonatypeSnapshots
81
- else
82
- Opts .resolver.sonatypeStaging
83
- ),
84
-
79
+ if (version.value.trim.endsWith(" SNAPSHOT" ))
80
+ Opts .resolver.sonatypeSnapshots
81
+ else
82
+ Opts .resolver.sonatypeStaging
83
+ ),
85
84
scmInfo := Some (
86
85
ScmInfo (
87
86
url(" https://github.com/sritchie/scala-rl" ),
88
87
" scm:git@github.com:sritchie/scala-rl.git"
89
88
)
90
89
),
91
-
92
- pomExtra := (
93
- <url >https:// github.com/ sritchie/ scala- rl</url >
90
+ pomExtra := (<url >https:// github.com/ sritchie/ scala- rl</url >
94
91
<licenses >
95
92
<license >
96
93
<name >Apache 2 </name >
@@ -109,10 +106,10 @@ val sharedSettings = Seq(
109
106
) ++ mimaDefaultSettings
110
107
111
108
lazy val noPublishSettings = Seq (
112
- publish := {},
113
- publishLocal := {},
114
- test := {},
115
- publishArtifact := false
109
+ publish := {},
110
+ publishLocal := {},
111
+ test := {},
112
+ publishArtifact := false
116
113
)
117
114
118
115
/**
@@ -124,28 +121,25 @@ val noBinaryCompatCheck = Set[String]("core")
124
121
def previousVersion (subProj : String ) =
125
122
Some (subProj)
126
123
.filterNot(noBinaryCompatCheck.contains(_))
127
- .map { s => " io.sritchie" %% (" scala-rl-" + s) % " 0.0.1" }
124
+ .map { s =>
125
+ " io.sritchie" %% (" scala-rl-" + s) % " 0.0.1"
126
+ }
128
127
129
- lazy val rl = Project (
130
- id = " scala-rl" ,
131
- base = file(" ." ))
128
+ lazy val rl = Project (id = " scala-rl" , base = file(" ." ))
132
129
.settings(sharedSettings)
133
130
.settings(noPublishSettings)
134
131
.aggregate(rlCore, rlBook, rlPlot, rlWorld)
135
132
136
133
def module (name : String ) = {
137
134
val id = " scala-rl-%s" .format(name)
138
- Project (id = id, base = file(id)).settings(sharedSettings ++ Seq (
139
- Keys .name := id,
140
- mimaPreviousArtifacts := previousVersion(name).toSet)
141
- )
135
+ Project (id = id, base = file(id))
136
+ .settings(sharedSettings ++ Seq (Keys .name := id, mimaPreviousArtifacts := previousVersion(name).toSet))
142
137
}
143
138
144
139
lazy val rlCore = module(" core" ).settings(
145
140
libraryDependencies ++= Seq (
146
- " com.stripe" %% " rainier-cats" % V .rainier,
147
- " com.stripe" %% " rainier-core" % V .rainier,
148
-
141
+ " com.stripe" %% " rainier-cats" % V .rainier,
142
+ " com.stripe" %% " rainier-core" % V .rainier,
149
143
// For the monoids and implementations.
150
144
" com.twitter" %% " algebird-core" % V .algebird,
151
145
" com.twitter" %% " util-core" % V .util,
@@ -157,40 +151,46 @@ lazy val rlCore = module("core").settings(
157
151
" org.scalatest" %% " scalatest" % V .scalatest % Test ,
158
152
" org.scalacheck" %% " scalacheck" % V .scalacheck % Test ,
159
153
" org.scalatestplus" %% " scalacheck-1-14" % V .scalaTestPlus % Test
160
- ) ++ Seq (compilerPlugin(" org.typelevel" %% " kind-projector" % V .kindProjector)),
154
+ ) ++ Seq (compilerPlugin(" org.typelevel" %% " kind-projector" % V .kindProjector))
161
155
)
162
156
163
- lazy val rlWorld = module(" world" ).settings(
164
- libraryDependencies ++= Seq (
165
- " org.scalatest" %% " scalatest" % V .scalatest % Test ,
166
- " org.scalacheck" %% " scalacheck" % V .scalacheck % Test
157
+ lazy val rlWorld = module(" world" )
158
+ .settings(
159
+ libraryDependencies ++= Seq (
160
+ " org.scalatest" %% " scalatest" % V .scalatest % Test ,
161
+ " org.scalacheck" %% " scalacheck" % V .scalacheck % Test
162
+ )
167
163
)
168
- ).dependsOn(rlCore)
169
-
170
- lazy val rlPlot = module(" plot" ).settings(
171
- libraryDependencies ++= Seq (
172
- // Charts.
173
- " com.cibo" %% " evilplot" % V .evilplot,
174
- " com.cibo" %% " evilplot-repl" % V .evilplot,
164
+ .dependsOn(rlCore)
165
+
166
+ lazy val rlPlot = module(" plot" )
167
+ .settings(
168
+ libraryDependencies ++= Seq (
169
+ // Charts.
170
+ " io.github.cibotech" %% " evilplot" % V .evilplot,
171
+ " io.github.cibotech" %% " evilplot-repl" % V .evilplot
172
+ )
175
173
)
176
- ) .dependsOn(rlCore)
174
+ .dependsOn(rlCore)
177
175
178
- lazy val rlBook = module(" book" ).settings(
179
- libraryDependencies ++= Seq (
180
- " org.scalatest" %% " scalatest" % V .scalatest % Test ,
181
- " org.scalacheck" %% " scalacheck" % V .scalacheck % Test
182
- ),
183
- initialCommands :=
184
- """
176
+ lazy val rlBook = module(" book" )
177
+ .settings(
178
+ libraryDependencies ++= Seq (
179
+ " org.scalatest" %% " scalatest" % V .scalatest % Test ,
180
+ " org.scalacheck" %% " scalacheck" % V .scalacheck % Test
181
+ ),
182
+ initialCommands :=
183
+ """
185
184
import com.scalarl._
186
185
import com.stripe.rainier.sampler.RNG
187
186
import com.stripe.rainier.compute.{Evaluator, Real}
188
187
189
188
implicit val rng: RNG = RNG.default
190
189
implicit val evaluator: Numeric[Real] = new Evaluator(Map.empty)
191
190
""" .stripMargin('|' ),
192
- mainClass in (Compile , run) := Some (" scalarl.book.Chapter2" ),
193
- ).dependsOn(rlCore, rlPlot, rlWorld)
191
+ mainClass in (Compile , run) := Some (" scalarl.book.Chapter2" )
192
+ )
193
+ .dependsOn(rlCore, rlPlot, rlWorld)
194
194
195
195
lazy val docsMappingsAPIDir = settingKey[String ](" Name of subdirectory in site target directory for api docs" )
196
196
@@ -200,31 +200,25 @@ lazy val docSettings = Seq(
200
200
micrositeAuthor := " Sam Ritchie" ,
201
201
micrositeUrl := " http://www.scalarl.com" ,
202
202
micrositeDocumentationUrl := " /api/com/scalarl/index.html" ,
203
-
204
203
micrositeHomepage := " http://www.scalarl.com/" ,
205
204
micrositeOrganizationHomepage := " https://www.samritchie.io" ,
206
205
micrositeTwitter := " @scalaRLProject" ,
207
206
micrositeTwitterCreator := " @sritchie" ,
208
-
209
207
micrositeGitterChannelUrl := " ScalaRL/community" ,
210
208
micrositeGithubOwner := " sritchie" ,
211
209
micrositeGithubRepo := " scala-rl" ,
212
-
213
210
micrositeAnalyticsToken := " UA-146772284-1" ,
214
-
215
211
micrositeExtraMdFiles := Map (
216
212
file(" CONTRIBUTING.md" ) ->
217
213
microsites.ExtraMdFileConfig (
218
214
" contributing.md" ,
219
215
" page" ,
220
216
Map (" title" -> " Contributing" , " section" -> " contributing" , " position" -> " 5" )
221
- )),
222
-
217
+ )
218
+ ),
223
219
micrositeEditButton := Some (
224
- MicrositeEditButton (
225
- " Help us improve this page" ,
226
- " /edit/develop/docs/src/main/tut/{{ page.path }}" )),
227
-
220
+ MicrositeEditButton (" Help us improve this page" , " /edit/develop/docs/src/main/tut/{{ page.path }}" )
221
+ ),
228
222
micrositeHighlightTheme := " atom-one-light" ,
229
223
micrositePalette := Map (
230
224
" brand-primary" -> " #5B5988" ,
@@ -234,28 +228,29 @@ lazy val docSettings = Seq(
234
228
" gray" -> " #7B7B7E" ,
235
229
" gray-light" -> " #E5E5E6" ,
236
230
" gray-lighter" -> " #F4F3F4" ,
237
- " white-color" -> " #FFFFFF" ),
238
-
231
+ " white-color" -> " #FFFFFF"
232
+ ),
239
233
autoAPIMappings := true ,
240
234
unidocProjectFilter in (ScalaUnidoc , unidoc) :=
241
- inProjects(docsSourcesAndProjects:_* ),
235
+ inProjects(docsSourcesAndProjects : _* ),
242
236
docsMappingsAPIDir := " api" ,
243
237
addMappingsToSiteDir(mappings in (ScalaUnidoc , packageDoc), docsMappingsAPIDir),
244
238
ghpagesNoJekyll := false ,
245
-
246
239
// Don't kill the cname redirect.
247
240
excludeFilter in ghpagesCleanSite :=
248
- new FileFilter {
241
+ new FileFilter {
249
242
def accept (f : File ) = (ghpagesRepository.value / " CNAME" ).getCanonicalPath == f.getCanonicalPath
250
243
} || " versions.html" ,
251
-
252
244
fork in tut := true ,
253
245
fork in (ScalaUnidoc , unidoc) := true ,
254
246
scalacOptions in (ScalaUnidoc , unidoc) ++= Seq (
255
- " -doc-source-url" , " https://github.com/sritchie/scala-rl/tree/develop€{FILE_PATH}.scala" ,
256
- " -sourcepath" , baseDirectory.in(LocalRootProject ).value.getAbsolutePath,
247
+ " -doc-source-url" ,
248
+ " https://github.com/sritchie/scala-rl/tree/develop€{FILE_PATH}.scala" ,
249
+ " -sourcepath" ,
250
+ baseDirectory.in(LocalRootProject ).value.getAbsolutePath,
257
251
// "-diagrams", // Not working locally; wait until graphviz is reliable.
258
- " -doc-root-content" , " scaladoc-root.txt"
252
+ " -doc-root-content" ,
253
+ " scaladoc-root.txt"
259
254
),
260
255
git.remoteRepo := " git@github.com:sritchie/scala-rl.git"
261
256
)
0 commit comments