diff --git a/build.sbt b/build.sbt index 4bdae47f..5b657ff6 100644 --- a/build.sbt +++ b/build.sbt @@ -7,7 +7,7 @@ Global / onChangedBuildSource := ReloadOnSourceChanges /* dependency versions */ lazy val V = new { - val algebird = "0.13.6" + val algebird = "0.13.10" val cats = "2.1.0" val evilplot = "0.7.0" val kindProjector = "0.10.3" @@ -33,7 +33,9 @@ val compilerOptions = Seq( // The console can't handle these. val consoleExclusions = Seq( - "-Ywarn-unused:imports", "-Xfatal-warnings", "-Xlint" + "-Ywarn-unused:imports", + "-Xfatal-warnings", + "-Xlint" ) val ignoredWarts: Set[Wart] = @@ -45,7 +47,6 @@ def unsafeWartsExcept(ws: Set[wartremover.Wart]): Seq[wartremover.Wart] = val sharedSettings = Seq( organization := "io.samritchie", scalaVersion := V.scala, - // Lets me C-c out of the running process. cancelable in Global := true, parallelExecution in Test := true, @@ -61,36 +62,32 @@ val sharedSettings = Seq( "-Xlint", "-language:implicitConversions", "-language:higherKinds", - "-language:existentials"), - - + "-language:existentials" + ), scalacOptions in (Compile, console) --= consoleExclusions, scalacOptions in (Test, console) --= consoleExclusions, - // Publishing options: releaseCrossBuild := true, releasePublishArtifactsAction := PgpKeys.publishSigned.value, releaseVersionBump := sbtrelease.Version.Bump.Minor, // need to tweak based on mima results publishMavenStyle := true, publishArtifact in Test := false, - pomIncludeRepository := { x => false }, - + pomIncludeRepository := { x => + false + }, publishTo := Some( - if (version.value.trim.endsWith("SNAPSHOT")) - Opts.resolver.sonatypeSnapshots - else - Opts.resolver.sonatypeStaging - ), - + if (version.value.trim.endsWith("SNAPSHOT")) + Opts.resolver.sonatypeSnapshots + else + Opts.resolver.sonatypeStaging + ), scmInfo := Some( ScmInfo( url("https://github.com/sritchie/scala-rl"), "scm:git@github.com:sritchie/scala-rl.git" ) ), - - pomExtra := ( - https://github.com/sritchie/scala-rl + pomExtra := (https://github.com/sritchie/scala-rl Apache 2 @@ -109,10 +106,10 @@ val sharedSettings = Seq( ) ++ mimaDefaultSettings lazy val noPublishSettings = Seq( - publish := {}, - publishLocal := {}, - test := {}, - publishArtifact := false + publish := {}, + publishLocal := {}, + test := {}, + publishArtifact := false ) /** @@ -124,28 +121,25 @@ val noBinaryCompatCheck = Set[String]("core") def previousVersion(subProj: String) = Some(subProj) .filterNot(noBinaryCompatCheck.contains(_)) - .map { s => "io.sritchie" %% ("scala-rl-" + s) % "0.0.1" } + .map { s => + "io.sritchie" %% ("scala-rl-" + s) % "0.0.1" + } -lazy val rl = Project( - id = "scala-rl", - base = file(".")) +lazy val rl = Project(id = "scala-rl", base = file(".")) .settings(sharedSettings) .settings(noPublishSettings) .aggregate(rlCore, rlBook, rlPlot, rlWorld) def module(name: String) = { val id = "scala-rl-%s".format(name) - Project(id = id, base = file(id)).settings(sharedSettings ++ Seq( - Keys.name := id, - mimaPreviousArtifacts := previousVersion(name).toSet) - ) + Project(id = id, base = file(id)) + .settings(sharedSettings ++ Seq(Keys.name := id, mimaPreviousArtifacts := previousVersion(name).toSet)) } lazy val rlCore = module("core").settings( libraryDependencies ++= Seq( - "com.stripe" %% "rainier-cats" % V.rainier, - "com.stripe" %% "rainier-core" % V.rainier, - + "com.stripe" %% "rainier-cats" % V.rainier, + "com.stripe" %% "rainier-core" % V.rainier, // For the monoids and implementations. "com.twitter" %% "algebird-core" % V.algebird, "com.twitter" %% "util-core" % V.util, @@ -157,31 +151,36 @@ lazy val rlCore = module("core").settings( "org.scalatest" %% "scalatest" % V.scalatest % Test, "org.scalacheck" %% "scalacheck" % V.scalacheck % Test, "org.scalatestplus" %% "scalacheck-1-14" % V.scalaTestPlus % Test - ) ++ Seq(compilerPlugin("org.typelevel" %% "kind-projector" % V.kindProjector)), + ) ++ Seq(compilerPlugin("org.typelevel" %% "kind-projector" % V.kindProjector)) ) -lazy val rlWorld = module("world").settings( - libraryDependencies ++= Seq( - "org.scalatest" %% "scalatest" % V.scalatest % Test, - "org.scalacheck" %% "scalacheck" % V.scalacheck % Test +lazy val rlWorld = module("world") + .settings( + libraryDependencies ++= Seq( + "org.scalatest" %% "scalatest" % V.scalatest % Test, + "org.scalacheck" %% "scalacheck" % V.scalacheck % Test + ) ) -).dependsOn(rlCore) - -lazy val rlPlot = module("plot").settings( - libraryDependencies ++= Seq( - // Charts. - "com.cibo" %% "evilplot" % V.evilplot, - "com.cibo" %% "evilplot-repl" % V.evilplot, + .dependsOn(rlCore) + +lazy val rlPlot = module("plot") + .settings( + libraryDependencies ++= Seq( + // Charts. + "com.cibo" %% "evilplot" % V.evilplot, + "com.cibo" %% "evilplot-repl" % V.evilplot + ) ) -).dependsOn(rlCore) + .dependsOn(rlCore) -lazy val rlBook = module("book").settings( - libraryDependencies ++= Seq( - "org.scalatest" %% "scalatest" % V.scalatest % Test, - "org.scalacheck" %% "scalacheck" % V.scalacheck % Test - ), - initialCommands := - """ +lazy val rlBook = module("book") + .settings( + libraryDependencies ++= Seq( + "org.scalatest" %% "scalatest" % V.scalatest % Test, + "org.scalacheck" %% "scalacheck" % V.scalacheck % Test + ), + initialCommands := + """ import com.scalarl._ import com.stripe.rainier.sampler.RNG import com.stripe.rainier.compute.{Evaluator, Real} @@ -189,8 +188,9 @@ import com.stripe.rainier.compute.{Evaluator, Real} implicit val rng: RNG = RNG.default implicit val evaluator: Numeric[Real] = new Evaluator(Map.empty) """.stripMargin('|'), - mainClass in (Compile, run) := Some("scalarl.book.Chapter2"), -).dependsOn(rlCore, rlPlot, rlWorld) + mainClass in (Compile, run) := Some("scalarl.book.Chapter2") + ) + .dependsOn(rlCore, rlPlot, rlWorld) lazy val docsMappingsAPIDir = settingKey[String]("Name of subdirectory in site target directory for api docs") @@ -200,31 +200,25 @@ lazy val docSettings = Seq( micrositeAuthor := "Sam Ritchie", micrositeUrl := "http://www.scalarl.com", micrositeDocumentationUrl := "/api/com/scalarl/index.html", - micrositeHomepage := "http://www.scalarl.com/", micrositeOrganizationHomepage := "https://www.samritchie.io", micrositeTwitter := "@scalaRLProject", micrositeTwitterCreator := "@sritchie", - micrositeGitterChannelUrl := "ScalaRL/community", micrositeGithubOwner := "sritchie", micrositeGithubRepo := "scala-rl", - micrositeAnalyticsToken := "UA-146772284-1", - micrositeExtraMdFiles := Map( file("CONTRIBUTING.md") -> microsites.ExtraMdFileConfig( "contributing.md", "page", Map("title" -> "Contributing", "section" -> "contributing", "position" -> "5") - )), - + ) + ), micrositeEditButton := Some( - MicrositeEditButton( - "Help us improve this page", - "/edit/develop/docs/src/main/tut/{{ page.path }}")), - + MicrositeEditButton("Help us improve this page", "/edit/develop/docs/src/main/tut/{{ page.path }}") + ), micrositeHighlightTheme := "atom-one-light", micrositePalette := Map( "brand-primary" -> "#5B5988", @@ -234,28 +228,29 @@ lazy val docSettings = Seq( "gray" -> "#7B7B7E", "gray-light" -> "#E5E5E6", "gray-lighter" -> "#F4F3F4", - "white-color" -> "#FFFFFF"), - + "white-color" -> "#FFFFFF" + ), autoAPIMappings := true, unidocProjectFilter in (ScalaUnidoc, unidoc) := - inProjects(docsSourcesAndProjects:_*), + inProjects(docsSourcesAndProjects: _*), docsMappingsAPIDir := "api", addMappingsToSiteDir(mappings in (ScalaUnidoc, packageDoc), docsMappingsAPIDir), ghpagesNoJekyll := false, - // Don't kill the cname redirect. excludeFilter in ghpagesCleanSite := - new FileFilter{ + new FileFilter { def accept(f: File) = (ghpagesRepository.value / "CNAME").getCanonicalPath == f.getCanonicalPath } || "versions.html", - fork in tut := true, fork in (ScalaUnidoc, unidoc) := true, scalacOptions in (ScalaUnidoc, unidoc) ++= Seq( - "-doc-source-url", "https://github.com/sritchie/scala-rl/tree/develop€{FILE_PATH}.scala", - "-sourcepath", baseDirectory.in(LocalRootProject).value.getAbsolutePath, + "-doc-source-url", + "https://github.com/sritchie/scala-rl/tree/develop€{FILE_PATH}.scala", + "-sourcepath", + baseDirectory.in(LocalRootProject).value.getAbsolutePath, // "-diagrams", // Not working locally; wait until graphviz is reliable. - "-doc-root-content", "scaladoc-root.txt" + "-doc-root-content", + "scaladoc-root.txt" ), git.remoteRepo := "git@github.com:sritchie/scala-rl.git" )