-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
95 lines (87 loc) · 2.86 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
import sbtrelease.Version
import ReleaseTransformations._
ThisBuild / scalaVersion := "2.12.11"
ThisBuild / organization := "com.github.saint1991"
ThisBuild / description := "string rpc name based gRPC service invoker"
ThisBuild / scmInfo := Some(
ScmInfo(
url("https://github.com/saint1991/akka-grpc-invoker-codegen"),
"scm:[email protected]:saint1991:akka-grpc-invoker-codegen.git",
),
)
val akkaGrpcVersion = "0.8.4"
lazy val sonatypePassword = sys.env.get("SONATYPE_PASSWORD")
lazy val noPublishSettings = Seq(
publish := {},
publishLocal := {},
publishArtifact := false,
)
lazy val publishSettings = Seq(
publishArtifact := true,
Test / publishArtifact := true,
publishMavenStyle := true,
credentials ++= Seq(sonatypePassword match {
case None => Credentials(Path.userHome / ".sbt" / "sonatype")
case Some(password) => Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", "saint1991", password)
}),
licenses := Seq("MIT" -> url("https://opensource.org/licenses/MIT")),
pomIncludeRepository := { _ =>
false
},
publishTo in ThisBuild := Some(
if (version.value.trim.endsWith("SNAPSHOT") || isSnapshot.value) Opts.resolver.sonatypeSnapshots
else Opts.resolver.sonatypeStaging
),
pomExtra :=
<developers>
<developer>
<id>saint1991</id>
<name>Seiya Mizuno</name>
</developer>
</developers>
)
lazy val releaseSettings = Seq(
publishConfiguration := publishConfiguration.value.withOverwrite(true),
releaseCrossBuild := true,
releaseVersion := { ver =>
Version(ver).map(_.withoutQualifier.string).getOrElse(throw new IllegalArgumentException("Version format error"))
},
releaseNextVersion := { ver =>
Version(ver).map(_.bumpMinor.asSnapshot.string).getOrElse(throw new IllegalArgumentException("Version format error"))
},
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
publishArtifacts,
setNextVersion,
commitNextVersion,
pushChanges,
ReleaseStep(action = Command.process("sonatypeRelease", _))
),
)
lazy val runtime = (project in file("runtime"))
.settings(publishSettings)
.settings(releaseSettings)
.settings(
name := "akka-grpc-invoker-runtime",
crossScalaVersions := Seq("2.12.11", "2.13.1"),
libraryDependencies ++= Seq(
"com.lightbend.akka.grpc" %% "akka-grpc-runtime" % akkaGrpcVersion,
),
)
lazy val codegen = (project in file("codegen"))
.dependsOn(runtime % "compile->compile;test->test")
.enablePlugins(SbtTwirl)
.settings(publishSettings)
.settings(releaseSettings)
.settings(
name := "akka-grpc-invoker-codegen",
libraryDependencies ++= Seq(
"com.lightbend.akka.grpc" %% "akka-grpc-codegen" % akkaGrpcVersion,
),
)