-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.sbt
123 lines (114 loc) · 4.27 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
import sbtghactions.WorkflowStep.Use
lazy val commonSettings = Seq(
Compile / compile / javacOptions ++= Seq("-source", "1.8", "-target", "1.8"),
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, _)) =>
Seq(compilerPlugin(Dependencies.kindProjector), compilerPlugin(Dependencies.betterMonadicFor))
case _ => Seq.empty
}
},
scalacOptions += {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, _)) => "-Wconf:any:wv"
case _ => "-Wconf:any:v"
}
},
Test / fork := true,
resolvers ++= Resolver.sonatypeOssRepos("releases"),
)
lazy val noPublishSettings =
commonSettings ++ Seq(publish := {}, publishArtifact := false, publishTo := None, publish / skip := true)
lazy val publishSettings = commonSettings ++ Seq(
publishMavenStyle := true,
pomIncludeRepository := { _ =>
false
},
Test / publishArtifact := false
)
lazy val root = (project in file("."))
.settings(noPublishSettings)
.settings(name := "Trace4Cats OpenTelemetry")
.aggregate(
`opentelemetry-common`,
`opentelemetry-jaeger-exporter`,
`opentelemetry-otlp-grpc-exporter`,
`opentelemetry-otlp-http-exporter`,
`opentelemetry-otlp-http4s-grpc-exporter`
)
lazy val `opentelemetry-common` =
(project in file("modules/opentelemetry-common"))
.settings(publishSettings)
.settings(
name := "trace4cats-opentelemetry-common",
libraryDependencies ++= Seq(
Dependencies.openTelemetrySdk,
Dependencies.collectionCompat,
Dependencies.grpcApi,
Dependencies.grpcStub,
Dependencies.trace4catsCore,
Dependencies.autoValueAnnotation % Provided
)
)
lazy val `opentelemetry-jaeger-exporter` =
(project in file("modules/opentelemetry-jaeger-exporter"))
.settings(publishSettings)
.settings(
name := "trace4cats-opentelemetry-jaeger-exporter",
libraryDependencies ++= Seq(Dependencies.openTelemetryJaegerExporter),
libraryDependencies ++= Seq(Dependencies.grpcOkHttp, Dependencies.trace4catsJaegerIntegrationTest).map(_ % Test)
)
.dependsOn(`opentelemetry-common`)
lazy val `opentelemetry-otlp-grpc-exporter` =
(project in file("modules/opentelemetry-otlp-grpc-exporter"))
.settings(publishSettings)
.settings(
name := "trace4cats-opentelemetry-otlp-grpc-exporter",
libraryDependencies ++= Seq(Dependencies.openTelemetryOtlpExporter),
libraryDependencies ++= Seq(Dependencies.grpcOkHttp, Dependencies.trace4catsJaegerIntegrationTest).map(_ % Test)
)
.dependsOn(`opentelemetry-common`)
lazy val `opentelemetry-otlp-http-exporter` =
(project in file("modules/opentelemetry-otlp-http-exporter"))
.settings(publishSettings)
.settings(
name := "trace4cats-opentelemetry-otlp-http-exporter",
libraryDependencies ++= Seq(
Dependencies.circeGeneric,
Dependencies.http4sCirce,
Dependencies.trace4catsCore,
Dependencies.trace4catsExporterHttp
),
libraryDependencies ++= Seq(Dependencies.trace4catsJaegerIntegrationTest).map(_ % Test)
)
lazy val `opentelemetry-otlp-http4s-grpc-exporter` =
(project in file("modules/opentelemetry-otlp-http4s-grpc-exporter"))
.settings(publishSettings)
.settings(
crossScalaVersions := Seq(Dependencies.Versions.scala213, Dependencies.Versions.scala3),
name := "trace4cats-opentelemetry-otlp-http4s-grpc-exporter",
libraryDependencies ++= Seq(Dependencies.trace4catsCore),
Compile / PB.targets ++= Seq(scalapb.gen(grpc = false) -> (Compile / sourceManaged).value / "scalapb"),
scalacOptions += {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, _)) => "-Wconf:src=proto/.*:silent"
case _ => ""
}
},
scalacOptions -= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, _)) => ""
case _ => "-Wvalue-discard"
}
}
)
.enablePlugins(Http4sGrpcPlugin)
ThisBuild / githubWorkflowGeneratedCI ~= { jobs =>
jobs.map { job =>
job.copy(steps = job.steps.map {
case use @ Use(UseRef.Public("actions", "checkout", _), params, _, _, _, _) =>
use.copy(params = params + ("submodules" -> "true"))
case other => other
})
}
}