-
Notifications
You must be signed in to change notification settings - Fork 47
/
build.sbt
82 lines (75 loc) · 2.79 KB
/
build.sbt
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
val dynverRoot = project.in(file("."))
aggregateProjects(dynverLib, sbtdynver)
lazy val scala2_12 = "2.12.20"
lazy val scala2_13 = "2.13.15"
lazy val scala3 = "3.3.4"
lazy val scalacOptions212 = Seq(
"-Xlint",
"-Xfuture",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Ywarn-value-discard",
"-Yno-adapted-args",
)
inThisBuild(List(
scalaVersion := scala2_12,
organization := "com.github.sbt",
licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0")),
description := "An sbt plugin to dynamically set your version from git",
developers := List(Developer("dwijnand", "Dale Wijnand", "dale wijnand gmail com", url("https://dwijnand.com"))),
startYear := Some(2016),
homepage := scmInfo.value map (_.browseUrl),
scmInfo := Some(ScmInfo(url("https://github.com/sbt/sbt-dynver"), "scm:git:git@github.com:sbt/sbt-dynver.git")),
dynverSonatypeSnapshots := true,
version := {
val orig = version.value
if (orig.endsWith("-SNAPSHOT")) "5.0.1-SNAPSHOT"
else orig
},
scalacOptions ++= Seq(
"-encoding",
"utf8",
"-deprecation",
"-feature",
"-unchecked",
) ++ scalacOptions212,
Test / fork := false,
Test / logBuffered := false,
Test / parallelExecution := true,
))
val dynverLib = LocalProject("dynver")
val dynver = project.settings(
libraryDependencies += "org.eclipse.jgit" % "org.eclipse.jgit" % "5.13.3.202401111512-r" % Test,
libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.18.1" % Test,
publishSettings,
crossScalaVersions := Seq(scala2_12, scala2_13, scala3),
scripted := (()),
scalacOptions := {
scalaBinaryVersion.value match {
case "3" | "2.13" => scalacOptions.value.filterNot(scalacOptions212.contains(_))
case _ => scalacOptions.value
}
}
)
val sbtdynver = project.dependsOn(dynverLib).enablePlugins(SbtPlugin).settings(
name := "sbt-dynver",
scriptedBufferLog := true,
scriptedDependencies := Seq(dynver / publishLocal, publishLocal).dependOn.value,
scriptedLaunchOpts += s"-Dplugin.version=${version.value}",
scriptedLaunchOpts += s"-Dsbt.boot.directory=${file(sys.props("user.home")) / ".sbt" / "boot"}",
crossScalaVersions := Seq(scala2_12, scala3),
(pluginCrossBuild / sbtVersion) := {
scalaBinaryVersion.value match {
case "2.12" => "1.3.0"
case _ => "2.0.0-M2"
}
},
publishSettings,
)
lazy val publishSettings = Def.settings(
MimaSettings.mimaSettings,
)
crossScalaVersions := Nil
mimaPreviousArtifacts := Set.empty
publish / skip := true
Global / cancelable := true