forked from playframework/play-slick
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
86 lines (73 loc) · 2.72 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
import scala.sys.process._
import com.typesafe.tools.mima.plugin.MimaPlugin._
import interplay.ScalaVersions._
ThisBuild / resolvers += Resolver.sonatypeRepo("releases")
// Customise sbt-dynver's behaviour to make it work with tags which aren't v-prefixed
ThisBuild / dynverVTagPrefix := false
// Sanity-check: assert that version comes from a tag (e.g. not a too-shallow clone)
// https://github.com/dwijnand/sbt-dynver/#sanity-checking-the-version
Global / onLoad := (Global / onLoad).value.andThen { s =>
val v = version.value
if (dynverGitDescribeOutput.value.hasNoTags)
throw new MessageOnlyException(
s"Failed to derive version from git tags. Maybe run `git fetch --unshallow`? Version: $v"
)
s
}
lazy val commonSettings = Seq(
// Work around https://issues.scala-lang.org/browse/SI-9311
scalacOptions ~= (_.filterNot(_ == "-Xfatal-warnings")),
scalaVersion := scala213,
crossScalaVersions := Seq(scala213, scala212),
resolvers += "akka-snapshot-repository".at("https://repo.akka.io/snapshots")
)
lazy val `play-slick-root` = (project in file("."))
.enablePlugins(PlayRootProject)
.aggregate(
`play-slick`,
`play-slick-evolutions`
)
.settings(commonSettings)
.settings(
Seq(
// this overrides releaseProcess to make it work with sbt-dynver
releaseProcess := {
import ReleaseTransformations._
Seq[ReleaseStep](
checkSnapshotDependencies,
runClean,
releaseStepCommandAndRemaining("+test"),
releaseStepCommandAndRemaining("+publishSigned"),
releaseStepCommand("sonatypeBundleRelease"),
pushChanges // <- this needs to be removed when releasing from tag
)
}
)
)
lazy val `play-slick` = (project in file("src/core"))
.enablePlugins(PlayLibrary, Playdoc, MimaPlugin)
.configs(Docs)
.settings(libraryDependencies ++= Dependencies.core)
.settings(mimaSettings)
.settings(commonSettings)
lazy val `play-slick-evolutions` = (project in file("src/evolutions"))
.enablePlugins(PlayLibrary, Playdoc, MimaPlugin)
.configs(Docs)
.settings(libraryDependencies ++= Dependencies.evolutions)
.settings(mimaSettings)
.settings(commonSettings)
.dependsOn(`play-slick` % "compile;test->test")
lazy val docs = project
.in(file("docs"))
.enablePlugins(PlayDocsPlugin)
.configs(Docs)
.dependsOn(`play-slick`)
.dependsOn(`play-slick-evolutions`)
.settings(commonSettings)
ThisBuild / playBuildRepoName := "play-slick"
// Binary compatibility is tested against this version
val previousVersion: Option[String] = Some("5.0.0")
ThisBuild / mimaFailOnNoPrevious := false
def mimaSettings = Seq(
mimaPreviousArtifacts := previousVersion.map(organization.value %% moduleName.value % _).toSet
)