在没有IDE的OSX上使用Scala进行持续的日常开发

时间:2017-04-28 13:11:14

标签: macos scala

如果我的某个源文件发生了变化,如何连续编译和运行我的scala代码?

1 个答案:

答案 0 :(得分:2)

使用sbt工具。

# install sbt with homebrew
brew install sbt

# - create a new scala project
# - name your project name when asked like: hello-world
sbt new sbt/scala-seed.g8

# go to the new project directory that you named
cd hello-world

# run sbt to open the sbt shell
sbt

# run your project in continuous running mode
~ run

# to continuously see the test outputs
# open up a new terminal tab, run sbt, and in sbt shell, type:
~ test

这将大大简化您的编辑 - 编译 - 运行周期。