-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.mill
141 lines (108 loc) · 3.49 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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
package build
import $ivy.`com.lihaoyi::mill-contrib-sonatypecentral:`
import $ivy.`ba.sake::mill-hepek::0.1.0`
import mill._
import mill.scalalib._, scalafmt._, publish._
import mill.contrib.sonatypecentral.SonatypeCentralPublishModule
import ba.sake.millhepek.MillHepekModule
val sharafVersion = "0.8.1"
object sharaf extends SharafPublishModule {
def artifactName = "sharaf"
def ivyDeps = Agg(
ivy"io.undertow:undertow-core:2.3.18.Final",
ivy"com.lihaoyi::requests:0.9.0",
ivy"ba.sake::tupson:0.12.2",
ivy"ba.sake::tupson-config:0.12.2",
ivy"ba.sake::hepek-components:0.29.1"
)
def moduleDeps = Seq(querson, formson)
object test extends ScalaTests with SharafTestModule
}
object querson extends SharafPublishModule {
def artifactName = "querson"
def moduleDeps = Seq(validson)
def pomSettings = super.pomSettings().copy(description = "Simple query params library")
def ivyDeps = Agg(
ivy"com.lihaoyi::fastparse:3.0.1"
)
object test extends ScalaTests with SharafTestModule
}
object formson extends SharafPublishModule {
def artifactName = "formson"
def moduleDeps = Seq(validson)
def pomSettings = super.pomSettings().copy(description = "Simple form binding library")
object test extends ScalaTests with SharafTestModule
def ivyDeps = Agg(
ivy"com.lihaoyi::fastparse:3.0.1"
)
}
object validson extends SharafPublishModule {
def artifactName = "validson"
def ivyDeps = Agg(
ivy"com.lihaoyi::sourcecode::0.3.0"
)
def pomSettings = super.pomSettings().copy(description = "Simple validation library")
object test extends ScalaTests with SharafTestModule
}
trait SharafPublishModule extends SharafCommonModule with SonatypeCentralPublishModule {
def publishVersion = sharafVersion
def pomSettings = PomSettings(
organization = "ba.sake",
url = "https://github.com/sake92/sharaf",
licenses = Seq(License.Common.Apache2),
versionControl = VersionControl.github("sake92", "sharaf"),
description = "Sharaf http library",
developers = Seq(
Developer("sake92", "Sakib Hadžiavdić", "https://sake.ba")
)
)
}
trait SharafCommonModule extends ScalaModule with ScalafmtModule {
def scalaVersion = "3.4.2"
def scalacOptions = super.scalacOptions() ++ Seq(
"-Yretain-trees", // needed for default parameters
"-deprecation",
"-Wunused:all",
"-explain"
)
}
trait SharafTestModule extends TestModule.Munit {
def ivyDeps = Agg(
ivy"org.scalameta::munit::1.0.2"
)
}
//////////////////// examples
trait SharafExampleModule extends SharafCommonModule {
def ivyDeps = Agg(
ivy"ch.qos.logback:logback-classic:1.4.6"
)
}
object examples extends mill.Module {
object api extends SharafExampleModule {
def moduleDeps = Seq(sharaf)
object test extends ScalaTests with SharafTestModule
}
object fullstack extends SharafExampleModule {
def moduleDeps = Seq(sharaf)
object test extends ScalaTests with SharafTestModule
}
object oauth2 extends SharafExampleModule {
def moduleDeps = Seq(sharaf)
def ivyDeps = super.ivyDeps() ++ Agg(
ivy"org.pac4j:undertow-pac4j:5.0.1",
ivy"org.pac4j:pac4j-oauth:5.7.0"
)
object test extends ScalaTests with SharafTestModule {
def ivyDeps = super.ivyDeps() ++ Agg(
ivy"no.nav.security:mock-oauth2-server:0.5.10"
)
}
}
}
//////////////////// docs
object docs extends MillHepekModule with SharafCommonModule {
def ivyDeps = Agg(
ivy"ba.sake::hepek:0.25.0",
ivy"com.lihaoyi::os-lib:0.9.3"
)
}