如何启动 sbt 控制台并自动评估一些表达式? [英] How to start sbt console and automatically evaluate some expressions?

查看:31
本文介绍了如何启动 sbt 控制台并自动评估一些表达式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用 sbt console 时,我发现自己反复输入一些导入语句.如果有办法告诉 sbt 始终运行命令,那就太好了.有办法吗?

When using sbt console I find myself repeatedly entering some import statements. It would be great if there was a way to tell sbt to always run commands. Is there a way?

目前我有一个有点粗糙的解决方案:

At the moment I have a kinda crufty solution:

( echo "import my.app._
import my.app.is.sooo.cool._" && cat ) | sbt console

Googleability 字词:

Googleability words:

初始命令、第一个命令、初始表达式、构建文件、初始语句、启动表达式、启动命令、启动语句.

Initial commands, first commands, initial expressions, build file, initial statements, startup expressions, startup commands, startup statements.

推荐答案

您可以使用 initialCommands:

initialCommands in console := """import my.app._
import my.app.is.sooo.cool._"""

这篇关于如何启动 sbt 控制台并自动评估一些表达式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆