Scala REPL导入SBT文件

Scala REPL导入SBT文件,scala,sbt,read-eval-print-loop,Scala,Sbt,Read Eval Print Loop,我有一个SBT文件,其中包含以下内容: name := "Scala Playground" version := "1.0" scalaVersion := "2.11.6" resolvers += "Typesafe Repo" at "http://repo.typesafe.com/typesafe/releases/" libraryDependencies ++= Seq( "com.netflix.rxjava" %% "rxjava-scala" % "0.19.1

我有一个SBT文件,其中包含以下内容:

name := "Scala Playground"

version := "1.0"

scalaVersion := "2.11.6"

resolvers += "Typesafe Repo" at "http://repo.typesafe.com/typesafe/releases/"

libraryDependencies ++= Seq(
  "com.netflix.rxjava" %% "rxjava-scala" % "0.19.1",
  "com.typesafe.play"  %% "play-json"    % "2.2.1"
)
另存为scala-playery.sbt。我想在Scala REPL中使用它。当我尝试执行以下操作时:

sbt scala-playground.sbt
我得到了以下错误:

[info] Set current project to Scala Playground (in build file:/home/joe/Desktop/)
[error] Not a valid command: scala-playground
[error] Not a valid project ID: scala-playground
[error] Expected ':' (if selecting a configuration)
[error] Not a valid key: scala-playground (similar: scala-version, scalac-options, scala-binary-version)
[error] scala-playground
[error]                 ^
在我的sbt文件中我看不到任何愚蠢的东西。有人能解释一下吗?这是在Scala REPL中获取依赖项的正确方法吗


我所要做的就是在Scala REPL中加入一些依赖项,以便快速运行和评估某些库。

命令行参数是
sbt
命令,而不是您想要使用的文件。只需使用
scala playerd.sbt
文件转到目录,然后从那里运行:

sbt console
sbt
应自动从当前目录加载
scala playerd.sbt
文件并打开scala控制台