2014-01-30 40 views
1

我看到了用於向SBT項目添加配置文件的代碼,但它在Scala 2.9.2中不適合我。值的值不是sbt.SettingKey在SBT 0.12下的成員?

val ProfileDev = config("dev") extend(Runtime) 
val ProfileQA = config("qa") extend(Runtime) 

val root = (project in file(".")). 
    configs(ProfileDev, ProfileQA). // add config here! 
    settings( 
    name := "helloworld", 
    .... 
). 
    settings(inConfig(ProfileDev)(Classpaths.configSettings ++ Defaults.configTasks ++ Defaults.resourceConfigPaths ++ Seq(
    unmanagedResourceDirectories += {baseDirectory.value/"src"/configuration.value.name/"resources"} 
)): _*). 
    settings(inConfig(ProfileQA)(Classpaths.configSettings ++ Defaults.configTasks ++ Defaults.resourceConfigPaths ++ Seq(
    unmanagedResourceDirectories += {baseDirectory.value/"src"/configuration.value.name/"resources"} 
)): _*) 

這是錯誤我面對

Compiling 1 Scala source to /home/robin/workspace/active_projects/Republiq/server/project/target/scala-2.9.2/sbt-0.12/classes... 
[error] /home/robin/workspace/active_projects/Republiq/server/project/Build.scala:121: value value is not a member of sbt.SettingKey[java.io.File] 
[error]  unmanagedResourceDirectories += {baseDirectory.value/"src"/configuration.value.name/"resources"} 
[error]             ^
[error] one error found 
[error] (compile:compile) Compilation failed 

回答

5

我猜(從編譯路徑Republiq/server/project/target/scala-2.9.2/sbt-0.12/classes)您使用SBT 0.12

這只是因爲當被介紹爲宏value支持0.13 - 見New task/setting syntax0.13.0變化文件。

升級到SBT 0.13或用value重寫部分。

相關問題