This is an automated email from the ASF dual-hosted git repository.
fanningpj pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko.git
The following commit(s) were added to refs/heads/main by this push:
new 183fda795f refactor compiler options (#2253)
183fda795f is described below
commit 183fda795f5cefa69d0f4990aa449a4ba9708fd8
Author: PJ Fanning <[email protected]>
AuthorDate: Sun Sep 21 22:12:19 2025 +0100
refactor compiler options (#2253)
* refactor compiler options
* move jdk9 test into standard test source
* Fix scalacOptions flag from '--release' to '-release'
* whitespace
* unused import
* Update IterablePublisherViaJavaFlowPublisherTest.scala
* Update Jdk9.scala
---
project/Jdk9.scala | 5 ++---
project/JdkOptions.scala | 10 ++++++----
.../stream/tck/IterablePublisherViaJavaFlowPublisherTest.scala | 2 +-
3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/project/Jdk9.scala b/project/Jdk9.scala
index ac4d1871bb..12275d13bc 100644
--- a/project/Jdk9.scala
+++ b/project/Jdk9.scala
@@ -17,9 +17,8 @@ import sbt._
object Jdk9 extends AutoPlugin {
import JdkOptions.JavaVersion._
- // The version 17 is special for any Java versions >= 17
- // and the version 21 is special for any Java versions >= 21
- private val supportedJavaLTSVersions = List("17", "21")
+ // The version 21 is special for any Java versions >= 21
+ private val supportedJavaLTSVersions = List("21")
lazy val CompileJdk9 = config("CompileJdk9").extend(Compile)
diff --git a/project/JdkOptions.scala b/project/JdkOptions.scala
index 10bc38c945..d8f3a94b02 100644
--- a/project/JdkOptions.scala
+++ b/project/JdkOptions.scala
@@ -19,12 +19,12 @@ import sbt.librarymanagement.VersionNumber
object JdkOptions extends AutoPlugin {
- lazy val specificationVersion: String =
sys.props("java.specification.version")
-
object JavaVersion {
val majorVersion: Int = java.lang.Runtime.version().feature()
}
+ val targetJavaVersion = "17"
+
lazy val versionSpecificJavaOptions =
// for virtual threads
"--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED" ::
@@ -35,7 +35,9 @@ object JdkOptions extends AutoPlugin {
"--add-opens=java.base/java.nio=ALL-UNNAMED" :: Nil
def targetJdkScalacOptions(scalaVersion: String): Seq[String] =
- Seq(if (scalaVersion.startsWith("3.")) "-Xtarget:17" else "release:17")
+ Seq("-release", JdkOptions.targetJavaVersion) ++ {
+ if (scalaVersion.startsWith("3.")) Seq(s"-Xtarget:${targetJavaVersion}")
else Seq.empty
+ }
- val targetJdkJavacOptions = Seq("-source", "17", "-target", "17")
+ val targetJdkJavacOptions = Seq("--release", targetJavaVersion)
}
diff --git
a/stream-tests-tck/src/test/scala-jdk9-only/org/apache/pekko/stream/tck/IterablePublisherViaJavaFlowPublisherTest.scala
b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/IterablePublisherViaJavaFlowPublisherTest.scala
similarity index 94%
rename from
stream-tests-tck/src/test/scala-jdk9-only/org/apache/pekko/stream/tck/IterablePublisherViaJavaFlowPublisherTest.scala
rename to
stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/IterablePublisherViaJavaFlowPublisherTest.scala
index 079f7c1d3d..44706c2456 100644
---
a/stream-tests-tck/src/test/scala-jdk9-only/org/apache/pekko/stream/tck/IterablePublisherViaJavaFlowPublisherTest.scala
+++
b/stream-tests-tck/src/test/scala/org/apache/pekko/stream/tck/IterablePublisherViaJavaFlowPublisherTest.scala
@@ -17,7 +17,7 @@ import java.util.concurrent.{ Flow => JavaFlow }
import org.apache.pekko
import pekko.NotUsed
-import pekko.stream.scaladsl.{ Flow, JavaFlowSupport, Sink, Source }
+import pekko.stream.scaladsl.{ JavaFlowSupport, Sink, Source }
import org.reactivestreams._
class IterablePublisherViaJavaFlowPublisherTest extends
PekkoPublisherVerification[Int] {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]