I am completely new to Java/Scala/Play/Eclipse. My experience so far is mostly with C# and Visual Studio.
I am wondering how to go about adding a dependency from a Scala project, in Eclipse, to my Play project, also in Eclipse. In Visual Studio, this was a matter of creating a class library project, and adding it as a reference to another project. The IDE managed the build process.
I've tried adding a new Project in my Build.scala file:
import sbt._
import Keys._
import play.Project._
object ApplicationBuild extends Build {
val appName = "blogUI"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
// Add your project dependencies here,
jdbc,
anorm
)
// The new project; everything else was boilerplate
val blogPlatform = Project("blogPlatform", file("blogPlatform")).settings(
scalaVersion := "2.10.2"
)
val main = play.Project(appName, appVersion, appDependencies).settings(
// Add your own project settings here
)
}
This doesn't work - it ends up creating an empty blogPlatform directory inside my blogUI Play project, instead of referring to my existing blogPlatform project. I'm also not familiar with sbt, so I could be totally misusing the tool.
I also tried adding the blogPlatform project as a dependency through Eclipse, which works - until I run "play eclipse" from a terminal. This wipes out any changes I had made in the IDE.
Ideally I would like a way to add the blogPlatform as a dependency to the blogUI project, such that it is respected by Eclipse and Play, and such that blogPlatform is rebuilt when blogUI is rebuilt. So, just adding a precompiled jar file to a lib directory in the Play project is not sufficient (another method which I came across but which I haven't tried).
Any suggestions or pointers towards tools or resources would be greatly appreciated!