Due to the complexity of our multi-project build, our team has ditched build.sbt in favor of Build.scala. I can't seem to get the PlayScala plugin to take effect on the root level project and I'm hoping someone here can shed some light on the issue.
project/plugins.sbt
// Comment to get more information during initialization
logLevel := Level.Warn
// The Typesafe repository
project/Build.scala
import sbt._
import Keys._
import play.Play
import play.PlayScala.autoImport._
import PlayKeys._
object BuildSettings {
val buildOrg = "com.playi"
val buildVersion = "0.1-SNAPSHOT"
val buildScalaVersion = "2.10.3"
// Basic settings for the project that are shared between
// the submodules
val buildSettings = Defaults.defaultSettings ++ Seq(
organization := buildOrg,
version := buildVersion,
scalaVersion := buildScalaVersion,
shellPrompt := ShellPrompt.buildShellPrompt
)
}
...
...
object MyBuild extends Build {
import BuildSettings._
// Define the api module as a project
lazy val api = Project(
"api",
file("api"),
settings = buildSettings ++ Seq(libraryDependencies ++= apiDeps)
)
// Define the service module as a project which depends on
// the api module
lazy val service = {
val mainSettings = Seq(
resolvers := publicResolvers ++ ... //omitted
libraryDependencies ++= serviceDeps
)
val pkgSettings = packagerSettings ++ packageArchetype.java_server ++ deploymentSettings ++ Seq(
publish <<= publish.dependsOn(publish in Universal),
publishLocal <<= publishLocal.dependsOn(publishLocal in Universal),
// only include tgz artifacts
packagedArtifacts in Universal ~= {
_.filter {
case (artifact, file) =>
System.out.println(artifact.`type`)
artifact.`type`.contains("tgz")
}
}
)
Project (
id = "service",
base = file("."),
aggregate = Seq(api),
dependencies = Seq(api)
)
.addPlugins( play.PlayScala )
.settings( (mainSettings ++ Play.defaultSettings ++ pkgSettings ++ buildSettings ):_* )
}
}
Notice that I have to include Play.defaultSettings in my project settings even though I've added addPlugins(play.PlayScala). Without that, the source directories for the project are incorrect. Even with these two added, I still seem to be missing anything related to the sbt-native-packager which, as I understand it, should be included by default in play projects.
All the Play! specific code in the Build.scala file was arrived at by following the instructions in the migration guid
here.
My question, what am I missing in my configuration that is preventing some of the play tasks, settings and configuration from being pulled in?