Question

Currently in playframework 1.2.4 there is a such thing like module and project, if a project depends on a module, user should put appropriate line in configuration, into dependecies.yml file.

Now, as I can see, reading exiting documentation, there is an idea if subprojects /<my_home>/play/documentation/manual/build/SBTSubProjects.md instead of modules??

Taking into consideration that now there is no 'dependecies.yml' file anymore, I would say that idea of suprojects is going to substitute the modules?

Then, what I do:

cd projects
play new newProject
mkdir modules
cd modules
play new project1
play new project2
play new common

vi /projects/newProject/project/Build.scala

editing it like this:

object ApplicationBuild extends Build {

  val appName = "newProject"
  val appVersion = "1.2"

  val common = PlayProject(
    appName + "-common", appVersion, path = file("modules/common")
  )

  val project1 = PlayProject(
    appName + "-project1", appVersion, path = file("modules/project1")
  ).dependsOn(common)

  val project2 = PlayProject(
    appName + "-project2", appVersion, path = file("modules/project2")
  ).dependsOn(common)

  val main = PlayProject(
    appName, appVersion
  ).dependsOn(
    project1, project2
  )
}

But, then ... if I try to run 'project1': cd /projects/newProject/module/project1

play run

It would know nothing about the dependency to 'common' project for 'project1' (i guess), because I did not modify project1/project/Build.scala ..

So, what I should do with that? How 'project1' would know about its dependencies in run-time?

Was it helpful?

Solution

I found only one solution for now: just make a link in newProject/modules/project1/modules/common to -> /newProject/modules/common

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top