forked from hoangmaihuy/mill-missinglink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sc
87 lines (65 loc) · 2.83 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
81
82
83
84
85
86
87
import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.4.0`
import $ivy.`de.tototec::de.tobiasroeser.mill.integrationtest::0.7.1`
import mill._
import mill.scalalib._
import mill.scalalib.publish._
import mill.scalalib.api.ZincWorkerUtil.scalaNativeBinaryVersion
import de.tobiasroeser.mill.integrationtest._
import de.tobiasroeser.mill.vcs.version.VcsVersion
def millVersionFile = T.source(PathRef(os.pwd / ".mill-version"))
def millVersion = T {
os.read(millVersionFile().path).trim
}
object `mill-missinglink` extends ScalaModule with PublishModule {
override def scalaVersion = "2.13.11"
override def publishVersion: T[String] = T {
VcsVersion
.vcsState()
.format(
dirtyHashDigits = 0,
untaggedSuffix = "-SNAPSHOT"
)
}
override def pomSettings = PomSettings(
description = "Missinglink for Mill",
organization = "io.github.hoangmaihuy",
url = "https://github.com/hoangmaihuy/mill-missinglink",
licenses = Seq(License.`Apache-2.0`),
versionControl = VersionControl.github(owner = "hoangmaihuy", repo = "mill-missinglink"),
developers = Seq(Developer("hoangmaihuy", "Hoang Mai", "https://github.com/hoangmaihuy"))
)
override def artifactName = "mill-missinglink"
override def artifactSuffix =
"_mill" + scalaNativeBinaryVersion(millVersion()) +
super.artifactSuffix()
override def scalacOptions = Seq("-Ywarn-unused", "-deprecation")
override def compileIvyDeps = super.compileIvyDeps() ++ Agg(
ivy"com.lihaoyi::mill-scalalib:${millVersion()}"
)
override def ivyDeps = Agg(
ivy"com.spotify:missinglink-core:0.2.9"
)
}
object itest extends MillIntegrationTestModule {
override def millTestVersion = millVersion
override def pluginsUnderTest = Seq(`mill-missinglink`)
def testBase = millSourcePath / "src"
private def successMissinglinkCheck = Seq(
TestInvocation.Targets(Seq("missinglinkCheck"))
)
private def errorMissinglinkCheck = Seq(
TestInvocation.Targets(Seq("missinglinkCheck"), expectedExitCode = 1)
)
override def testInvocations = Seq(
PathRef(testBase / "do-not-fail-on-conflicts") -> successMissinglinkCheck,
PathRef(testBase / "exclude-problematic-dependency") -> errorMissinglinkCheck,
PathRef(testBase / "has-problematic-dependency") -> errorMissinglinkCheck,
PathRef(testBase / "ignore-destination-package") -> successMissinglinkCheck,
PathRef(testBase / "ignore-source-package") -> successMissinglinkCheck,
PathRef(testBase / "ignores-unused-dependency") -> successMissinglinkCheck,
PathRef(testBase / "scans-dependencies") -> errorMissinglinkCheck,
PathRef(testBase / "target-destination-package") -> successMissinglinkCheck,
PathRef(testBase / "target-source-package") -> errorMissinglinkCheck,
PathRef(testBase / "uses-problematic-dependency") -> errorMissinglinkCheck
)
}