forked from sbt/sbt-release
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sbt
More file actions
51 lines (43 loc) · 1.03 KB
/
build.sbt
File metadata and controls
51 lines (43 loc) · 1.03 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
import sbtrelease.ReleaseStateTransformations._
val Scala213 = "2.13.17"
val Scala212 = "2.12.21"
scalaVersion := Scala213
crossScalaVersions := Scala213 :: Scala212 :: Nil
releaseCrossBuild := false
releaseProcess := Seq(
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
setNextVersion,
commitNextVersion
)
name := "sbt-release-cross-test"
InputKey[Unit]("checkTargetDir") := {
import complete.DefaultParsers._
val args = spaceDelimited("<arg>").parsed
val exists = args(1) match {
case "exists" =>
true
case "not-exists" =>
false
}
val dir = file {
if (sbtVersion.value.startsWith("1")) {
val scalaBinaryV = args(0)
s"target/scala-${scalaBinaryV}/classes"
} else {
val scalaV = args(0) match {
case "2.12" =>
Scala212
case "2.13" =>
Scala213
}
s"target/out/jvm/scala-${scalaV}/sbt-release-cross-test/classes"
}
}
assert(dir.isDirectory == exists)
}