-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sbt
105 lines (97 loc) · 4.59 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
import Dependencies.Kalix
lazy val `akka-javasdk-root` = project
.in(file("."))
.aggregate(akkaJavaSdkAnnotationProcessor, akkaJavaSdk, akkaJavaSdkTestKit, akkaJavaSdkTests)
.settings(
(publish / skip) := true,
// https://github.com/sbt/sbt/issues/3465
// Libs and plugins must share a version. The root project must use that
// version (and set the crossScalaVersions as empty list) so each sub-project
// can then decide which scalaVersion and crossScalaVersions they use.
crossScalaVersions := Nil,
scalaVersion := Dependencies.ScalaVersion)
lazy val akkaJavaSdk =
Project(id = "akka-javasdk", base = file("akka-javasdk"))
.enablePlugins(AkkaGrpcPlugin, BuildInfoPlugin, Publish)
.disablePlugins(CiReleasePlugin) // we use publishSigned, but use a pgp utility from CiReleasePlugin
.settings(
name := "akka-javasdk",
crossPaths := false,
scalaVersion := Dependencies.ScalaVersion,
buildInfoKeys := Seq[BuildInfoKey](
name,
version,
"runtimeImage" -> Kalix.RuntimeImage,
"runtimeVersion" -> Kalix.RuntimeVersion,
"protocolMajorVersion" -> Kalix.ProtocolVersionMajor,
"protocolMinorVersion" -> Kalix.ProtocolVersionMinor,
"scalaVersion" -> scalaVersion.value,
"akkaVersion" -> Dependencies.AkkaVersion),
buildInfoPackage := "akka.javasdk",
Compile / akkaGrpcGeneratedSources := Seq(AkkaGrpc.Server),
Compile / akkaGrpcGeneratedLanguages := Seq(AkkaGrpc.Scala),
Compile / akkaGrpcGeneratedSources := Seq(AkkaGrpc.Server, AkkaGrpc.Client),
Compile / akkaGrpcGeneratedLanguages := Seq(AkkaGrpc.Scala),
Compile / PB.targets += PB.gens.java -> crossTarget.value / "akka-grpc" / "main",
Test / javacOptions ++= Seq("-parameters"), // for Jackson
Test / akkaGrpcGeneratedSources := Seq(AkkaGrpc.Client),
Test / PB.protoSources ++= (Compile / PB.protoSources).value,
Test / PB.targets += PB.gens.java -> crossTarget.value / "akka-grpc" / "test",
Test / envVars ++= Map("ENV" -> "value1", "ENV2" -> "value2"))
.settings(DocSettings.forModule("Akka SDK"))
.settings(Dependencies.javaSdk)
lazy val akkaJavaSdkTestKit =
Project(id = "akka-javasdk-testkit", base = file("akka-javasdk-testkit"))
.dependsOn(akkaJavaSdk)
.enablePlugins(AkkaGrpcPlugin, BuildInfoPlugin, Publish)
.disablePlugins(CiReleasePlugin) // we use publishSigned, but use a pgp utility from CiReleasePlugin
.settings(
name := "akka-javasdk-testkit",
crossPaths := false,
buildInfoKeys := Seq[BuildInfoKey](
name,
version,
"runtimeImage" -> Kalix.RuntimeImage,
"runtimeVersion" -> Kalix.RuntimeVersion,
"scalaVersion" -> scalaVersion.value),
buildInfoPackage := "akka.javasdk.testkit")
.settings(DocSettings.forModule("Akka SDK Testkit"))
.settings(Dependencies.javaSdkTestKit)
lazy val akkaJavaSdkTests =
Project(id = "akka-javasdk-tests", base = file("akka-javasdk-tests"))
.dependsOn(akkaJavaSdk, akkaJavaSdkTestKit)
.settings(
name := "akka-javasdk-testkit",
crossPaths := false,
Test / parallelExecution := false,
Test / fork := true,
// for Jackson
Test / javacOptions ++= Seq("-parameters"),
// only tests here
publish / skip := true,
doc / sources := Seq.empty)
.settings(inConfig(Test)(JupiterPlugin.scopedSettings))
.settings(Dependencies.tests)
lazy val samplesCompilationProject: CompositeProject =
SamplesCompilationProject.compilationProject { sampleProject =>
sampleProject
.dependsOn(akkaJavaSdk)
.dependsOn(akkaJavaSdkTestKit % "compile->test")
}
lazy val akkaJavaSdkAnnotationProcessor =
Project(id = "akka-javasdk-annotation-processor", base = file("akka-javasdk-annotation-processor"))
.enablePlugins(Publish)
.disablePlugins(CiReleasePlugin) // we use publishSigned, but use a pgp utility from CiReleasePlugin
.settings(name := "akka-javasdk-annotation-processor", crossPaths := false)
.settings(libraryDependencies += Dependencies.typesafeConfig)
lazy val annotationProcessorTestProject: CompositeProject =
AnnotationProcessorTestProject.compilationProject { sampleProject =>
sampleProject
.dependsOn(akkaJavaSdk)
.dependsOn(akkaJavaSdkAnnotationProcessor)
.settings(libraryDependencies += Dependencies.scalaTest % Test)
.settings(
libraryDependencies += Dependencies.scalaTest % Test,
Compile / javacOptions ++= Seq("-processor", "akka.javasdk.tooling.processor.ComponentAnnotationProcessor"))
}
addCommandAlias("formatAll", "scalafmtAll; javafmtAll")