使用Build.scala
如Play SBT 文档PlayProject
中所述。这本质上是一个sbt.Project,因此您应该仔细查看相应的 sbt API。它本身在这里定义(第 147 行):PlayProject
PlayProject
lazy val PlayProject = PlayRuntimeProject("Play", "play")
.settings(
libraryDependencies := runtime,
sourceGenerators in Compile <+= sourceManaged in Compile map PlayVersion,
mappings in(Compile, packageSrc) <++= scalaTemplateSourceMappings,
parallelExecution in Test := false,
sourceGenerators in Compile <+= (dependencyClasspath in TemplatesCompilerProject in Runtime, packageBin in TemplatesCompilerProject in Compile, scalaSource in Compile, sourceManaged in Compile, streams) map ScalaTemplates
).dependsOn(SbtLinkProject, PlayExceptionsProject, TemplatesProject, IterateesProject, JsonProject)
在PlayRuntimeProject
同一个文件中定义。