/
build.sc
49 lines (44 loc) · 1.86 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
import mill._
import scalalib._
import scalafmt._
import publish._
import scalanativelib._
import mill.scalanativelib.api.{LTO, ReleaseMode}
object v {
val upickle = ivy"com.lihaoyi::upickle:1.4.4"
val oslib = ivy"com.lihaoyi::os-lib:0.8.1"
val sttp = ivy"com.softwaremill.sttp.client3::core:3.3.18"
val upickleNative = ivy"com.lihaoyi::upickle::1.4.4"
val oslibNative = ivy"com.lihaoyi::os-lib::0.8.1"
val sttpNative = ivy"com.softwaremill.sttp.client3::core::3.3.18"
}
object gitakc extends Module {
object jvm extends Cross[GeneralJVM]("2.12.13", "2.13.8", "3.0.0")
object native extends Cross[GeneralNative]("2.12.13", "2.13.8")
class GeneralJVM(val crossScalaVersion: String) extends GeneralModule with ScalafmtModule {
def scalaVersion = crossScalaVersion
def prependShellScript = "#!/bin/sh\n" ++ super.prependShellScript()
override def ivyDeps = super.ivyDeps() ++ Agg(v.upickle, v.oslib, v.sttp)
}
class GeneralNative(val crossScalaVersion: String) extends GeneralModule with ScalaNativeModule {
def scalaVersion = crossScalaVersion
def scalaNativeVersion = "0.4.3"
def releaseMode = ReleaseMode.ReleaseFull
def nativeLTO = LTO.Full
def nativeLinkingOptions = T {super.nativeLinkingOptions() ++ Seq("-fuse-ld=lld")}
override def ivyDeps = super.ivyDeps() ++ Agg(v.upickleNative, v.oslibNative, v.sttpNative)
}
trait GeneralModule extends ScalaModule with PublishModule {
m =>
override def millSourcePath = super.millSourcePath / os.up / os.up
def publishVersion = "0.1"
def pomSettings = PomSettings(
description = artifactName(),
organization = "me.jiuyang",
url = "https://jiuyang.me",
licenses = Seq(License.`Apache-2.0`),
versionControl = VersionControl.github("sequencer", "gitakc"),
developers = Seq(Developer("sequencer", "Jiuyang Liu", "https://jiuyang.me/"))
)
}
}