-
Notifications
You must be signed in to change notification settings - Fork 34
/
build.sbt
122 lines (104 loc) · 4.2 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
import scala.collection.immutable
ThisBuild / scalacOptions ++= Seq("-deprecation", "-feature")
ThisBuild / organization := "de.leanovate.play-mockws"
// Those are mandatory for the release to Sonatype
ThisBuild / homepage := Some(url("https://github.com/leanovate/play-mockws"))
ThisBuild / licenses := List("MIT" -> url("http://opensource.org/licenses/MIT"))
ThisBuild / developers := List(
Developer(
"yanns",
"Yann Simon",
"",
url("http://yanns.github.io/")
)
)
val play28Version = "2.8.22"
val play29Version = "2.9.6"
val play30Version = "3.0.5"
def play2Dependencies(version: String): Seq[ModuleID] = Seq(
"com.typesafe.play" %% "play" % version,
"com.typesafe.play" %% "play-ahc-ws" % version,
"com.typesafe.play" %% "play-test" % version,
).map(_ % Provided)
def play3Dependencies(version: String): Seq[ModuleID] = Seq(
"org.playframework" %% "play" % version,
"org.playframework" %% "play-ahc-ws" % version,
"org.playframework" %% "play-test" % version,
).map(_ % Provided)
lazy val testDependencies: Seq[ModuleID] = Seq(
"org.scalatest" %% "scalatest" % "3.2.19",
"org.scalatestplus" %% "scalacheck-1-15" % "3.2.11.0",
"org.scalacheck" %% "scalacheck" % "1.18.1",
"org.mockito" % "mockito-core" % "5.14.2"
).map(_ % Test)
def scalaCollectionsCompat(scalaVersion: String): immutable.Seq[ModuleID] = {
CrossVersion.partialVersion(scalaVersion) match {
case Some((2, n)) if n == 12 =>
List("org.scala-lang.modules" %% "scala-collection-compat" % "2.12.0")
case _ =>
Nil
}
}
val scala212 = "2.12.20"
val scala213 = "2.13.15"
val scala3 = "3.3.4"
ThisBuild / scalaVersion := scala213
ThisBuild / fork := true
ThisBuild / resolvers += "Typesafe repository".at("https://repo.typesafe.com/typesafe/releases/")
lazy val root = (project in file("."))
.settings(
name := "play-mockws",
publishArtifact := false
)
.aggregate(play28, play29, play30)
lazy val play28 = (project in file("play-mockws"))
.settings(
name := "play-mockws-2-8",
target := target.value / "play28",
crossScalaVersions := Seq(scala212, scala213)
)
.settings(
libraryDependencies ++= play2Dependencies(play28Version),
libraryDependencies ++= scalaCollectionsCompat(scalaVersion.value),
libraryDependencies ++= testDependencies
)
.settings(
Compile / unmanagedSourceDirectories += (Compile / sourceDirectory).value / "play-2",
Compile / unmanagedSourceDirectories += (Compile / sourceDirectory).value / "play-2-8",
Test / unmanagedSourceDirectories += (Test / sourceDirectory).value / "play-2",
Test / unmanagedSourceDirectories += (Test / sourceDirectory).value / "play-2-8",
)
lazy val play29 = (project in file("play-mockws"))
.settings(
name := "play-mockws-2-9",
target := target.value / "play29",
crossScalaVersions := Seq(scala213, scala3)
)
.settings(
libraryDependencies ++= play2Dependencies(play29Version),
libraryDependencies ++= testDependencies
)
.settings(
Compile / unmanagedSourceDirectories += (Compile / sourceDirectory).value / "play-2",
Compile / unmanagedSourceDirectories += (Compile / sourceDirectory).value / "play-2-9",
Test / unmanagedSourceDirectories += (Test / sourceDirectory).value / "play-2",
Test / unmanagedSourceDirectories += (Test / sourceDirectory).value / "play-2-9",
)
lazy val play30 = (project in file("play-mockws"))
.settings(
name := "play-mockws-3-0",
target := target.value / "play30",
crossScalaVersions := Seq(scala213, scala3)
)
.settings(
libraryDependencies ++= play3Dependencies(play30Version),
libraryDependencies ++= testDependencies
)
.settings(
Compile / unmanagedSourceDirectories += (Compile / sourceDirectory).value / "play-3",
Compile / unmanagedSourceDirectories += (Compile / sourceDirectory).value / "play-3-0",
Test / unmanagedSourceDirectories += (Test / sourceDirectory).value / "play-3",
Test / unmanagedSourceDirectories += (Test / sourceDirectory).value / "play-3-0",
)
// Sonatype profile for releases (otherwise it uses the organization name)
sonatypeProfileName := "de.leanovate"