如何在sbt子项目build.sbt文件中获取对当前项目的引用

时间:2017-03-06 09:32:09

标签: plugins playframework sbt

我有一个playframework子项目。目前,我将其定义为父build.sbt

中的playframework模块
lazy val silhouetteModule = (project in file("modules/silhouette"))
    .enablePlugins(PlayScala)

我希望将这些知识委托给子项目build.sbt。如何调用子项目这个enablePlugins?

import play.PlayScala

scalaVersion := "2.11.1"

name := "play-silhouette-seed"

version := "1.0"

libraryDependencies ++= Seq(
  "com.mohiva" %% "play-silhouette" % "1.0",
  "org.webjars" %% "webjars-play" % "2.3.0",
  "org.webjars" % "bootstrap" % "3.1.1",
  "org.webjars" % "jquery" % "1.11.0",
  "net.codingwell" %% "scala-guice" % "4.0.0-beta4",
  cache
)

//this doesn't work
currentThisProject.enablePlugins(PlayScala)

1 个答案:

答案 0 :(得分:1)

您可以直接在子项目的enablePlugins文件中致电build.sbt

enablePlugins(PlayScala)