forked from playframework/play-grpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
132 lines (119 loc) · 4 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
import build.play.grpc.Dependencies
import build.play.grpc.ProjectExtensions.AddPluginTest
ThisBuild / organization := "com.lightbend.play"
ThisBuild / scalacOptions ++= List(
"-encoding",
"utf8",
"-deprecation",
"-feature",
"-unchecked",
"-Xlint",
"-Xfuture",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Ywarn-value-discard",
)
ThisBuild / javacOptions ++= List(
"-Xlint:unchecked",
"-Xlint:deprecation",
)
val playGrpc = Project("play-grpc", file("."))
aggregateProjects(
playInteropTestJava,
playInteropTestScala,
playTestkit,
playSpecs2,
playScalaTest,
playTestdata,
docs,
)
enablePlugins(build.play.grpc.NoPublish)
unmanagedSources in (Compile, headerCreate) := ((baseDirectory.value / "project") ** "*.scala").get
lazy val playTestdata = Project(
id = "play-grpc-testdata",
base = file("play-testdata"),
).settings(Dependencies.playTestdata)
.settings(
scalacOptions += "-Xlint:-unused,_", // can't do anything about unused things in generated code
javacOptions -= "-Xlint:deprecation", // can't do anything about deprecations in generated code
akkaGrpcExtraGenerators ++= List(
akka.grpc.gen.javadsl.play.PlayJavaClientCodeGenerator,
akka.grpc.gen.javadsl.play.PlayJavaServerCodeGenerator,
akka.grpc.gen.scaladsl.ScalaMarshallersCodeGenerator,
akka.grpc.gen.scaladsl.play.PlayScalaClientCodeGenerator,
akka.grpc.gen.scaladsl.play.PlayScalaServerCodeGenerator,
),
)
.enablePlugins(build.play.grpc.NoPublish)
.pluginTestingSettings
lazy val playTestkit = Project(
id = "play-grpc-testkit",
base = file("play-testkit"),
).dependsOn(playTestdata % "test")
.settings(Dependencies.playTestkit)
.pluginTestingSettings
val playSpecs2 = Project("play-grpc-specs2", file("play-specs2"))
.dependsOn(playTestkit, playTestkit % "test->test")
.settings(
Dependencies.playSpecs2,
)
.pluginTestingSettings
val playScalaTest = Project("play-grpc-scalatest", file("play-scalatest"))
.dependsOn(playTestkit, playTestkit % "test->test")
.settings(
Dependencies.playScalaTest,
excludeFilter in (Compile, headerSources) := {
val orig = (excludeFilter in (Test, headerSources)).value
// The following files have a different license
orig || "NewGuiceOneServerPerTest.scala" || "NewServerProvider.scala" || "NewBaseOneServerPerTest.scala"
},
)
.pluginTestingSettings
lazy val playInteropTestScala = Project(
id = "play-grpc-interop-test-scala",
base = file("play-interop-test-scala"),
).dependsOn(playSpecs2 % Test, playScalaTest % Test)
.settings(Dependencies.playInteropTestScala)
.settings(
akkaGrpcExtraGenerators ++= List(
akka.grpc.gen.scaladsl.ScalaMarshallersCodeGenerator,
akka.grpc.gen.scaladsl.play.PlayScalaClientCodeGenerator,
akka.grpc.gen.scaladsl.play.PlayScalaServerCodeGenerator,
),
)
.enablePlugins(build.play.grpc.NoPublish)
.pluginTestingSettings
lazy val playInteropTestJava = Project(
id = "play-grpc-interop-test-java",
base = file("play-interop-test-java"),
).dependsOn(playSpecs2 % Test, playScalaTest % Test)
.settings(Dependencies.playInteropTestJava)
.settings(
akkaGrpcExtraGenerators ++= List(
akka.grpc.gen.javadsl.play.PlayJavaClientCodeGenerator,
akka.grpc.gen.javadsl.play.PlayJavaServerCodeGenerator,
),
)
.enablePlugins(build.play.grpc.NoPublish)
.pluginTestingSettings
lazy val docs = Project(
id = "play-grpc-docs",
base = file("docs"),
)
// Make sure code generation is ran:
.enablePlugins(AkkaParadoxPlugin)
.enablePlugins(build.play.grpc.NoPublish)
.settings(
// Make sure code generation is ran before paradox:
(Compile / paradox) := (Compile / paradox).dependsOn(Compile / compile).value,
paradoxGroups := Map(
"Language" -> Seq("Scala", "Java"),
"Buildtool" -> Seq("sbt", "Gradle", "Maven"),
),
paradoxProperties ++= Map(
"grpc.version" → Dependencies.Versions.grpc,
),
resolvers += Resolver.jcenterRepo,
)
cancelable in Global := true