Re: [sbt] "-deprecation" on sbt itself

320 views
Skip to first unread message

Ken Scambler

unread,
Feb 1, 2013, 5:30:44 PM2/1/13
to simple-b...@googlegroups.com
> reload plugins
> set scalacOptions ++= Seq( "-unchecked", "-deprecation" )
> session save
> reload return

On 2 February 2013 02:20, <pom...@gmail.com> wrote:
Hello sbt-list,

I made up a skeleton sbt-project and as I know about " scalacOptions ++= Seq( "-unchecked", "-deprecation" )" this is part of my build.sbt in this skeleton. For any sources I write this works fine and I get the information I'm expecting.

The skeleton doesn't consist any source files, but only:
- .gitignore
- some static native libs I regularily use
- vim-stuff
- some text files
- an individual folder structure under src/[main/test]/scala
- sbt configuration files (primarily for my preferred plugins)

For a while I see the following behavior:

When I copy the skeleton to begin a new project and I then first time execute "sbt" in the new folder, I receive 2 deprecation warnings as follows:

...
[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
...

When I execute sbt another time in this folder the warnings don't occure again. As mentioned there aren't any source files in the folder except the sbt configuration files.

I'm not so much interested in these specific warnings, as I'd like to be able to see the deprecation messages themselves and update everything myself. So, as I assume that this has something to do with compilation of sbt's configuration file, I'd like to ask, if there is any way to start sbt itself with the -deprecation option?

I hope I was able to make myself understood.

thx

--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simple-build-t...@googlegroups.com.
To post to this group, send email to simple-b...@googlegroups.com.
Visit this group at http://groups.google.com/group/simple-build-tool?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Josh Suereth

unread,
Feb 1, 2013, 5:49:31 PM2/1/13
to simple-b...@googlegroups.com

You can also put the setting in project/plugins.sbt

But kudos for staying in the console!   Glad in not the only one who prefers it over the shell now...

Grzegorz Kossakowski

unread,
Feb 1, 2013, 7:29:40 PM2/1/13
to simple-b...@googlegroups.com
On 1 February 2013 14:49, Josh Suereth <joshua....@gmail.com> wrote:

You can also put the setting in project/plugins.sbt

But kudos for staying in the console!   Glad in not the only one who prefers it over the shell now...

Guys,

Is it only me who finds this solution to be very surprising and counterintuitive?

The person asks for compiler options of project definition and here we are talking about plugins.

--
Grzegorz Kossakowski
Scalac hacker at Typesafe
twitter: @gkossakowski

Josh Suereth

unread,
Feb 1, 2013, 7:40:53 PM2/1/13
to simple-b...@googlegroups.com

You could also put it in project/definition.sbt if that's less confusing.

We call the file plugins.sbt by convention.   Technically any sbt file in the project directory defines settings for the project definition (where the deprecated warnings were being thrown).

If your build itself is written in scala, its not above having warning :-)

Ken Scambler

unread,
Feb 1, 2013, 9:48:49 PM2/1/13
to simple-build-tool

I think using the console is way easier than fiddling with files, file systems, and arbitrary conventions.

Once everything is consistently camel case and we get project definitions and project dependencies exposed that way, it will be a slam dunk.

pom...@gmail.com

unread,
Feb 2, 2013, 7:20:37 AM2/2/13
to simple-b...@googlegroups.com
Thx @all,

In principle, I also prefer the version over the console, but for convenience I placed the statement also in the project/plugins.sbt.

You really helped me out with this.

Michael Slinn

unread,
Feb 21, 2014, 4:42:23 PM2/21/14
to simple-b...@googlegroups.com
$ cat project/definitions.sbt 
reload plugins 

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

session save

reload return

$ sbt console
Loading /usr/share/sbt/bin/sbt-launch-lib.bash
[info] Loading global plugins from /home/mslinn/.sbt/0.13/plugins
/home/mslinn/blah/project/definitions.sbt:1: error: not found: value reload
reload plugins 
^
[error] Type error in expression
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? 

nafg

unread,
Mar 7, 2014, 7:21:56 AM3/7/14
to simple-b...@googlegroups.com
Why do you have session save and reload return in your .sbt file? Those are sbt shell commands. The .sbt file should consist of settings.

Michael Slinn

unread,
Mar 7, 2014, 7:50:07 AM3/7/14
to simple-b...@googlegroups.com
 I posted that 2 weeks ago, I don't remember.where I found that code online. Spent too much time on the problem without solving it and moved on.
Reply all
Reply to author
Forward
0 new messages