-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sbt
80 lines (70 loc) · 2.57 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
import sbt.Keys._
import sbt._
import java.nio.file.Paths
ThisBuild / credentials += Credentials(
"GitHub Package Registry",
"maven.pkg.github.com",
"raw-labs",
sys.env.getOrElse("GITHUB_TOKEN", "")
)
lazy val commonSettings = Seq(
homepage := Some(url("https://www.raw-labs.com/")),
organization := "com.raw-labs",
organizationName := "RAW Labs SA",
organizationHomepage := Some(url("https://www.raw-labs.com/")),
// Use cached resolution of dependencies
// http://www.scala-sbt.org/0.13/docs/Cached-Resolution.html
updateOptions := updateOptions.in(Global).value.withCachedResolution(true),
resolvers += "RAW Labs GitHub Packages" at "https://maven.pkg.github.com/raw-labs/_"
)
lazy val buildSettings = Seq(
scalaVersion := "2.13.15",
// Also build against Scala 2.12
crossScalaVersions := Seq("2.12.18", "2.13.15")
)
lazy val compileSettings = Seq(
Compile / doc / sources := Seq.empty,
Compile / packageDoc / mappings := Seq(),
Compile / packageSrc / publishArtifact := true,
Compile / packageDoc / publishArtifact := false,
Compile / packageBin / packageOptions += Package.ManifestAttributes(
"Automatic-Module-Name" -> name.value.replace('-', '.')
)
)
lazy val testSettings = Seq(
// Ensuring tests are run in a forked JVM for isolation.
Test / fork := true,
// Required for publishing test artifacts.
Test / publishArtifact := true
)
val isCI = sys.env.getOrElse("CI", "false").toBoolean
lazy val publishSettings = Seq(
versionScheme := Some("early-semver"),
publish / skip := false,
publishMavenStyle := true,
publishTo := Some("GitHub raw-labs Apache Maven Packages" at "https://maven.pkg.github.com/raw-labs/protocol-das"),
publishConfiguration := publishConfiguration.value.withOverwrite(isCI)
)
lazy val strictBuildSettings = commonSettings ++ compileSettings ++ buildSettings ++ testSettings ++ Seq(
scalacOptions ++= Seq(
"-Xfatal-warnings"
)
)
lazy val root = (project in file("."))
.enablePlugins(ProtobufPlugin)
.settings(
name := "protocol-das",
strictBuildSettings,
publishSettings,
protobufGrpcEnabled := true,
// Set fixed versions
ProtobufConfig / version := "3.25.4",
ProtobufConfig / protobufGrpcVersion := "1.69.1",
libraryDependencies ++= Seq(
// Required for gRPC Protobuf
"javax.annotation" % "javax.annotation-api" % "1.3.2",
"io.grpc" % "grpc-netty" % (ProtobufConfig / protobufGrpcVersion).value,
"io.grpc" % "grpc-protobuf" % (ProtobufConfig / protobufGrpcVersion).value,
"io.grpc" % "grpc-stub" % (ProtobufConfig / protobufGrpcVersion).value
)
)