forked from com-lihaoyi/geny
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sc
80 lines (66 loc) · 2.49 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
import mill._, scalalib._, scalajslib._, scalanativelib._, publish._
import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version_mill0.9:0.1.1`
import de.tobiasroeser.mill.vcs.version.VcsVersion
val dottyCustomVersion = sys.props.get("dottyVersion")
val scala211 = "2.11.12"
val scala212 = "2.12.13"
val scala213 = "2.13.4"
val scala3 = "3.0.0-RC2"
val scalaVersions = scala213 :: scala212 :: scala211 :: scala3 :: dottyCustomVersion.toList
val scala2Versions = scalaVersions.filter(_.startsWith("2."))
val scalaJSVersions = for {
scalaV <- scalaVersions
scalaJSV <- Seq("0.6.33", "1.4.0")
if scalaV.startsWith("2.") || scalaJSV.startsWith("1.")
} yield (scalaV, scalaJSV)
val scalaNativeVersions = for {
scalaV <- scala2Versions
scalaNativeV <- Seq("0.4.0")
} yield (scalaV, scalaNativeV)
trait GenyPublishModule extends PublishModule {
def artifactName = "geny"
def publishVersion = VcsVersion.vcsState().format()
def pomSettings = PomSettings(
description = artifactName(),
organization = "com.lihaoyi",
url = "https://github.com/lihaoyi/geny",
licenses = Seq(License.MIT),
scm = SCM(
"git://github.com/lihaoyi/geny.git",
"scm:git://github.com/lihaoyi/geny.git"
),
developers = Seq(
Developer("lihaoyi", "Li Haoyi", "https://github.com/lihaoyi")
)
)
}
trait Common extends CrossScalaModule {
def millSourcePath = build.millSourcePath / "geny"
def sources = T.sources(millSourcePath / "src")
}
trait CommonTestModule extends ScalaModule with TestModule {
def ivyDeps = Agg(ivy"com.lihaoyi::utest::0.7.8")
def testFrameworks = Seq("utest.runner.Framework")
}
object geny extends Module {
object jvm extends Cross[JvmGenyModule](scalaVersions: _*)
class JvmGenyModule(val crossScalaVersion: String)
extends Common with ScalaModule with GenyPublishModule
{
object test extends Tests with CommonTestModule
}
object js extends Cross[JSGenyModule](scalaJSVersions: _*)
class JSGenyModule(val crossScalaVersion: String, crossJSVersion: String)
extends Common with ScalaJSModule with GenyPublishModule
{
def scalaJSVersion = crossJSVersion
object test extends Tests with CommonTestModule
}
object native extends Cross[NativeGenyModule](scalaNativeVersions: _*)
class NativeGenyModule(val crossScalaVersion: String, crossScalaNativeVersion: String)
extends Common with ScalaNativeModule with GenyPublishModule
{
def scalaNativeVersion = crossScalaNativeVersion
object test extends Tests with CommonTestModule
}
}