-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathbuild.sc
More file actions
43 lines (34 loc) · 1.37 KB
/
build.sc
File metadata and controls
43 lines (34 loc) · 1.37 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
// -*- mode: scala -*-
import mill._, os._, scalalib._, publish._
import scala.util.Properties
object meta {
val crossVersions = Seq("2.13.8")
implicit val wd: Path = pwd
def nonEmpty(s: String): Option[String] = s.trim match {
case v if v.isEmpty => None
case v => Some(v)
}
val MILL_VERSION = Properties.propOrNull("MILL_VERSION")
val versionFromEnv = Properties.propOrNone("PUBLISH_VERSION")
val gitSha = nonEmpty(proc("git", "rev-parse", "--short", "HEAD").call().out.trim)
val gitTag = nonEmpty(proc("git", "tag", "-l", "-n0", "--points-at", "HEAD").call().out.trim)
val publishVersion = (versionFromEnv orElse gitTag orElse gitSha).getOrElse("latest")
}
object docker extends Cross[Docker](meta.crossVersions: _*)
class Docker(val crossScalaVersion: String) extends CrossScalaModule with PublishModule {
def publishVersion = meta.publishVersion
def artifactName = "mill-docker"
def pomSettings = PomSettings(
description = "Dockerize java applications on Mill builds",
organization = "com.github.vic",
url = "https://github.com/vic/mill-docker",
licenses = Seq(License.`Apache-2.0`),
versionControl = VersionControl.github("vic", "mill-docker"),
developers = Seq(
Developer("vic", "Victor Borja", "https://github.com/vic")
)
)
def compileIvyDeps = Agg(
ivy"com.lihaoyi::mill-scalalib:${meta.MILL_VERSION}"
)
}