Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SBT complains about deprecations

Tags:

scala

sbt

I made up a sbt project skeleton which I use as a starting point for programs I develop.

For a while I have the problem that I receive 2 deprecation warnings when I start a new project with this skeleton. The skeleton doesn't consist of any source files and even if so, my build.sbt holds the scalac-option "-deprecation" that works fine when writing deprecated code in project sources.

The warning itself looks like this:

[info] Compiling 1 Scala source to /xxx/.../xxx/.sbt/staging/xxx/target/scala-2.9.2/sbt-0.12/classes...
[warn] there were 1 deprecation warnings; re-run with -deprecation for details
[warn] one warning found
[info] Compiling 1 Scala source to /xxx/.../xxx/project/target/scala-2.9.2/sbt-0.12/classes...
[warn] there were 1 deprecation warnings; re-run with -deprecation for details
[warn] one warning found

Though the reason for the first warning seems to be the deprecated .sbt-folder issue (so, this warning itself seems not to be a big issue within my framework) I'm a bit confused about the second warning and I'd like to ask if anyone knows how to start sbt itself with the "-deprecation" option.

Just to clarify and to emphasize that this is no duplication as korefn suggested:

scalacOptions ++= Seq( "-unchecked", "-deprecation" )

is already inside and the warnings only occure when sbt is applied first time on the skeleton. Afterwards sbt keeps silent.

There is also no bug, this option works fine for any source file I store within the skeleton.

like image 804
her Avatar asked Feb 01 '13 11:02

her


1 Answers

Ok, I received 2 possible solutions through the sbt-group, which I want to share, as this might be of interest for others.

Solution 1: Through the sbt console...

  • reload plugins
  • set scalacOptions ++= Seq( "-unchecked", "-deprecation" )
  • session save
  • reload return

Solution 2: Place a second time the line "scalacOptions ++= Seq( "-unchecked", "-deprecation" )" in a .sbt-file under the project-directory. The default would be project/plugins.sbt

Remark: "scalacOptions ++= Seq( "-unchecked", "-deprecation" )" in build.sbt catches warnings on project sources, but not on sbt plugins, etc. as mentioned in my original question.

like image 165
her Avatar answered Oct 23 '22 11:10

her