From 3d8f7a7c0e93b9fc99cf62a06b8f3b6fe2220b91 Mon Sep 17 00:00:00 2001 From: xuwei-k <6b656e6a69@gmail.com> Date: Sun, 30 Jun 2024 14:28:51 +0900 Subject: [PATCH] Update javacOptions. add JDK 21 CI --- .github/workflows/ci.yml | 12 ++++++++++-- build.sbt | 7 +------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 90554b8..d23a7c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: matrix: include: - java: 8 - - java: 11 + - java: 21 steps: - uses: actions/checkout@v4 - uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 @@ -20,4 +20,12 @@ jobs: java-version: ${{matrix.java}} distribution: adopt - uses: coursier/cache-action@v6 - - run: sbt -v "+ Test/compile" checkScalariform "+ test" + - run: | + set -eux + case "${{ matrix.java }}" in + 21) + sbt -v '++ 2.12.x' test '++ 2.13.x' test '++ 3.x' test + ;; + *) + sbt -v "+ Test/compile" checkScalariform "+ test" + esac diff --git a/build.sbt b/build.sbt index 894ba96..fb2acce 100644 --- a/build.sbt +++ b/build.sbt @@ -89,12 +89,7 @@ compile / javacOptions ++= { case Some((2, v)) if v <= 11 => Seq("-target", "6", "-source", "6") case _ => - if (scala.util.Properties.isJavaAtLeast("9")) { - // if Java9 - Nil - } else { - Seq("-target", "8") - } + Seq("-target", "8", "-source", "8") } }