-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from DeepnessScience/EXTENSIONS-SPRAY-AND-PLAY…
…-JSON Extensions for Spray and Play JSON
- Loading branch information
Showing
83 changed files
with
3,365 additions
and
2,835 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# https://scalameta.org/scalafmt/docs/installation.html#sbt | ||
version = 3.7.14 | ||
|
||
# https://scalameta.org/scalafmt/docs/configuration.html#scala-dialects | ||
runner.dialect = scala3 | ||
|
||
# https://docs.scala-lang.org/style/declarations.html#modifiers | ||
rewrite.rules = [SortModifiers] | ||
rewrite.sortModifiers.order = [ | ||
"`final`" | ||
"`implicit`" | ||
"`override`" | ||
"`protected`" | ||
"`private`" | ||
"`lazy`" | ||
] | ||
|
||
//rewrite.rules = [RedundantBraces] | ||
//rewrite.redundantBraces.stringInterpolation = true | ||
//rewrite.redundantBraces.defnBodies = "all" | ||
//rewrite.redundantBraces.methodBodies = true | ||
//rewrite.redundantBraces.includeUnitMethods = true | ||
//rewrite.redundantBraces.generalExpressions = true | ||
//rewrite.redundantBraces.ifElseExpressions = true | ||
//newlines.afterCurlyLambdaParams=squash | ||
|
||
# https://scalameta.org/scalafmt/docs/configuration.html#imports | ||
rewrite.rules = [Imports] | ||
//rewrite.imports.sort = scalastyle | ||
rewrite.imports.sort = ascii | ||
rewrite.imports.expand = true | ||
rewrite.imports.groups = [ | ||
["io.github.greenleafoss\\..*"], | ||
["org.mongodb\\..*"], | ||
["org.bson\\..*"], | ||
["java\\..*"], | ||
["scala\\..*"] | ||
] | ||
|
||
# https://scalameta.org/scalafmt/docs/configuration.html#maxcolumn | ||
# 80| 90| 100| 110| 120| | ||
maxColumn = 120 | ||
|
||
# https://scalameta.org/scalafmt/docs/configuration.html#top-level-presets | ||
preset = IntelliJ | ||
|
||
# https://scalameta.org/scalafmt/docs/configuration.html#alignpreset | ||
align.preset=most | ||
align.multiline = true | ||
align.arrowEnumeratorGenerator = false | ||
align.openParenCallSite = false | ||
align.openParenDefnSite = true | ||
|
||
optIn.configStyleArguments = true | ||
|
||
verticalMultiline.atDefnSite = true | ||
# https://scalameta.org/scalafmt/docs/configuration.html#after-only | ||
# implicit | ||
# override private val ctx: Context, | ||
# private val ops: Ops | ||
newlines.implicitParamListModifierForce = [after] | ||
//newlines.implicitParamListModifierForce = [before, after] | ||
|
||
# https://scalameta.org/scalafmt/docs/configuration.html#indentextendsite | ||
indent.extendSite = 2 | ||
|
||
# https://scalameta.org/scalafmt/docs/configuration.html#indentdefnsite | ||
indent.defnSite = 4 | ||
|
||
indent.fewerBraces = always | ||
|
||
|
||
|
||
# https://scalameta.org/scalafmt/docs/configuration.html#trailing-commas | ||
rewrite.trailingCommas.style = never | ||
|
||
# https://scalameta.org/scalafmt/docs/configuration.html#binpacking | ||
# doesn't apply binpacking to calls with fewer arguments | ||
binPack.literalsMinArgCount = 3 | ||
|
||
# https://scalameta.org/scalafmt/docs/configuration.html#binpackparentconstructors | ||
binPack.parentConstructors = Never | ||
|
||
//newlines.beforeTemplateBodyIfBreakInParentCtors = true | ||
|
||
# https://scalameta.org/scalafmt/docs/configuration.html#literal-argument-lists | ||
# List( | ||
# 1, | ||
# 2, | ||
# 3, | ||
# ) | ||
binPack.literalArgumentLists = false | ||
binPack.literalsSingleLine = false | ||
|
||
docstrings.style = Asterisk | ||
docstrings.style = keep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,91 @@ | ||
// ************************************************** | ||
// SETTINGS | ||
// ************************************************** | ||
|
||
lazy val commonSettings = Seq( | ||
version := "3.0", | ||
description := | ||
""" | ||
|This extension created on top of official MongoDB Scala Driver. | ||
|It allows to fully utilize Spray 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 = "andrew.lashchenko@gmail.com", | ||
url = url("https://github.com/lashchenko") | ||
) | ||
), | ||
scmInfo := Some( | ||
ScmInfo( | ||
url("https://github.com/GreenLeafOSS/green-leaf-mongo"), | ||
"scm:git@github.com: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") | ||
}, | ||
|
||
name := "green-leaf-mongo" | ||
|
||
version := "0.1.16.1" | ||
|
||
description := "This extension created on top of official MongoDB Scala Driver, allows to fully utilize Spray JSON and represents bidirectional serialization for case classes in BSON, as well as flexible DSL for MongoDB query operators, documents and collections." | ||
licenses := List("Apache 2" -> new URL("http://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 = "andrew.lashchenko@gmail.com", | ||
url = url("https://github.com/lashchenko") | ||
) | ||
) | ||
|
||
scmInfo := Some( | ||
ScmInfo( | ||
url("https://github.com/GreenLeafOSS/green-leaf-mongo"), | ||
"scm:git@github.com: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) | ||
|
||
scalaVersion := "3.3.0" | ||
|
||
crossScalaVersions := Seq("2.12.18", "2.13.11") | ||
|
||
scalacOptions ++= Seq( | ||
"-deprecation" | ||
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.7", | ||
libraryDependencies += "org.slf4j" % "slf4j-simple" % "2.0.7" % Test, | ||
libraryDependencies += "de.flapdoodle.embed" % "de.flapdoodle.embed.mongo" % "3.5.4" % Test, | ||
libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.15" % Test, | ||
libraryDependencies += "org.immutables" % "value" % "2.9.2" % Test | ||
) | ||
|
||
Test / parallelExecution := false | ||
Test / fork := true | ||
|
||
libraryDependencies += "io.spray" %% "spray-json" % "1.3.6" | ||
libraryDependencies += "org.mongodb.scala" %% "mongo-scala-driver" % "4.10.2" cross CrossVersion.for3Use2_13 | ||
|
||
|
||
libraryDependencies += "org.slf4j" % "slf4j-api" % "2.0.7" | ||
libraryDependencies += "org.slf4j" % "slf4j-simple" % "2.0.7" % Test | ||
|
||
libraryDependencies += "de.flapdoodle.embed" % "de.flapdoodle.embed.mongo" % "4.8.0" % Test | ||
libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.16" % Test | ||
libraryDependencies += "org.immutables" % "value" % "2.9.3" % 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" % "4.9.0" 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.1") | ||
.dependsOn(core % "compile->compile;test->test") | ||
|
||
lazy val extensions: Seq[ProjectReference] = List[ProjectReference](spray, play) | ||
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")*) |
Oops, something went wrong.