-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sbt
128 lines (118 loc) · 4.24 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
import xerial.sbt.Sonatype.GitHubHosting
import com.lightbend.paradox.markdown.Writer
val playVersion = "3.0.0"
val circeVersion = "0.14.6"
val testkitVersion = "7.0.1"
val pekko = {
val pekkoVersion = "1.0.3"
List(
"org.apache.pekko" %% "pekko-actor" % pekkoVersion,
"org.apache.pekko" %% "pekko-slf4j" % pekkoVersion,
"org.apache.pekko" %% "pekko-serialization-jackson" % pekkoVersion,
"org.apache.pekko" %% "pekko-actor-typed" % pekkoVersion,
)
}
inThisBuild(List(
versionPolicyIntention := Compatibility.None, //todo revert after release
organization := "org.endpoints4s",
sonatypeProjectHosting := Some(
GitHubHosting("endpoints4s", "play", "julien@richard-foy.fr")
),
homepage := Some(sonatypeProjectHosting.value.get.scmInfo.browseUrl),
licenses := Seq(
"MIT License" -> url("http://opensource.org/licenses/mit-license.php")
),
developers := List(
Developer("julienrf", "Julien Richard-Foy", "julien@richard-foy.fr", url("http://julien.richard-foy.fr"))
),
scalaVersion := "2.13.12",
crossScalaVersions := Seq(scalaVersion.value, "3.3.1"),
versionPolicyIgnoredInternalDependencyVersions := Some("^\\d+\\.\\d+\\.\\d+\\+\\d+".r)
))
val `play-server` =
project
.in(file("server"))
.settings(
name := "play-server",
libraryDependencies ++= pekko ++ Seq(
"org.endpoints4s" %% "openapi" % "5.0.1",
"org.playframework" %% "play" % playVersion,
"org.playframework" %% "play-netty-server" % playVersion % Test,
"org.endpoints4s" %% "algebra-circe-testkit" % testkitVersion % Test,
"org.playframework" %% "play-test" % playVersion % Test,
"org.playframework" %% "play-ahc-ws" % playVersion % Test,
)
)
val `play-server-circe` =
project
.in(file("server-circe"))
.settings(
name := "play-server-circe",
libraryDependencies ++= Seq(
"io.circe" %% "circe-parser" % circeVersion,
"org.endpoints4s" %% "algebra-circe" % "2.6.1",
"org.endpoints4s" %% "json-schema-circe" % "2.6.1",
)
)
.dependsOn(`play-server`)
val `play-client` =
project
.in(file("client"))
.settings(
name := "play-client",
libraryDependencies ++= pekko ++ Seq(
"org.endpoints4s" %% "openapi" % "5.0.1",
"org.playframework" %% "play-ahc-ws" % playVersion,
"org.endpoints4s" %% "algebra-circe-testkit" % testkitVersion % Test,
"org.endpoints4s" %% "json-schema-generic" % "1.12.1" % Test,
)
)
val documentation =
project.in(file("documentation"))
.enablePlugins(ParadoxMaterialThemePlugin, ParadoxPlugin, ParadoxSitePlugin, ScalaUnidocPlugin)
.settings(
publish / skip := true,
coverageEnabled := false,
autoAPIMappings := true,
Compile / paradoxMaterialTheme := {
val theme = (Compile / paradoxMaterialTheme).value
val repository =
(ThisBuild / sonatypeProjectHosting).value.get.scmInfo.browseUrl.toURI
theme
.withRepository(repository)
.withSocial(repository)
.withCustomStylesheet("snippets.css")
},
paradoxProperties ++= Map(
"version" -> version.value,
"scaladoc.base_url" -> s".../${(packageDoc / siteSubdirName).value}",
"github.base_url" -> s"${homepage.value.get}/blob/v${version.value}"
),
paradoxDirectives += ((_: Writer.Context) =>
org.endpoints4s.paradox.coordinates.CoordinatesDirective
),
ScalaUnidoc / unidoc / scalacOptions ++= Seq(
"-implicits",
"-diagrams",
"-groups",
"-doc-source-url",
s"${homepage.value.get}/blob/v${version.value}€{FILE_PATH}.scala",
"-sourcepath",
(ThisBuild / baseDirectory).value.absolutePath
),
ScalaUnidoc / unidoc / unidocProjectFilter := inProjects(
`play-server`, `play-server-circe`, `play-client`
),
packageDoc / siteSubdirName := "api",
addMappingsToSiteDir(
ScalaUnidoc / packageDoc / mappings,
packageDoc / siteSubdirName
)
)
val play =
project.in(file("."))
.aggregate(`play-server`, `play-server-circe`, `play-client`, documentation)
.settings(
publish / skip := true
)
Global / onChangedBuildSource := ReloadOnSourceChanges