2

I'm trying to use classes from a dependant project in my views, but it seems the scala compiler isn't able to pick it up. The project is a sibling of the play project:

workspace/lib
workspace/play-project

But I get an error when compiling the project:

@import lib.TheClass

Error:
[error] scala-2.9.1/src_managed/main/views/html/index.template.scala:28: not found: value lib
[error]         _display_ {import lib.TheClass

How can I set up a project dependency for the scale compiler?

I found the following related SO questions, but they seem to talk about projects stored in central repositories:

4

1 回答 1

1

你必须在你的 sbt 配置中声明对 lib 项目的依赖。sbt wiki 中有一个指南。首先你声明你的 lib 项目。

lazy val lib = Project(id = "lib",
                       base="../lib/")

然后定义主项目,让它依赖于 lib 项目。

lazy val play = Project(id = "play-app",
                        base = file(".")) dependsOn(lib)
于 2012-10-10T09:17:28.493 回答