我正在做我的第一个游戏应用程序。我使用Typesafe激活器生成一个空Play (只使用Scala)项目。布局与我使用giter8生成scala项目时生成的布局略有不同。有一个build.sbt,它在Project文件夹中定义了顶级构建定义。
通常有一个名为scalaVersion的标记,在这里我可以为项目指定我想要的scalaVersion,但是在自动生成的从激活器中生成的build.sbt中没有这样的标记。当然,没什么大不了的,我可以自己加进去。我的问题是,当没有指定任何内容时,默认的scalaVersion是什么?
编辑:实际上,在scalaVersion文件中指定build.sbt并没有覆盖项目的Scala版本。我指定了2.10.3,但我得到了2.10.2。关于如何覆盖该设置以及默认设置来自何处的任何线索?
发布于 2014-01-31 07:10:52
这应该能行。我只是用hello-scala模板尝试了一下:
jamesw@T430s:~/Desktop$ activator new
Enter an application name
> scala-bump
Fetching the latest list of templates...
The new application will be created in /home/jamesw/Desktop/scala-bump
Browse the list of templates: http://typesafe.com/activator/templates
Enter a template name, or hit tab to see a list
> hello-scala我编辑了build.sbt并更新了scalaVersion
scalaVersion := "2.10.3"在src/main/scala/Hello.scala中输出Scala版本的测试
object Hello {
def main(args: Array[String]): Unit = {
println(scala.util.Properties.versionString)
}
}然后通过activator run运行这个应用程序:
[info] Compiling 1 Scala source to /home/jamesw/Desktop/scala-bump/target/scala-2.10/classes...
[info] Running Hello
version 2.10.3
[success] Total time: 3 s, completed Jan 31, 2014 12:06:18 AMhttps://stackoverflow.com/questions/21461534
复制相似问题