Skip to content

Instantly share code, notes, and snippets.

@deanwampler
Created March 26, 2022 15:49
Show Gist options
  • Save deanwampler/3776747b5989aab2509704a272211087 to your computer and use it in GitHub Desktop.
Save deanwampler/3776747b5989aab2509704a272211087 to your computer and use it in GitHub Desktop.
// Requires a snapshot or nightly build of Scala
val scala3 = "3.1.3-RC1-bin-SNAPSHOT"
lazy val root = project
.in(file("."))
.settings(
name := "erased-feature-example",
description := "An example of the experimental 'erased' feature.",
version := "0.0.1",
scalaVersion := scala3,
organization := "org.programming-scala",
organizationName := "ProgrammingScala",
organizationHomepage := Some(url("http://programming-scala.org")),
homepage := Some(url("https://github.com/deanwampler/programming-scala-book-code-examples/")),
licenses += "Apache2" -> url("http://www.apache.org/licenses/LICENSE-2.0"),
maxErrors := 10,
scalacOptions := Seq(
"-encoding", "utf-8", // Specify character encoding used by source files.
"-deprecation", // Emit warning and location for usages of deprecated APIs.
"-unchecked", // Enable additional warnings where generated code depends on assumptions.
"-feature", // Emit warning and location for usages of features that should be imported explicitly.
"-explain", // Explain errors in more detail.
"-new-syntax", // Require `then` and `do` in control expressions.
"-source:future", // Choices: future and future-migration. I use this to force future deprecation warnings, etc.
"-Xfatal-warnings", // Fail on warnings, not just errors
),
Compile / console / scalacOptions := scalacOptions.value,
fork := true,
javaOptions ++= Seq(
"-Duser.language=en_US"
),
javacOptions ++= Seq(
"-Xlint:unchecked", "-Xlint:deprecation") // Java 8: "-Xdiags:verbose"),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment