forked from phiSgr/gatling-grpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
111 lines (102 loc) · 3.52 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
val commonSettings = Seq(
organization := "com.github.phisgr",
scalaVersion := "2.13.6",
crossPaths := false,
)
val gatlingVersion = "3.6.1"
val gatlingCore = "io.gatling" % "gatling-core" % gatlingVersion
val publishSettings = {
import xerial.sbt.Sonatype._
Seq(
publishTo := SonatypeKeys.sonatypePublishTo.value,
publishMavenStyle := true,
licenses := Seq("APL2" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt")),
sonatypeProjectHosting := Some(GitHubHosting("phiSgr", "gatling-grpc", "[email protected]")),
)
}
lazy val root = (project in file("."))
.enablePlugins(GatlingPlugin)
.settings(commonSettings: _*)
.settings(publishSettings: _*)
.settings(
name := "gatling-grpc",
version := "0.12.0",
inConfig(Test)(sbtprotoc.ProtocPlugin.protobufConfigSettings),
PB.targets in Test := Seq(
scalapb.gen() -> (sourceManaged in Test).value,
PB.gens.java -> (sourceManaged in Test).value,
),
scalacOptions ++= Seq(
"-language:existentials",
"-language:implicitConversions",
"-language:higherKinds",
"-Xlint",
"-opt:l:method",
),
libraryDependencies ++= Seq(
"io.grpc" % "grpc-netty" % scalapb.compiler.Version.grpcJavaVersion,
"com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % "protobuf",
"com.thesamet.scalapb" %% "scalapb-runtime-grpc" % scalapb.compiler.Version.scalapbVersion,
gatlingCore,
"com.github.phisgr" % "gatling-ext" % "0.2.0",
"io.gatling.highcharts" % "gatling-charts-highcharts" % gatlingVersion % "test",
"io.gatling" % "gatling-test-framework" % gatlingVersion % "test",
"org.scalatest" %% "scalatest" % "3.2.2" % "test",
),
)
.dependsOn(macroSub % "compile-internal")
lazy val macroSub = (project in file("macro"))
.settings(commonSettings: _*)
.settings(
name := "macro",
libraryDependencies ++= Seq(
gatlingCore,
),
scalacOptions ++= Seq(
"-language:experimental.macros",
),
)
// Usually the two update together (for specifying IntelliJ compatibility)
// but there is a slight API change this time
val gatlingJavaPbVersion = "1.1.1"
val gatlingJavaPbExtVersion = "1.1.0"
lazy val javaPb = (project in file("java-pb"))
.settings(commonSettings: _*)
.settings(publishSettings: _*)
.settings(
name := "gatling-javapb",
version := gatlingJavaPbVersion,
libraryDependencies ++= Seq(
"com.google.protobuf" % "protobuf-java" % "3.14.0",
gatlingCore,
),
scalacOptions ++= Seq(
"-language:implicitConversions",
"-language:experimental.macros",
),
)
.dependsOn(root % "test->test")
lazy val javaPbIjExt = (project in file("java-pb-intellij"))
.settings(commonSettings: _*)
.settings(publishSettings: _*)
.settings(
name := "gatling-javapb-ijext",
intellijPluginName in ThisBuild := "gatling-javapb-ijext",
// https://www.jetbrains.com/idea/download/other.html
intellijBuild in ThisBuild := "203.5981.155",
version := gatlingJavaPbExtVersion,
// https://plugins.jetbrains.com/plugin/1347-scala/versions/stable
intellijPlugins += "org.intellij.scala:2020.3.18".toPlugin,
)
.enablePlugins(SbtIdeaPlugin)
lazy val bench = (project in file("bench"))
.settings(commonSettings: _*)
.dependsOn(root, javaPb)
.enablePlugins(JmhPlugin)
.settings(
PB.targets in Compile := Seq(
PB.gens.java -> (sourceManaged in Compile).value,
scalapb.gen() -> (sourceManaged in Compile).value
),
)
.dependsOn(macroSub % "compile-internal")