I am using sbt console to debug some web application, written with Lift Framework.
Every time running it, I run some commands to initialize framework.
import bootstrap.liftweb.Boot
(new Boot).boot
import ...some frequently used models from my app...
I want sbt to do this boilerplate every time I start it.
How to do this?
object Reload extends CancelWatch with Product with Serializable. Action that indicates that the watch should pause while the build is reloaded. This is used to automatically reload the project when the build files (e.g. build. sbt) are changed.
Press Ctrl+Alt+S to open the IDE settings and select Build, Execution, Deployment | Build Tools | sbt. In the sbt projects section, select a project for which you want to configure build actions. In the sbt shell section, select the builds option. Click OK to save the changes.
The simple way to do that, is put "initialCommands" rule in build.sbt.
This example:
initialCommands in console := """println("Hello from console")"""
will print in console, after initialization
Hello from console
Provided by https://stackoverflow.com/a/12703977/225767
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With