-
Notifications
You must be signed in to change notification settings - Fork 39
/
build.sbt
96 lines (94 loc) · 3 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
lazy val repoSlug = "sbt/flyway-sbt"
lazy val flywayVersion = "9.22.0"
lazy val scala212 = "2.12.20"
lazy val scala3 = "3.3.4"
ThisBuild / organization := "com.github.sbt"
ThisBuild / version := {
val orig = (ThisBuild / version).value
if (orig.startsWith("9.") && orig.endsWith("-SNAPSHOT")) {
"9.0.0-SNAPSHOT"
} else orig
}
lazy val root = (project in file("."))
.enablePlugins(SbtPlugin)
.settings(
name := "flyway-sbt",
crossScalaVersions := Seq(scala212, scala3),
libraryDependencies ++= Seq(
"org.flywaydb" % "flyway-core" % flywayVersion
),
scalacOptions ++= Seq(
"-deprecation",
"-unchecked",
"-Xfuture"
),
pluginCrossBuild / sbtVersion := {
scalaBinaryVersion.value match {
case "2.12" => "1.5.8"
case _ => "2.0.0-M2"
}
},
Compile / doc / scalacOptions ++= {
scalaBinaryVersion.value match {
case "2.12" =>
Seq(
"-sourcepath",
(LocalRootProject / baseDirectory).value.getAbsolutePath,
"-doc-source-url",
s"""https://github.com/sbt/flyway-sbt/tree/${sys.process
.Process("git rev-parse HEAD")
.lineStream_!
.head}€{FILE_PATH}.scala"""
)
case _ => Nil
}
},
scriptedLaunchOpts := {
scriptedLaunchOpts.value ++
Seq("-Xmx1024M", "-Dplugin.version=" + version.value)
},
scriptedBufferLog := false,
publishMavenStyle := true,
)
ThisBuild / description := "An sbt plugin for Flyway database migration"
ThisBuild / developers := List(
Developer(
id = "davidmweber",
name = "David Weber",
email = "[email protected]",
url = url("https://davidmweber.github.io/flyway-sbt-docs/")
)
)
ThisBuild / licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt"))
ThisBuild / scmInfo := Some(
ScmInfo(
url(s"https://github.com/$repoSlug"),
s"scm:[email protected]:$repoSlug.git"
)
)
ThisBuild / homepage := Some(url(s"https://github.com/$repoSlug"))
ThisBuild / publishTo := sonatypePublishTo.value
ThisBuild / githubWorkflowBuild := Seq(WorkflowStep.Sbt(List("+test", "+scripted")))
ThisBuild / githubWorkflowTargetTags ++= Seq("v*")
ThisBuild / githubWorkflowPublishTargetBranches :=
Seq(RefPredicate.StartsWith(Ref.Tag("v")))
ThisBuild / githubWorkflowPublish := Seq(
WorkflowStep.Sbt(
commands = List("ci-release"),
name = Some("Publish project"),
env = Map(
"PGP_PASSPHRASE" -> "${{ secrets.PGP_PASSPHRASE }}",
"PGP_SECRET" -> "${{ secrets.PGP_SECRET }}",
"SONATYPE_PASSWORD" -> "${{ secrets.SONATYPE_PASSWORD }}",
"SONATYPE_USERNAME" -> "${{ secrets.SONATYPE_USERNAME }}"
)
)
)
ThisBuild / githubWorkflowOSes := Seq("ubuntu-latest", "macos-latest")
ThisBuild / githubWorkflowJavaVersions := Seq(
JavaSpec.temurin("8"),
JavaSpec.temurin("17")
)
ThisBuild / githubWorkflowBuildMatrixExclusions ++= Seq(
MatrixExclude(Map("java" -> "temurin@8", "os" -> "macos-latest")),
)