【问题标题】:Where is the documentation for Play sbt-plugin (Build.scala)?Play sbt-plugin (Build.scala) 的文档在哪里?
【发布时间】:2013-05-13 14:57:29
【问题描述】:

我目前正在使用 Play 版本 2.1.1,并尝试修改 Build.scala。

默认情况下,它会导入一个名为 play.Project._ 的包

我一直在尝试找出这个包的 API,以便我可以自定义我们的 Build.scala 文件。

我唯一拥有的是这个链接: http://www.playframework.com/documentation/2.1.1/Build

我也尝试从这里找到它: http://www.playframework.com/documentation/api/2.1.1/scala/index.html#package

谁能告诉我这个 API 的位置?

【问题讨论】:

    标签: scala build playframework sbt


    【解决方案1】:

    Build.scala 使用PlayProject,如Play SBT documentation 中所述。这个PlayProject本质上是一个sbt.Project,所以你应该仔细看看corresponding sbt APIPlayProject 本身定义为 here(第 147 行):

    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 在同一个文件中定义。

    【讨论】:

    • 谢谢@fynn!不过我还有一个问题:默认的 Build.scala 有这个导入语句:import play.Project._。当我们使用它时,我们可以说play.Project(appName, appVersion, appDependencies, path = file("modules/test")),我只是想知道在哪里定义了API如何调用play.Project?具体来说,可以传递给 play.Project 构造函数的参数?还有 play.Project 和 PlayProject 有什么区别?
    猜你喜欢
    • 2015-08-14
    • 2014-11-07
    • 2014-01-12
    • 2021-01-31
    • 1970-01-01
    • 2021-10-04
    • 2014-09-24
    • 2019-03-07
    • 1970-01-01
    相关资源
    最近更新 更多