By Alvin Alexander. Last updated: August 5, 2021
Nothing major here, I just wanted to note the use of several scalacOptions
in the following build.sbt example:
organization := "com.github.jdegoes.lambdaconf" name := "introfp" version := "0.1-SNAPSHOT" scalaVersion := "2.10.4" mainClass := Some("Main") scalacOptions ++= Seq( "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-language:postfixOps" ) resolvers ++= Seq( Resolver.sonatypeRepo("releases"), Resolver.sonatypeRepo("snapshots"), "JBoss repository" at "https://repository.jboss.org/nexus/content/repositories/" ) libraryDependencies ++= Seq( "org.scalaz" %% "scalaz-core" % "7.1.0-SNAPSHOT", "org.scalaz" %% "scalaz-concurrent" % "7.1.0-SNAPSHOT", "org.scalaz" %% "scalaz-task" % "7.1.0-SNAPSHOT", "com.github.julien-truffaut" %% "monocle-core" % "0.2-SNAPSHOT", "org.scalaz" %% "scalaz-scalacheck-binding" % "7.1.0-SNAPSHOT" % "test", "org.scalacheck" %% "scalacheck" % "1.10.1" % "test", "org.specs2" %% "specs2" % "2.3.4-scalaz-7.1.0-M3" % "test" )
This _build.sbt_ file comes from this Github project.
Scala 3 scalacOptions examples
As a brief update, I just used these scalacOptions
in a Scala 3 build.sbt file:
scalacOptions ++= Seq( "-deprecation", // emit warning and location for usages of deprecated APIs "-explain", // explain errors in more detail "-explain-types", // explain type errors in more detail "-feature", // emit warning and location for usages of features that should be imported explicitly "-indent", // allow significant indentation. "-new-syntax", // require `then` and `do` in control expressions. "-print-lines", // show source code line numbers. "-unchecked", // enable additional warnings where generated code depends on assumptions "-Ykind-projector", // allow `*` as wildcard to be compatible with kind projector "-Xfatal-warnings", // fail the compilation if there are any warnings "-Xmigration" // warn about constructs whose behavior may have changed since version )