简体   繁体   中英

How can I get a reference to current project in a sbt subproject build.sbt file

I have a playframework subproject. Currently i'm defining it as a playframework module in the parent build.sbt

lazy val silhouetteModule = (project in file("modules/silhouette"))
    .enablePlugins(PlayScala)

I would preffer to delegate that knowledge to the child project build.sbt . How can I call in the child project this 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)

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

enablePlugins(PlayScala)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM