Skip to content

Commit 8aea9e6

Browse files
committed
Set minJdkVersion to 11
1 parent 6269973 commit 8aea9e6

File tree

1 file changed

+24
-11
lines changed

1 file changed

+24
-11
lines changed

build.sbt

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ inThisBuild(
1717

1818
val scala213 = "2.13.16"
1919
val scala3 = "3.3.5"
20+
val jdkVersion = 11
2021
val allScalaVersions = List(scala213, scala3)
2122
val jvmScalaVersions = allScalaVersions
2223
val jsScalaVersions = allScalaVersions
@@ -34,16 +35,27 @@ val commonSettings = Seq(
3435
mimaPreviousArtifacts := Set(
3536
organization.value %%% name.value % "0.0.7"
3637
),
37-
scalacOptions += "-java-output-version:11"
38+
scalacOptions ++= {
39+
CrossVersion.partialVersion(scalaVersion.value) match {
40+
case Some((2, _)) => Seq(s"-target:jvm-$jdkVersion")
41+
case _ => Seq(s"-java-output-version:$jdkVersion")
42+
}
43+
}
44+
)
45+
46+
val commonJvmSettings = Seq(
47+
javacOptions ++= Seq("--release", jdkVersion.toString)
3848
)
3949

4050
val core = projectMatrix
4151
.in(file("modules") / "core")
4252
.jvmPlatform(
4353
jvmScalaVersions,
44-
Test / unmanagedSourceDirectories ++= Seq(
45-
(projectMatrixBaseDirectory.value / "src" / "test" / "scalajvm-native").getAbsoluteFile
46-
)
54+
Seq(
55+
Test / unmanagedSourceDirectories ++= Seq(
56+
(projectMatrixBaseDirectory.value / "src" / "test" / "scalajvm-native").getAbsoluteFile
57+
)
58+
) ++ commonJvmSettings
4759
)
4860
.jsPlatform(jsScalaVersions)
4961
.nativePlatform(
@@ -63,7 +75,7 @@ val core = projectMatrix
6375

6476
val fs2 = projectMatrix
6577
.in(file("modules") / "fs2")
66-
.jvmPlatform(jvmScalaVersions)
78+
.jvmPlatform(jvmScalaVersions, commonJvmSettings)
6779
.jsPlatform(jsScalaVersions)
6880
.nativePlatform(nativeScalaVersions)
6981
.disablePlugins(AssemblyPlugin)
@@ -83,6 +95,7 @@ val smithy = projectMatrix
8395
.enablePlugins(SmithyTraitCodegenPlugin)
8496
.settings(
8597
name := "jsonrpclib-smithy",
98+
commonJvmSettings
8699
)
87100

88101
lazy val buildTimeProtocolDependency =
@@ -103,7 +116,7 @@ lazy val buildTimeProtocolDependency =
103116

104117
val smithy4s = projectMatrix
105118
.in(file("modules") / "smithy4s")
106-
.jvmPlatform(jvmScalaVersions)
119+
.jvmPlatform(jvmScalaVersions, commonJvmSettings)
107120
.jsPlatform(jsScalaVersions)
108121
.nativePlatform(Seq(scala3))
109122
.disablePlugins(AssemblyPlugin)
@@ -122,7 +135,7 @@ val smithy4s = projectMatrix
122135

123136
val exampleServer = projectMatrix
124137
.in(file("modules") / "examples/server")
125-
.jvmPlatform(List(scala213))
138+
.jvmPlatform(List(scala213), commonJvmSettings)
126139
.dependsOn(fs2)
127140
.settings(
128141
commonSettings,
@@ -140,7 +153,7 @@ val exampleClient = projectMatrix
140153
Seq(
141154
fork := true,
142155
envVars += "SERVER_JAR" -> (exampleServer.jvm(scala213) / assembly).value.toString
143-
)
156+
) ++ commonJvmSettings
144157
)
145158
.disablePlugins(AssemblyPlugin)
146159
.dependsOn(fs2)
@@ -155,7 +168,7 @@ val exampleClient = projectMatrix
155168

156169
val exampleSmithyShared = projectMatrix
157170
.in(file("modules") / "examples/smithyShared")
158-
.jvmPlatform(List(scala213))
171+
.jvmPlatform(List(scala213), commonJvmSettings)
159172
.dependsOn(smithy4s)
160173
.enablePlugins(Smithy4sCodegenPlugin)
161174
.settings(
@@ -167,7 +180,7 @@ val exampleSmithyShared = projectMatrix
167180

168181
val exampleSmithyServer = projectMatrix
169182
.in(file("modules") / "examples/smithyServer")
170-
.jvmPlatform(List(scala213))
183+
.jvmPlatform(List(scala213), commonJvmSettings)
171184
.dependsOn(exampleSmithyShared)
172185
.settings(
173186
commonSettings,
@@ -191,7 +204,7 @@ val exampleSmithyClient = projectMatrix
191204
Seq(
192205
fork := true,
193206
envVars += "SERVER_JAR" -> (exampleSmithyServer.jvm(scala213) / assembly).value.toString
194-
)
207+
) ++ commonJvmSettings
195208
)
196209
.dependsOn(exampleSmithyShared)
197210
.settings(

0 commit comments

Comments
 (0)