-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.sbt
87 lines (75 loc) · 3.56 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
import com.typesafe.tools.mima.core.{DirectMissingMethodProblem, ProblemFilters}
name := "sangria-slowlog"
organization := "org.sangria-graphql"
val isScala3 = Def.setting(
CrossVersion.partialVersion(scalaVersion.value).exists(_._1 == 3)
)
mimaPreviousArtifacts := {
if (isScala3.value) Set.empty else Set("org.sangria-graphql" %% "sangria-slowlog" % "2.0.2")
}
description := "Sangria middleware to log slow GraphQL queries"
homepage := Some(url("https://sangria-graphql.github.io/"))
licenses := Seq(
"Apache License, ASL Version 2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0"))
// sbt-github-actions needs configuration in `ThisBuild`
ThisBuild / crossScalaVersions := Seq("2.12.20", "2.13.15", "3.3.4")
ThisBuild / scalaVersion := crossScalaVersions.value.last
ThisBuild / githubWorkflowPublishTargetBranches := List()
ThisBuild / githubWorkflowBuildPreamble ++= List(
WorkflowStep.Sbt(List("mimaReportBinaryIssues"), name = Some("Check binary compatibility")),
WorkflowStep.Sbt(List("scalafmtCheckAll"), name = Some("Check formatting"))
)
// Binary Incompatible Changes, we'll document.
ThisBuild / mimaBinaryIssueFilters ++= Seq(
ProblemFilters.exclude[DirectMissingMethodProblem]("sangria.slowlog.SlowLog.even"),
ProblemFilters.exclude[DirectMissingMethodProblem]("sangria.slowlog.DefaultMetricRenderer.renderHistogram"),
ProblemFilters.exclude[DirectMissingMethodProblem]("sangria.slowlog.DefaultMetricRenderer.renderTimeUnit"),
ProblemFilters.exclude[DirectMissingMethodProblem]("sangria.slowlog.DefaultMetricRenderer.timeUnitSuffix"),
ProblemFilters.exclude[DirectMissingMethodProblem]("sangria.slowlog.QueryMetrics.findVariableNames"),
ProblemFilters.exclude[DirectMissingMethodProblem]("sangria.slowlog.QueryMetrics.addComments"),
ProblemFilters.exclude[DirectMissingMethodProblem]("sangria.slowlog.QueryMetrics.toComments")
)
scalacOptions += { if (isScala3.value) "-Xtarget:8" else "-target:jvm-1.8" }
javacOptions ++= Seq("-source", "8", "-target", "8")
scalacOptions ++= Seq("-deprecation", "-feature")
libraryDependencies ++= Seq(
"org.sangria-graphql" %% "sangria" % "4.2.3",
"io.dropwizard.metrics" % "metrics-core" % "4.2.29",
"org.slf4j" % "slf4j-api" % "2.0.16",
("io.opentracing.contrib" %% "opentracing-scala-concurrent" % "0.0.6").cross(
CrossVersion.for3Use2_13),
"io.opentracing" % "opentracing-mock" % "0.33.0" % Test,
"org.scalatest" %% "scalatest" % "3.2.19" % Test,
"org.sangria-graphql" %% "sangria-json4s-native" % "1.0.2" % Test,
"org.slf4j" % "slf4j-simple" % "2.0.16" % Test
)
// Publishing
ThisBuild / githubWorkflowTargetTags ++= Seq("v*")
ThisBuild / githubWorkflowPublishTargetBranches :=
Seq(RefPredicate.StartsWith(Ref.Tag("v")))
ThisBuild / githubWorkflowPublish := Seq(
WorkflowStep.Sbt(
List("ci-release"),
env = Map(
"PGP_PASSPHRASE" -> "${{ secrets.PGP_PASSPHRASE }}",
"PGP_SECRET" -> "${{ secrets.PGP_SECRET }}",
"SONATYPE_PASSWORD" -> "${{ secrets.SONATYPE_PASSWORD }}",
"SONATYPE_USERNAME" -> "${{ secrets.SONATYPE_USERNAME }}"
)
)
)
startYear := Some(2017)
organizationHomepage := Some(url("https://github.com/sangria-graphql"))
developers := Developer(
"OlegIlyenko",
"Oleg Ilyenko",
"",
url("https://github.com/OlegIlyenko")) :: Nil
scmInfo := Some(
ScmInfo(
browseUrl = url("https://github.com/sangria-graphql/sangria-slowlog"),
connection = "scm:git:git@github.com:sangria-graphql/sangria-slowlog.git"))
// nice *magenta* prompt!
ThisBuild / shellPrompt := { state =>
scala.Console.MAGENTA + Project.extract(state).currentRef.project + "> " + scala.Console.RESET
}