-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sbt
99 lines (90 loc) · 4.45 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
// **************************************************
// SETTINGS
// **************************************************
lazy val commonSettings = Seq(
version := "3.1",
description :=
"""
|This extension created on top of official MongoDB Scala Driver.
|It allows to fully utilize Spray, Play or Circe JSON and represents bidirectional serialization for case classes in BSON,
|as well as flexible DSL for MongoDB query operators, documents and collections.
|""".stripMargin,
licenses := List("Apache 2" -> new URL("https://www.apache.org/licenses/LICENSE-2.0.txt")),
homepage := Some(url("https://github.com/GreenLeafOSS/green-leaf-mongo")),
organization := "io.github.greenleafoss",
organizationName := "greenleafoss",
organizationHomepage := Some(url("https://github.com/greenleafoss")),
developers := List(
Developer(
id = "lashchenko",
name = "Andrii Lashchenko",
email = "[email protected]",
url = url("https://github.com/lashchenko")
)
),
scmInfo := Some(
ScmInfo(
url("https://github.com/GreenLeafOSS/green-leaf-mongo"),
"scm:[email protected]:GreenLeafOSS/green-leaf-mongo.git"
)
),
publishTo := {
// https://central.sonatype.org/news/20210223_new-users-on-s01/
val nexus = "https://s01.oss.sonatype.org"
if (isSnapshot.value) Some("snapshots" at nexus + "/content/repositories/snapshots")
else Some("releases" at nexus + "/service/local/staging/deploy/maven2")
},
// https://central.sonatype.org/news/20210223_new-users-on-s01/
sonatypeCredentialHost := "https://s01.oss.sonatype.org",
publishMavenStyle := true,
publishConfiguration := publishConfiguration.value.withOverwrite(true),
publishLocalConfiguration := publishLocalConfiguration.value.withOverwrite(true),
scalaVersion := "3.3.1",
scalacOptions ++= Seq(
"-deprecation",
"-feature",
"-explain"
),
scalafmtOnCompile := true,
Test / parallelExecution := false,
Test / fork := true,
libraryDependencies += "org.slf4j" % "slf4j-api" % "2.0.12",
libraryDependencies += "org.slf4j" % "slf4j-simple" % "2.0.13" % Test,
libraryDependencies += "de.flapdoodle.embed" % "de.flapdoodle.embed.mongo" % "3.5.4" % Test,
libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.18" % Test,
libraryDependencies += "org.immutables" % "value" % "2.10.1" % Test
)
// **************************************************
// PROJECTS
// **************************************************
lazy val core = (project in file("core"))
.settings(name := "green-leaf-mongo-core")
.settings(commonSettings)
.settings(libraryDependencies += "org.mongodb.scala" %% "mongo-scala-driver" % "5.1.2" cross CrossVersion.for3Use2_13)
lazy val spray = (project in file("spray"))
.settings(name := "green-leaf-mongo-spray")
.settings(commonSettings)
.settings(libraryDependencies += "io.spray" %% "spray-json" % "1.3.6")
.dependsOn(core % "compile->compile;test->test")
lazy val play = (project in file("play"))
.settings(name := "green-leaf-mongo-play")
.settings(commonSettings)
.settings(libraryDependencies += "com.typesafe.play" %% "play-json" % "2.10.5")
.dependsOn(core % "compile->compile;test->test")
lazy val circe = (project in file("circe"))
.settings(name := "green-leaf-mongo-circe")
.settings(commonSettings)
.settings(libraryDependencies += "io.circe" %% "circe-core" % "0.14.7")
.settings(libraryDependencies += "io.circe" %% "circe-generic" % "0.14.7")
.settings(libraryDependencies += "io.circe" %% "circe-parser" % "0.14.7")
.dependsOn(core % "compile->compile;test->test")
lazy val extensions: Seq[ProjectReference] = List[ProjectReference](spray, play, circe)
lazy val aggregated: Seq[ProjectReference] = List[ProjectReference](core) ++ extensions
lazy val root = (project in file("."))
.settings(name := "green-leaf-mongo")
.settings(commonSettings)
// we don't need to publish core + spray + play together
.settings(publish / skip := true)
.aggregate(aggregated*)
.dependsOn(core % "compile->compile;test->test")
.dependsOn(extensions.map(_ % "compile->compile;compile->test")*)