-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.sc
64 lines (59 loc) · 2.88 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
import $ivy.`com.goyeau::mill-git::0.2.5`
import $ivy.`com.goyeau::mill-scalafix::0.4.2`
import $ivy.`de.tototec::de.tobiasroeser.mill.integrationtest::0.7.1`
import $ivy.`org.typelevel::scalac-options:0.1.7`
import com.goyeau.mill.git.{GitVersionModule, GitVersionedPublishModule}
import com.goyeau.mill.scalafix.StyleModule
import de.tobiasroeser.mill.integrationtest._
import mill._
import mill.scalalib._
import mill.scalalib.api.Util.scalaNativeBinaryVersion
import mill.scalalib.publish.{Developer, License, PomSettings, VersionControl}
import org.typelevel.scalacoptions.ScalacOptions._
import org.typelevel.scalacoptions.{ScalaVersion, ScalacOptions}
val millVersions = Seq("0.10.12", "0.11.1")
def millBinaryVersion(millVersion: String) = scalaNativeBinaryVersion(millVersion)
object `mill-git` extends Cross[MillGitCross](millVersions: _*)
class MillGitCross(millVersion: String)
extends CrossModuleBase
with StyleModule
with GitVersionedPublishModule {
override def crossScalaVersion = "2.13.10"
override def scalacOptions = super.scalacOptions() ++ ScalacOptions.tokensForVersion(
ScalaVersion.unsafeFromString(scalaVersion()),
ScalacOptions.default + source3 ++ fatalWarningOptions
)
override def artifactSuffix = s"_mill${millBinaryVersion(millVersion)}" + super.artifactSuffix()
override def compileIvyDeps = super.compileIvyDeps() ++ Agg(
ivy"com.lihaoyi::mill-main:$millVersion",
ivy"com.lihaoyi::mill-scalalib:$millVersion",
ivy"com.lihaoyi::mill-contrib-docker:$millVersion"
)
override def ivyDeps = super.ivyDeps() ++ Agg(ivy"org.eclipse.jgit:org.eclipse.jgit:6.10.0.202406032230-r")
override def publishVersion = GitVersionModule.version(withSnapshotSuffix = true)()
def pomSettings = PomSettings(
description = "A git version plugin for Mill build tool",
organization = "com.goyeau",
url = "https://github.com/joan38/mill-git",
licenses = Seq(License.MIT),
versionControl = VersionControl.github("joan38", "mill-git"),
developers = Seq(Developer("joan38", "Joan Goyeau", "https://github.com/joan38"))
)
}
object itest extends Cross[ITestCross](millVersions: _*)
class ITestCross(millVersion: String) extends MillIntegrationTestModule {
override def millSourcePath = super.millSourcePath / os.up
override def millTestVersion = millVersion
override def pluginsUnderTest = Seq(`mill-git`(millVersion))
override def testInvocations = testCases().map(
_ -> Seq(
TestInvocation.Targets(Seq("uncommittedChanges")),
TestInvocation.Targets(Seq("commitWithoutTag")),
TestInvocation.Targets(Seq("uncommittedChangesAfterCommitWithoutTag")),
TestInvocation.Targets(Seq("headTagged")),
TestInvocation.Targets(Seq("uncommittedChangesAfterTag")),
TestInvocation.Targets(Seq("commitAfterTag")),
TestInvocation.Targets(Seq("uncommittedChangesAfterTagAndCommit"))
)
)
}