summaryrefslogtreecommitdiff
path: root/integration/test/resources/jawn/build.sc
blob: ac9de19584ba9e9577b5c70980b3bfa3f486fd21 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import mill.scalalib
import mill.Cross
import mill.scalalib.{Dep, TestModule, DepSyntax, Lib}
import ammonite.ops.up
object jawn extends Cross[JawnModule]("2.10.6", "2.11.11", "2.12.3")
class JawnModule(crossVersion: String) extends mill.Module{
  override def basePath = super.basePath / up / up

  trait JawnModule extends scalalib.SbtModule{
    def scalaVersion = crossVersion
    def scalacOptions = Seq(
      "-deprecation",
      "-optimize",
      "-unchecked"
    )
    def testModuleDeps: Seq[TestModule] = Nil
    object test extends Tests{
      def moduleDeps = super.moduleDeps ++ testModuleDeps
      def ivyDeps = Agg(
        ivy"org.scalatest::scalatest:3.0.3",
        ivy"org.scalacheck::scalacheck:1.13.5"
      )
      def testFramework = "org.scalatest.tools.Framework"
    }
  }
  object parser extends JawnModule

  object util extends JawnModule{
    def moduleDeps = Seq(parser)
    def testModuleDeps = Seq(parser.test)
  }
  object ast extends JawnModule{
    def moduleDeps = Seq(parser, util)
    def testModuleDeps = Seq(parser.test, util.test)
  }
  class Support(ivyDeps0: Dep*)(implicit ctx: mill.define.Ctx) extends JawnModule{
    def moduleDeps = Seq(parser)
    def ivyDeps = Agg.from(ivyDeps0)
  }
  object support extends mill.Module{
    object argonaut extends Support(ivy"io.argonaut::argonaut:6.2")
    object json4s extends Support(ivy"org.json4s::json4s-ast:3.5.2")

    object play extends Support(){
      def ivyDeps = mill.T{
        Lib.scalaBinaryVersion(scalaVersion()) match{
          case "2.10" => Agg(ivy"com.typesafe.play::play-json:2.4.11")
          case "2.11" => Agg(ivy"com.typesafe.play::play-json:2.5.15")
          case _ => Agg(ivy"com.typesafe.play::play-json:2.6.0")
        }
      }
    }

    object rojoma extends Support(ivy"com.rojoma::rojoma-json:2.4.3")
    object rojomaV3 extends Support(ivy"com.rojoma::rojoma-json-v3:3.7.2"){
      override def basePath = super.basePath / up / "rojoma-v3"
    }
    object spray extends Support(ivy"io.spray::spray-json:1.3.3")
  }
}