-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Update dependencies and Scala version (support 2.13)
- Fix warnings/code smells - Update CI
- Loading branch information
Showing
18 changed files
with
212 additions
and
56 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 |
---|---|---|
|
@@ -41,3 +41,4 @@ out/ | |
*.sublime-workspace | ||
|
||
bin/ | ||
.bsp |
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
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,17 +1,17 @@ | ||
import sbt._ | ||
|
||
object Dependencies { | ||
val scalacheckVersion = "1.14.3" | ||
val akkaHttpVersion = "10.1.9" | ||
val akkaStreamsVersion = "2.5.25" | ||
val pac4jVersion = "4.4.0" | ||
val scalaTestVersion = "3.2.2" | ||
|
||
lazy val scalacheck = "org.scalacheck" %% "scalacheck" % scalacheckVersion | ||
lazy val akkaHttp = "com.typesafe.akka" %% "akka-http" % akkaHttpVersion | ||
lazy val akkaHttpTestKit = "com.typesafe.akka" %% "akka-http-testkit" % akkaHttpVersion | ||
lazy val akkaStream = "com.typesafe.akka" %% "akka-stream" % akkaStreamsVersion | ||
lazy val pac4j = "org.pac4j" % "pac4j-core" % pac4jVersion | ||
lazy val scalaTestCore = "org.scalatest" %% "scalatest" % scalaTestVersion | ||
lazy val akkaStreamTestKit = "com.typesafe.akka" %% "akka-stream-testkit" % akkaStreamsVersion | ||
|
||
val scalacheckVersion = "1.14.3" | ||
val akkaHttpVersion = "10.1.9" | ||
val akkaStreamsVersion = "2.5.25" | ||
val pac4jVersion = "4.0.3" | ||
val scalaTestVersion = "3.0.5" | ||
} |
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,54 @@ | ||
import sbt.Keys._ | ||
import sbt._ | ||
import sbt.plugins.JvmPlugin | ||
|
||
import com.sksamuel.scapegoat.sbt.ScapegoatSbtPlugin | ||
|
||
object Scapegoat extends AutoPlugin { | ||
override def trigger = allRequirements | ||
override def requires = JvmPlugin | ||
|
||
import ScapegoatSbtPlugin.autoImport._ | ||
|
||
override def projectSettings = Seq( | ||
ThisBuild / scapegoatVersion := "1.4.8", | ||
scapegoatReports := Seq("text"), // xml in 2.13 require extra dep | ||
scapegoatDisabledInspections := Seq("FinalModifierOnCaseClass"), | ||
pomPostProcess := { | ||
object Processor { | ||
def apply() = transformPomDependencies { dep => | ||
if ((dep \ "groupId").text == "com.sksamuel.scapegoat") { | ||
None | ||
} else Some(dep) | ||
} | ||
|
||
// --- | ||
|
||
import scala.xml.{ Elem => XmlElem, Node => XmlNode } | ||
|
||
private def transformPomDependencies(tx: XmlElem => Option[XmlNode]): XmlNode => XmlNode = { node: XmlNode => | ||
import scala.xml.{ NodeSeq, XML } | ||
import scala.xml.transform.{ RewriteRule, RuleTransformer } | ||
|
||
val tr = new RuleTransformer(new RewriteRule { | ||
override def transform(node: XmlNode): NodeSeq = node match { | ||
case e: XmlElem if e.label == "dependency" => tx(e) match { | ||
case Some(n) => n | ||
case _ => NodeSeq.Empty | ||
} | ||
|
||
case _ => node | ||
} | ||
}) | ||
|
||
tr.transform(node).headOption match { | ||
case Some(transformed) => transformed | ||
case _ => sys.error("Fails to transform the POM") | ||
} | ||
} | ||
} | ||
|
||
Processor() | ||
} | ||
) | ||
} |
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 +1 @@ | ||
sbt.version=1.3.8 | ||
sbt.version=1.4.9 |
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
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
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
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
Oops, something went wrong.