diff options
Diffstat (limited to 'scalaplugin/src')
-rw-r--r-- | scalaplugin/src/main/scala/mill/scalaplugin/Dep.scala | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/scalaplugin/src/main/scala/mill/scalaplugin/Dep.scala b/scalaplugin/src/main/scala/mill/scalaplugin/Dep.scala index 9ccb9da7..e8cf0387 100644 --- a/scalaplugin/src/main/scala/mill/scalaplugin/Dep.scala +++ b/scalaplugin/src/main/scala/mill/scalaplugin/Dep.scala @@ -1,6 +1,6 @@ package mill.scalaplugin - - +import mill.util.JsonFormatters._ +import upickle.default.{macroRW, ReadWriter => RW} sealed trait Dep object Dep{ def apply(org: String, name: String, version: String): Dep = { @@ -8,6 +8,7 @@ object Dep{ } case class Java(dep: coursier.Dependency) extends Dep object Java{ + implicit def rw: RW[Java] = macroRW def apply(org: String, name: String, version: String): Dep = { Java(coursier.Dependency(coursier.Module(org, name), version)) } @@ -16,15 +17,19 @@ object Dep{ def apply(dep: coursier.Dependency) = Scala(dep) case class Scala(dep: coursier.Dependency) extends Dep object Scala{ + implicit def rw: RW[Scala] = macroRW def apply(org: String, name: String, version: String): Dep = { Scala(coursier.Dependency(coursier.Module(org, name), version)) } } case class Point(dep: coursier.Dependency) extends Dep object Point{ + implicit def rw: RW[Point] = macroRW def apply(org: String, name: String, version: String): Dep = { Point(coursier.Dependency(coursier.Module(org, name), version)) } } - implicit def formatter = upickle.default.macroRW[Dep] + implicit def rw = RW.merge[Dep]( + Java.rw, Scala.rw, Point.rw + ) }
\ No newline at end of file |