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
|
#!/usr/bin/env amm
import $cp.scalaplugin.target.`scala-2.12`.`mill-scalaplugin-assembly-0.1-SNAPSHOT.jar`
import ammonite.ops.pwd
import mill._
import mill.scalaplugin.{Subproject, Dep, TestRunner}
@main def main(args: String*) = mill.Main(args, Build, interp.watch)
object Build{
trait MillSubproject extends Subproject{
def scalaVersion = "2.12.4"
}
object Core extends MillSubproject {
override def compileIvyDeps = Seq(
Dep.Java("org.scala-lang", "scala-reflect", scalaVersion())
)
override def ivyDeps = Seq(
Dep("com.lihaoyi", "sourcecode", "0.1.4"),
Dep("com.lihaoyi", "pprint", "0.5.3"),
Dep.Point("com.lihaoyi", "ammonite", "1.0.3"),
Dep("com.typesafe.play", "play-json", "2.6.6"),
Dep("org.scala-sbt", "zinc", "1.0.3"),
Dep.Java("org.scala-sbt", "test-interface", "1.0")
)
def basePath = pwd / 'core
override def sources = pwd/'core/'src/'main/'scala
}
object CoreTests extends MillSubproject {
override def projectDeps = Seq(Core)
def basePath = pwd / 'scalaplugin
override def sources = pwd/'core/'src/'test/'scala
override def ivyDeps = Seq(
Dep("com.lihaoyi", "utest", "0.6.0")
)
def test() = T.command{
TestRunner.apply(
"mill.UTestFramework",
runDepClasspath().map(_.path) :+ compiled().path,
Seq(compiled().path)
)
}
}
object ScalaPlugin extends MillSubproject {
override def projectDeps = Seq(Core)
def basePath = pwd / 'scalaplugin
override def sources = pwd/'scalaplugin/'src/'main/'scala
}
}
|