Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

the equivalent of scalac -print from within sbt?

Tags:

scala

sbt

Is it possible to run the equivalent of scalac -print on one or more classes interactively within sbt (0.11.2)?

like image 559
jxstanford Avatar asked Mar 09 '12 00:03

jxstanford


1 Answers

-print is a standard option to scalac, so you can add it to your scalacOptions like usual. As an example, the following sbt session demonstrates temporarily adding it and recompiling:

$ sbt
> set scalacOptions in Compile += "-print"
> compile
...

However, this will recompile all sources (due to the options being different) and is not suitable for inspecting a small number of files out of a project of a decent size. I expect the REPL's power mode has a better solution, but it depends on your underlying problem.

like image 77
Mark Harrah Avatar answered Sep 27 '22 18:09

Mark Harrah