-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.sc
112 lines (84 loc) · 3.05 KB
/
build.sc
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import mill._
import mill.define.{Segment, Segments}
import mill.scalalib.publish.{Developer, License, PomSettings, VersionControl}
import scalalib._
val devInfo = Developer(
"kag0",
"Nathan Fischer",
"https://github.com/kag0",
Some("blackdoor"),
Some("https://github.com/blackdoor")
)
val `2.12` = "2.12.15"
val `2.13` = "2.13.7"
val `3` = "3.1.0"
trait BaseModule extends CrossScalaModule {
def scalacOptions = Seq("-Xfatal-warnings", "-feature", "-unchecked", "-deprecation")
def publishVersion: T[String] = T.input(T.ctx().env("PUBLISH_VERSION"))
def pomSettings: T[PomSettings] = PomSettings(
description = "Extensible JOSE library for Scala.",
organization = "black.door",
url = "https://github.com/blackdoor/jose",
licenses = List(License.Unlicense),
versionControl = VersionControl.github("blackdoor", "jose"),
developers = List(devInfo)
)
def artifactName =
Segments(millModuleSegments.value.filterNot(_.isInstanceOf[Segment.Cross]): _*).parts
.mkString("-")
trait Test extends Tests with TestModule.ScalaTest {
def scalacOptions = T(super.scalacOptions().filterNot(_ == "-Xfatal-warnings"))
def ivyDeps = Agg(
ivy"org.scalatest::scalatest:3.2.15",
ivy"com.nimbusds:nimbus-jose-jwt:9.30"
)
}
}
object jose extends Cross[JoseModule](`2.12`, `2.13`, `3`)
class JoseModule(val crossScalaVersion: String) extends BaseModule with PublishModule {
def ivyDeps = Agg(
ivy"org.typelevel::cats-core:2.7.0",
ivy"com.typesafe.scala-logging::scala-logging:3.9.5"
)
object test extends Test
}
object json extends Module {
abstract class JsonModule(moduleName: String) extends BaseModule {
def artifactName = "jose-" + super.artifactName()
def pomSettings =
super.pomSettings().copy(description = s"$moduleName JSON support for blackdoor jose")
object test extends Test {
def moduleDeps = super.moduleDeps :+ jose(crossScalaVersion).test
}
}
object circe extends Cross[CirceModule](`2.12`, `2.13`, `3`)
class CirceModule(val crossScalaVersion: String)
extends JsonModule("Circe")
with PublishModule {
def moduleDeps = List(jose(crossScalaVersion))
lazy val circeVersion = "0.14.3"
def ivyDeps = Agg(
ivy"io.circe::circe-core:$circeVersion",
ivy"io.circe::circe-generic:$circeVersion",
ivy"io.circe::circe-parser:$circeVersion"
)
}
object play extends Cross[PlayModule](`2.12`, `2.13`)
class PlayModule(val crossScalaVersion: String)
extends JsonModule("Play")
with PublishModule {
def ivyDeps = Agg(ivy"com.typesafe.play::play-json:2.9.4")
def moduleDeps = List(jose(crossScalaVersion))
}
object ninny extends Cross[NinnyModule](`2.12`, `2.13`)
class NinnyModule(val crossScalaVersion: String)
extends JsonModule("ninny")
with PublishModule {
def ivyDeps = Agg(ivy"io.github.kag0::ninny:0.4.3")
def moduleDeps = List(jose(crossScalaVersion))
}
}
object docs extends ScalaModule {
def scalaVersion = `2.13`
def moduleDeps = List(json.ninny(`2.13`))
}