forked from sangria-graphql/sangria
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
140 lines (129 loc) · 4.69 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
import sbt.Developer
import sbt.Keys.{
crossScalaVersions,
developers,
organizationHomepage,
scalacOptions,
scmInfo,
startYear
}
import com.typesafe.tools.mima.core.{ProblemFilters, Problem}
// sbt-github-actions needs configuration in `ThisBuild`
ThisBuild / crossScalaVersions := Seq("2.12.13", "2.13.5")
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[Problem]("sangria.schema.ProjectedName*"),
ProblemFilters.exclude[Problem]("sangria.schema.Args*")
)
lazy val root = project
.in(file("."))
.withId("sangria-root")
.aggregate(core, benchmarks)
.settings(inThisBuild(projectInfo))
.settings(
scalacSettings ++ shellSettings ++ publishSettings ++ noPublishSettings
)
.disablePlugins(MimaPlugin)
lazy val core = project
.in(file("modules/core"))
.withId("sangria-core")
.settings(scalacSettings ++ shellSettings ++ publishSettings)
.settings(
name := "sangria",
description := "Scala GraphQL implementation",
mimaPreviousArtifacts := Set("org.sangria-graphql" %% "sangria" % "2.1.0"),
testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-oF"),
libraryDependencies ++= Seq(
// AST Parser
"org.parboiled" %% "parboiled" % "2.2.1",
// AST Visitor
"org.sangria-graphql" %% "macro-visit" % "0.1.3",
// Marshalling
"org.sangria-graphql" %% "sangria-marshalling-api" % "1.0.5",
// Streaming
"org.sangria-graphql" %% "sangria-streaming-api" % "1.0.2",
// Macros
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
// Testing
"co.fs2" %% "fs2-core" % "2.5.3" % Test,
"org.scalatest" %% "scalatest" % "3.2.6" % Test,
"org.sangria-graphql" %% "sangria-marshalling-testkit" % "1.0.3" % Test,
"org.sangria-graphql" %% "sangria-spray-json" % "1.0.2" % Test,
"org.sangria-graphql" %% "sangria-argonaut" % "1.0.1" % Test,
"org.sangria-graphql" %% "sangria-ion" % "2.0.0" % Test,
"org.sangria-graphql" %% "sangria-monix" % "2.0.0" % Test,
"eu.timepit" %% "refined" % "0.9.21" % Test,
// CATs
"net.jcazevedo" %% "moultingyaml" % "0.4.2" % Test,
"io.github.classgraph" % "classgraph" % "4.8.103" % Test
)
)
lazy val benchmarks = project
.in(file("modules/benchmarks"))
.withId("sangria-benchmarks")
.dependsOn(core)
.enablePlugins(JmhPlugin)
.settings(scalacSettings ++ shellSettings ++ noPublishSettings)
.settings(
name := "sangria-benchmarks",
description := "Benchmarks of Sangria functionality"
)
.disablePlugins(MimaPlugin)
/* Commonly used functionality across the projects
*/
lazy val projectInfo = Seq(
organization := "org.sangria-graphql",
homepage := Some(url("http://sangria-graphql.org")),
licenses := Seq(
"Apache License, ASL Version 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
startYear := Some(2015),
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.git"),
connection = "scm:git:git@github.com:sangria-graphql/sangria.git"
))
)
lazy val scalacSettings = Seq(
scalacOptions ++= Seq("-deprecation", "-feature", "-Xlint:-missing-interpolator,_"),
scalacOptions ++= {
if (scalaVersion.value.startsWith("2.12")) Seq("-language:higherKinds") else List.empty[String]
},
scalacOptions += "-target:jvm-1.8",
javacOptions ++= Seq("-source", "8", "-target", "8")
)
lazy val shellSettings = Seq(
// nice *magenta* prompt!
ThisBuild / shellPrompt := { state =>
scala.Console.MAGENTA + Project.extract(state).currentRef.project + "> " + scala.Console.RESET
}
)
lazy val publishSettings = Seq(
releaseCrossBuild := true,
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
releaseVcsSign := true,
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := (_ => false),
publishTo := Some(
if (isSnapshot.value)
"snapshots".at("https://oss.sonatype.org/content/repositories/snapshots")
else
"releases".at("https://oss.sonatype.org/service/local/staging/deploy/maven2"))
)
lazy val noPublishSettings = Seq(
publish := {},
publishLocal := {},
publishArtifact := false
)