SBT console - How to run stuff on initialization?
Asked Answered
I

1

10

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?

Indomitability answered 2/3, 2014 at 22:18 Comment(0)
I
8

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://mcmap.net/q/384573/-scala-sbt-console-code-changes-not-reflected-in-sbt-console

Indomitability answered 2/3, 2014 at 22:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.