如何克服“有1个功能警告;重新运行-features详细信息”

时间:2013-05-14 17:41:49

标签: sbt playframework-2.1 scala-ide

我是Scala,Scala-IDE和Play 2.1的新手,正在研究教程。今天我注意到“todolist”教程发出的Eclipse Project在Scala-IDE中出现了一个我不理解的警告,并希望看到它消失。

这个答案How to get more information about 'feature' flag warning?表明我只需要添加...

scalacOptions ++= Seq(... "-feature")

...到我的sbt构建定义文件,我认为是Play 2.1项目的project / Build.scala。试着把它放在那里,但是......

import sbt._
import Keys._
import play.Project._

object ApplicationBuild extends Build {

  val appName         = "todolist"
  val appVersion      = "1.0-SNAPSHOT"

  val appDependencies = Seq(
    // Add your project dependencies here,
    jdbc,
    anorm
  )

  val main = play.Project(appName, appVersion, appDependencies).settings(
    // Add your own project settings here
    scalacOptions ++= Seq(... "-feature")
  )

}

...,导致编译错误......

[info] Loading project definition from /Users/bobk/work/todolist/project
[error] /Users/bobk/work/todolist/project/Build.scala:18: illegal start of simple expression
[error]     scalacOptions ++= Seq(... "-feature")
[error]                           ^
[error] /Users/bobk/work/todolist/project/Build.scala:21: ')' expected but '}' found.
[error] }
[error] ^
[error] two errors found
[error] (compile:compile) Compilation failed
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? 

如果我想在Play 2.1中的sbt构建定义中设置scalacOptions,我在哪里指定它以及如何指定?

1 个答案:

答案 0 :(得分:4)

没有“......”就试试吧。这些点代表了另一个答案的遗漏。

相关问题