-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathbuild.mill
More file actions
82 lines (71 loc) · 2.48 KB
/
build.mill
File metadata and controls
82 lines (71 loc) · 2.48 KB
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
//| mill-version: 1.0.6
//| mill-jvm-version: temurin:24
//| mill-jvm-opts: ["--enable-native-access=ALL-UNNAMED"]
//| mvnDeps:
//| - org.xerial:sqlite-jdbc:3.51.0.0
//| - com.lihaoyi::scalasql:0.2.3
//| - com.goyeau::mill-scalafix::0.6.0
package build
import com.goyeau.mill.scalafix.ScalafixModule
import mill.*, scalalib.*, publish.*
import mill.api.BuildCtx
trait ScalaConfigs extends ScalaModule, ScalafixModule:
scalaConfigs =>
def scalaVersion = "3.7.3"
def jvmId = "temurin:24"
override def forkArgs =
// TODO: fix when Scala 3.8
super.forkArgs() ++ Seq("--sun-misc-unsafe-memory-access=allow")
override def scalacOptions: T[Seq[String]] =
Seq("-deprecation", "-Wunused:imports") // "-Ximport-suggestion-timeout 0"
def scalafixConfig = Some(BuildCtx.workspaceRoot / ".scalafix.conf")
def extractAssembly() = Task.Command[Unit]:
val name = scalaConfigs.moduleSegments.last.value
os.copy.over(
from = assembly().path,
to = BuildCtx.workspaceRoot / s"$name.jar",
)
end extractAssembly
def runExclusive(args: String*) = Task.Command(exclusive = true):
runner().run(args)
end ScalaConfigs
object pgo extends ScalaConfigs with SonatypeCentralPublishModule:
def publishVersion: T[String] = "0.1.1-SNAPSHOT"
override def artifactName: T[String] = "pgo"
def pomSettings: T[PomSettings] = PomSettings(
organization = "com.fhackett",
description = "PGo",
url = "https://github.com/DistCompiler/pgo",
licenses = Seq(License.`Apache-2.0`),
versionControl = VersionControl.github("distCompiler", "pgo"),
developers = Seq(
Developer(
id = "fhackett",
name = "Finn Hackett",
url = "https://fhackett.com/",
),
),
)
override def unmanagedClasspath =
super.unmanagedClasspath()
++ build.tlc.unmanagedClasspath()
++ Seq(build.tlc.jar())
def mvnDeps = Seq(
mvn"com.lihaoyi::os-lib:0.11.5",
mvn"com.lihaoyi::upickle:4.3.2",
mvn"io.github.java-diff-utils:java-diff-utils:4.15",
mvn"org.rogach::scallop:5.2.0",
mvn"org.scala-lang.modules::scala-parser-combinators:2.4.0",
)
object test extends ScalaTests:
def mvnDeps = Seq(
mvn"org.scalameta::munit::1.1.1",
mvn"org.scalameta::munit-scalacheck:1.1.0",
mvn"com.lihaoyi::pprint:0.9.0",
mvn"com.lihaoyi::mainargs:0.7.6",
mvn"com.github.daddykotex::courier:3.2.0",
)
def testFramework = "munit.Framework"
override def testParallelism: T[Boolean] = false
end test
end pgo