Sunday, 15 September 2013

How to set scalacOptions used by SBT when compiling Build.scala? -



How to set scalacOptions used by SBT when compiling Build.scala? -

i'm having bit of problem trying figure out how set/append scalacoptions used sbt when compiling build.scala. on team copied bit of code akka's build.scala , result bunch of deprecated warnings , feature warning.

$ reload [info] loading global plugins /users/xxx/.sbt/0.13/plugins [info] loading project definition /users/xxx/yyy/zzz/project [info] compiling 1 scala source /users/xxx/yyy/zzz/project/target/scala-2.10/sbt-0.13/classes... [warn] there 3 deprecation warning(s); re-run -deprecation details [warn] there 1 feature warning(s); re-run -feature details [warn] 2 warnings found

things have tried

add scalacoptions ++= seq("-unchecked", "-feature") build.sbt. hoping loaded before build.scala compiled. already had scalacoptions ++= seq(...., "-unchecked", "-feature") in build.scala

attempt set scalacoptions prior reload appears discarded

$ ;set scalacoptions ++= seq("-feature", "-deprecated") ;reload [info] defining zzz/*:scalacoptions [info] new value used zzz/compile:scalacoptions [info] reapplying settings... [info] set current project zzz (in build file:/users/xxx/yyy/zzz/) [info] loading global plugins /users/xxx/.sbt/0.13/plugins [info] loading project definition /users/xxx/yyy/zzz/project [info] compiling 1 scala source /users/xxx/yyy/zzz/project/target/scala-2.10/sbt-0.13/classes... [warn] there 3 deprecation warning(s); re-run -deprecation details [warn] there 1 feature warning(s); re-run -feature details [warn] 2 warnings found [warn] discarding 1 session setting. utilize 'session save' persist session settings.

through much blood sweat able find cause of deprecated warnings, can't find cause of feature warning.

sbt recursive, means build.scala in project directory build definition in parent directory or build.sbt in project directory.

therefore have create build.sbt in project directory. in project/build.sbt should able set scalacoptions ++= seq("-unchecked", "-feature").

scala sbt

No comments:

Post a Comment