-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sc
67 lines (55 loc) · 1.74 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
import mill._
import mill.api.Result
import mill.scalalib._
import mill.scalanativelib._
import mill.scalalib.scalafmt.ScalafmtModule
object bencode extends Module with Publishing {
def ivyDeps = Agg(
ivy"org.scodec::scodec-core::${Versions.scodec}",
ivy"org.typelevel::cats-core::${Versions.cats}",
)
object test extends TestModule
object native extends NativeModule with Publishing {
def millSourcePath = bencode.millSourcePath
def ivyDeps = bencode.ivyDeps
object test extends NativeTestModule
}
}
trait Publishing extends PublishModule {
import mill.scalalib.publish._
def artifactName = "bencode"
def sonatypeUri: String = "https://s01.oss.sonatype.org/service/local"
def pomSettings = PomSettings(
description = "Bencode codecs",
organization = "io.github.torrentdam.bencode",
url = "https://github.com/TorrentDamDev/bencode",
licenses = Seq(License.MIT),
versionControl = VersionControl.github("TorrentDamDev", "bencode"),
developers = Seq(
Developer("lavrov", "Vitaly Lavrov","https://github.com/lavrov")
)
)
def publishVersion = T.input {
T.ctx.env.get("VERSION") match {
case Some(version) => Result.Success(version)
case None => Result.Failure("VERSION env variable is undefined")
}
}
}
trait Module extends ScalaModule with ScalafmtModule {
def scalaVersion = "3.1.3"
trait TestModule extends Tests {
def ivyDeps = Agg(
ivy"com.eed3si9n.verify::verify::1.0.0",
)
def testFrameworks = Seq("verify.runner.Framework")
}
}
trait NativeModule extends Module with ScalaNativeModule {
def scalaNativeVersion = "0.4.5"
trait NativeTestModule extends TestModule with Tests
}
object Versions {
val cats = "2.8.0"
val `scodec` = "2.2.0"
}