Skip to content

Commit b0dcf44

Browse files
Define pekko module
1 parent 15f7679 commit b0dcf44

File tree

2 files changed

+70
-1
lines changed

2 files changed

+70
-1
lines changed

build.sbt

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
11
name := "guardrail-module-pekko-http"
22

3-
onLoadMessage := WelcomeMessage.welcomeMessage("0.0.0")
3+
import dev.guardrail.sbt.Build
4+
import dev.guardrail.sbt.Build.ProjectSyntax
5+
import dev.guardrail.sbt.modules.scalaPekkoHttp
6+
7+
lazy val pekkoHttp = (
8+
scalaPekkoHttp
9+
.project
10+
.customDependsOn_("guardrail-core", "0.75.3-SNAPSHOT")
11+
.customDependsOn_("guardrail-scala-support", "0.75.3-SNAPSHOT")
12+
.settings(
13+
resolvers ++= Seq(
14+
sbt.librarymanagement.Resolver.mavenLocal,
15+
sbt.librarymanagement.Resolver.defaultLocal,
16+
"Sonatype OSS Snapshots" at "https://s01.oss.sonatype.org/content/repositories/snapshots",
17+
)
18+
)
19+
)
20+
21+
onLoadMessage := WelcomeMessage.welcomeMessage((pekkoHttp / version).value)
22+
23+
lazy val githubMatrixSettings = taskKey[String]("Prints JSON value expected by the Scala CI matrix build: [{ version: ..., bincompat: ... }]")
24+
25+
githubMatrixSettings := {
26+
(pekkoHttp/crossScalaVersions).value
27+
.map(v => (v, v.split('.').take(2).mkString(".")))
28+
.map({ case (version, bincompat) => s"""{"version":"${version}","bincompat":"${bincompat}"}""" })
29+
.mkString("[", ",", "]")
30+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package dev.guardrail.sbt.modules
2+
3+
import dev.guardrail.sbt.Build._
4+
5+
import sbt._
6+
import sbt.Keys._
7+
import wartremover.WartRemover.autoImport._
8+
9+
object scalaPekkoHttp {
10+
val pekkoVersion = "1.0.0"
11+
val pekkoHttpVersion = "1.0.0"
12+
val catsVersion = "2.10.0"
13+
val circeVersion = "0.14.6"
14+
val javaxAnnotationVersion = "1.3.2"
15+
val jaxbApiVersion = "2.3.1"
16+
val refinedVersion = "0.11.0"
17+
val scalatestVersion = "3.2.17"
18+
19+
val dependencies = Seq(
20+
"javax.annotation" % "javax.annotation-api" % javaxAnnotationVersion, // for jdk11
21+
"javax.xml.bind" % "jaxb-api" % jaxbApiVersion, // for jdk11
22+
) ++ Seq(
23+
"org.apache.pekko" %% "pekko-http" % pekkoHttpVersion,
24+
"org.apache.pekko" %% "pekko-http-testkit" % pekkoHttpVersion,
25+
"org.apache.pekko" %% "pekko-stream" % pekkoVersion,
26+
"org.apache.pekko" %% "pekko-testkit" % pekkoVersion,
27+
"eu.timepit" %% "refined" % refinedVersion,
28+
"eu.timepit" %% "refined-cats" % refinedVersion,
29+
"io.circe" %% "circe-core" % circeVersion,
30+
"io.circe" %% "circe-jawn" % circeVersion,
31+
"io.circe" %% "circe-parser" % circeVersion,
32+
"io.circe" %% "circe-refined" % circeVersion,
33+
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
34+
"org.typelevel" %% "cats-core" % catsVersion
35+
).map(_.cross(CrossVersion.for3Use2_13))
36+
37+
val project = commonModule("scala-pekko-http")
38+
39+
val sample =
40+
buildSampleProject("akkaHttp", dependencies)
41+
.settings(Compile / compile / wartremoverWarnings --= Seq(Wart.NonUnitStatements, Wart.Throw))
42+
}

0 commit comments

Comments
 (0)