diff options
author | Jean Helou <jhe@codamens.fr> | 2019-02-25 17:00:16 +0100 |
---|---|---|
committer | Tobias Roeser <le.petit.fou@web.de> | 2019-03-11 07:41:03 +0100 |
commit | 2cac5a37351f4ec13c5b29d8bd292a7153762e87 (patch) | |
tree | 9650708f75f91119d4092de63e3343d1f02d6cb4 /contrib/playlib/src | |
parent | dca05d702bb53b562570f70c30d7767e81c29a76 (diff) | |
download | mill-2cac5a37351f4ec13c5b29d8bd292a7153762e87.tar.gz mill-2cac5a37351f4ec13c5b29d8bd292a7153762e87.tar.bz2 mill-2cac5a37351f4ec13c5b29d8bd292a7153762e87.zip |
Provides additionnal dependency keys for easier configuration
Diffstat (limited to 'contrib/playlib/src')
-rw-r--r-- | contrib/playlib/src/mill/playlib/Dependencies.scala | 19 | ||||
-rw-r--r-- | contrib/playlib/src/mill/playlib/Server.scala | 14 | ||||
-rw-r--r-- | contrib/playlib/src/mill/playlib/Version.scala | 7 |
3 files changed, 29 insertions, 11 deletions
diff --git a/contrib/playlib/src/mill/playlib/Dependencies.scala b/contrib/playlib/src/mill/playlib/Dependencies.scala index 2583ffbf..65a5f455 100644 --- a/contrib/playlib/src/mill/playlib/Dependencies.scala +++ b/contrib/playlib/src/mill/playlib/Dependencies.scala @@ -2,14 +2,23 @@ package mill package playlib import mill.scalalib._ -import mill.scalalib.api._ private [playlib] trait Dependencies extends ScalaModule with Version{ + def core = T { component("play") } + def guice = T { component("play-guice") } + def server = T { component("play-server") } + def logback = T { component("play-logback") } + def evolutions = T { component("play-jdbc-evolutions") } + def jdbc = T { component("play-jdbc") } + def filters = T { component("filters-helpers") } + def ws = T { component("play-ahc-ws") } + def caffeine = T { component("play-caffeine-cache") } + override def ivyDeps = T{ super.ivyDeps() ++ Agg( - ivy"com.typesafe.play::play:${playVersion()}", - ivy"com.typesafe.play::play-guice:${playVersion()}", - ivy"com.typesafe.play::play-server:${playVersion()}", - ivy"com.typesafe.play::play-logback:${playVersion()}" + core(), + guice(), + server(), + logback() )} } diff --git a/contrib/playlib/src/mill/playlib/Server.scala b/contrib/playlib/src/mill/playlib/Server.scala index f41c41d7..0b7b086a 100644 --- a/contrib/playlib/src/mill/playlib/Server.scala +++ b/contrib/playlib/src/mill/playlib/Server.scala @@ -4,17 +4,19 @@ package playlib import mill.scalalib._ private[playlib] trait Server extends ScalaModule with Version { - def playServerProvider = T { - ivy"com.typesafe.play::play-akka-http-server:${playVersion()}" - } + + def nettyServer = T { component("play-netty-server") } + + def akkaHttpServer = T { component("play-akka-http-server") } + + def playServerProvider = T { akkaHttpServer() } + override def runIvyDeps = T { super.runIvyDeps() ++ Agg(playServerProvider()) } - override def mainClass = T { - Some("play.core.server.ProdServerStart") - } + override def mainClass = T { Some("play.core.server.ProdServerStart") } } diff --git a/contrib/playlib/src/mill/playlib/Version.scala b/contrib/playlib/src/mill/playlib/Version.scala index 77e57886..ae441a8a 100644 --- a/contrib/playlib/src/mill/playlib/Version.scala +++ b/contrib/playlib/src/mill/playlib/Version.scala @@ -1,6 +1,9 @@ package mill package playlib +import mill.define.{Target, Task} +import mill.scalalib._ + private[playlib] trait Version extends Module{ def playVersion: T[String] @@ -8,4 +11,8 @@ private[playlib] trait Version extends Module{ private[playlib] def playMinorVersion: T[String] = T { playVersion().split("\\.").take(2).mkString("", ".", ".0") } + + private[playlib] def component(id: String): Task[Dep] = T.task { + ivy"com.typesafe.play::$id::${playVersion()}" + } } |