-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.mill
46 lines (36 loc) · 1.1 KB
/
build.mill
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
package build
import mill._, scalalib._, scalafmt._
import $packages._
import $file.{versions => v}
def isBookChapter(p: os.Path) = os.isDir(p) && "ch\\d{2}".r.matches(p.baseName)
def moduleNames = interp.watchValue(
os.walk(millSourcePath, !isBookChapter(_), maxDepth = 1)
.map(_.last)
)
object modules extends Cross[CatsModule](moduleNames)
trait CatsModule extends ScalaModule with Cross.Module[String] with ScalafmtModule {
val scalaVersion = v.scalaVersion
// Ends with 'modules' that need to be removed
def millSourcePath = super.millSourcePath / os.up / crossValue
def scalacOptions: T[Seq[String]] = Seq(
"-encoding", "UTF-8",
"-feature",
"-Werror",
"-explain",
"-deprecation",
"-unchecked",
"-Wunused:all",
"-rewrite",
"-indent",
"-source", "future",
)
def ivyDeps = Agg(
ivy"org.typelevel::cats-core:${v.catsVersion}"
)
object test extends ScalaTests with TestModule.ScalaTest {
def ivyDeps = Agg(
ivy"org.scalatest::scalatest:${v.scalatestVersion}",
ivy"org.scalatestplus::scalacheck-1-18:${v.scalacheckVersion}"
)
}
}