-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.mill
91 lines (77 loc) · 2.58 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
package build
import $ivy.`com.lihaoyi::mill-contrib-sonatypecentral:`
import $ivy.`ba.sake::mill-hepek::0.0.2`
import mill._, scalalib._, scalajslib._, scalanativelib._, publish._, scalafmt._
import mill.contrib.sonatypecentral.SonatypeCentralPublishModule
import ba.sake.millhepek.MillHepekModule
val tupsonVersion = "0.13.1-SNAPSHOT"
object tupson extends Module {
object jvm extends TupsonCommonModule {
object test extends ScalaTests with CommonTestModule
}
object js extends TupsonCommonModule with ScalaJSModule {
def scalaJSVersion = "1.17.0"
def ivyDeps = super.ivyDeps() ++ Agg(
ivy"io.github.cquiroz::scala-java-time::2.6.0"
)
object test extends ScalaJSTests with CommonTestModule
}
object native extends TupsonCommonModule with ScalaNativeModule {
def scalaNativeVersion = "0.5.4"
def ivyDeps = super.ivyDeps() ++ Agg(
ivy"io.github.cquiroz::scala-java-time::2.6.0"
)
object test extends ScalaNativeTests with CommonTestModule
}
trait TupsonCommonModule extends CommonScalaModule with CommonPublishModule with PlatformScalaModule {
def artifactName = "tupson"
def ivyDeps = Agg(
ivy"org.typelevel::jawn-ast::1.6.0"
)
}
}
// jvm-only
object `tupson-config` extends CommonScalaModule with CommonPublishModule {
def moduleDeps = Seq(tupson.jvm)
def ivyDeps = super.ivyDeps() ++ Agg(
ivy"com.typesafe:config:1.4.3"
)
object test extends ScalaTests with CommonTestModule {
def forkArgs = Seq("-Dconfig.override_with_env_vars=true")
def forkEnv = Map("CONFIG_FORCE_envvar_port" -> "1234")
}
}
object examples extends CommonScalaModule {
def moduleDeps = Seq(tupson.jvm)
}
object docs extends CommonScalaModule with MillHepekModule {
def ivyDeps = Agg(
ivy"ba.sake::hepek:0.22.0"
)
}
trait CommonScalaModule extends ScalaModule with ScalafmtModule {
def scalaVersion = "3.4.2"
def scalacOptions = super.scalacOptions() ++ Seq(
"-Yretain-trees", // required for default arguments
"-deprecation",
"-Xcheck-macros"
)
}
trait CommonPublishModule extends SonatypeCentralPublishModule {
def publishVersion = tupsonVersion
def pomSettings = PomSettings(
organization = "ba.sake",
url = "https://github.com/sake92/tupson",
licenses = Seq(License.Common.Apache2),
versionControl = VersionControl.github("sake92", "tupson"),
description = "Tupson JSON library",
developers = Seq(
Developer("sake92", "Sakib Hadžiavdić", "https://sake.ba")
)
)
}
trait CommonTestModule extends TestModule.Munit {
def ivyDeps = Agg(
ivy"org.scalameta::munit::1.0.0"
)
}