You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ cat build.sbt
lazy val root = (project in file("."))
.settings(
name := "Hello",
organization := "com.example",
scalaVersion := "2.12.3",
version := "0.1.0-SNAPSHOT",
scalacOptions := List("-encoding", "utf8", "-Xfatal-warnings", "-deprecation", "-unchecked"),
scalacOptions := {
val old = scalacOptions.value
scalaBinaryVersion.value match {
case "2.12" => old
case _ => old filterNot (Set("-Xfatal-warnings", "-deprecation").apply)
}
}
)
$ sbt about
[info] Updated file /home/kelemen/temp/sbt-started/project/build.properties: set sbt.version to 1.0.2
[info] Loading project definition from /home/kelemen/temp/sbt-started/project
[info] Updating {file:/home/kelemen/temp/sbt-started/project/}sbt-started-build...
[info] Done updating.
[info] Loading settings from build.sbt ...
[info] Set current project to Hello (in build file:/home/kelemen/temp/sbt-started/)
[info] This is sbt 1.0.2
[info] The current project is {file:/home/kelemen/temp/sbt-started/}root 0.1.0-SNAPSHOT
[info] The current project is built against Scala 2.12.3
[info] Available Plugins: sbt.plugins.IvyPlugin, sbt.plugins.JvmPlugin, sbt.plugins.CorePlugin, sbt.plugins.JUnitXmlReportPlugin, sbt.plugins.Giter8TemplatePlugin
[info] sbt, sbt plugins, and build definitions are using Scala 2.12.3
$ sbt
[info] Loading project definition from /home/kelemen/temp/sbt-started/project
[info] Loading settings from build.sbt ...
[info] Set current project to Hello (in build file:/home/kelemen/temp/sbt-started/)
[info] sbt server started at 127.0.0.1:5797
sbt:Hello> show scalacOptions
[info] * -encoding
[info] * utf8
[info] * -Xfatal-warnings
[info] * -deprecation
[info] * -unchecked
[success] Total time: 0 s, completed Sep 28, 2017 5:53:13 PM
sbt:Hello> ++2.11.8
[info] Setting Scala version to 2.11.8 on 0 projects.
[info] Excluded 1 projects, run ++ 2.11.8 -v for more details.
[info] Reapplying settings...
[info] Set current project to Hello (in build file:/home/kelemen/temp/sbt-started/)
sbt:Hello> show scalacOptions
[info] * -encoding
[info] * utf8
[info] * -Xfatal-warnings
[info] * -deprecation
[info] * -unchecked
[success] Total time: 0 s, completed Sep 28, 2017 5:53:30 PM
The problem is with the second execution of show scalacOptions, because according to the example it should only display -encoding, utf8, -unchecked and NOT -Xfatal-warnings and -deprecation.
The text was updated successfully, but these errors were encountered:
In the Getting Started Guide this example is not working as described with sbt 1.0.2:
http://www.scala-sbt.org/1.x/docs/Task-Graph.html#Defining+a+task+that+depends+on+other+settings
The problem is with the second execution of
show scalacOptions
, because according to the example it should only display-encoding
,utf8
,-unchecked
and NOT-Xfatal-warnings
and-deprecation
.The text was updated successfully, but these errors were encountered: