5

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.

her
  • 111
  • 5

2 Answers2

6

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.

her
  • 111
  • 5
-1

This is duplicate. check for solution scala-sbt-how-to-re-run-with-deprecation or how-to-see-all-the-warnings-in-sbt-0-11

basically add to build.sbt:

scalacOptions ++= Seq("-unchecked", "-deprecation","-feature") //any other option
//you like
Community
  • 1
  • 1
korefn
  • 955
  • 6
  • 17
  • Sorry, but as I mentioned, this is already inside. But this scalacOptions doesn't seem to get applied when the skeleton is first started. – her Feb 01 '13 at 11:42
  • Have you tried to compile a hello world example to find what reports are thrown(Deprecation/feature warnings)? – korefn Feb 01 '13 at 11:53
  • The project skeleton is source-wise empty, and even if I place valid helloworlds before first applying sbt on the skeleton behavior remains the same. The skeleton consists of an individual src-folder structure, some git setups (.gitignore, etc.), vim-configuration, some native libs and text-files. Otherwise it holds only my sbt configuration files. The sbt-configuration handles the plugins I frequently use which all work. I assume the warning must be with regards to the "compilation" process of the configuration files as they only occure when sbt is first applied on the skeleton. – her Feb 01 '13 at 12:08
  • I already checked sbt options and played around with the sbt shell script, but I couldn't find a solution yet. – her Feb 01 '13 at 12:09