From 6c74d84aba51a221508fe2214609b89c3659b191 Mon Sep 17 00:00:00 2001 From: xuwei-k <6b656e6a69@gmail.com> Date: Thu, 5 Oct 2023 11:42:27 +0900 Subject: [PATCH] add JDK 21 test --- .github/workflows/ci.yml | 20 ++++++++++++++++--- build.sbt | 2 +- project/build.properties | 2 +- project/dependencies.scala | 6 ++++-- .../sbt-test/sbt-scalaxb/address/build.sbt | 5 +++-- .../src/sbt-test/sbt-scalaxb/soap/build.sbt | 2 +- 6 files changed, 27 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94e8d5275..dbb89abb8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,10 @@ jobs: include: - os: ubuntu-latest java: 8 + distribution: 'temurin' + - os: ubuntu-latest + java: 21 + distribution: 'corretto' runs-on: ${{ matrix.os }} env: # define Java options for both official sbt and sbt-extras @@ -21,10 +25,20 @@ jobs: - name: Setup JVM uses: actions/setup-java@v3 with: - distribution: 'temurin' + distribution: ${{ matrix.distribution }} java-version: ${{ matrix.java }} cache: 'sbt' - name: Build and test run: | - sbt -v ++2.12.17! "scalaxbPlugin/scripted" - sbt -v +integration/test + case ${{ matrix.java }} in + "8") + sbt -v ++2.12.x "scalaxbPlugin/scripted" + sbt -v +integration/test + ;; + "21") + sbt -v ++2.12.x "project scalaxbPlugin" "set pluginCrossBuild / sbtVersion := sbtVersion.value" "scripted" + ;; + *) + echo "unexpected java version" + exit 1 + esac diff --git a/build.sbt b/build.sbt index da78c3c49..e2ae3ef2d 100644 --- a/build.sbt +++ b/build.sbt @@ -99,7 +99,7 @@ lazy val scalaxbPlugin = (project in file("sbt-scalaxb")) } } scriptedLaunchOpts := { scriptedLaunchOpts.value ++ - Seq("-Xmx1024M", "-XX:MaxPermSize=256M", "-Dplugin.version=" + version.value) + Seq("-Xmx1024M", "-Dplugin.version=" + version.value) } scriptedBufferLog := false scripted := scripted.dependsOn(app / publishLocal).evaluated diff --git a/project/build.properties b/project/build.properties index 46e43a97e..27430827b 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.8.2 +sbt.version=1.9.6 diff --git a/project/dependencies.scala b/project/dependencies.scala index 095f09020..c65a9177e 100644 --- a/project/dependencies.scala +++ b/project/dependencies.scala @@ -1,11 +1,12 @@ import sbt._ object Dependencies { - val scala213 = "2.13.10" - val scala212 = "2.12.17" + val scala213 = "2.13.12" + val scala212 = "2.12.18" val scala211 = "2.11.12" val scala210 = "2.10.7" + val jaxb = "javax.xml.bind" % "jaxb-api" % "2.3.1" val scopt = "com.github.scopt" %% "scopt" % "3.7.1" val log4j = "log4j" % "log4j" % "1.2.17" val defaultDispatchVersion = "1.0.1" @@ -61,6 +62,7 @@ object Dependencies { def appDependencies(sv: String) = Seq( launcherInterface % "provided", + jaxb % "provided", scopt, log4j ) ++ (sv match { diff --git a/sbt-scalaxb/src/sbt-test/sbt-scalaxb/address/build.sbt b/sbt-scalaxb/src/sbt-test/sbt-scalaxb/address/build.sbt index eee10e568..2bc95e4e1 100644 --- a/sbt-scalaxb/src/sbt-test/sbt-scalaxb/address/build.sbt +++ b/sbt-scalaxb/src/sbt-test/sbt-scalaxb/address/build.sbt @@ -1,12 +1,13 @@ val scalaXml = "org.scala-lang.modules" %% "scala-xml" % "1.1.1" val scalaParser = "org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.1" +val jaxbApi = "javax.xml.bind" % "jaxb-api" % "2.3.1" lazy val root = (project in file(".")). enablePlugins(ScalaxbPlugin). settings( - scalaVersion := "2.12.8", + scalaVersion := "2.12.18", name := "mavenxsd", scalaxbAutoPackages in (Compile, scalaxb) := true, scalaxbGenerateMutable in (Compile, scalaxb) := true, - libraryDependencies ++= Seq(scalaXml, scalaParser) + libraryDependencies ++= Seq(scalaXml, scalaParser, jaxbApi) ) diff --git a/sbt-scalaxb/src/sbt-test/sbt-scalaxb/soap/build.sbt b/sbt-scalaxb/src/sbt-test/sbt-scalaxb/soap/build.sbt index 77d4dc6ae..3d130700b 100644 --- a/sbt-scalaxb/src/sbt-test/sbt-scalaxb/soap/build.sbt +++ b/sbt-scalaxb/src/sbt-test/sbt-scalaxb/soap/build.sbt @@ -6,7 +6,7 @@ lazy val emberClient= "org.http4s" %% "http4s-ember-client" % http4sVersion organization in ThisBuild := "com.example" version in ThisBuild := "0.1.0-SNAPSHOT" -scalaVersion in ThisBuild := "2.13.10" +scalaVersion in ThisBuild := "2.13.12" scalaxbPackageName in ThisBuild := "generated" scalaxbGenerateDispatchClient in ThisBuild := false scalaxbGenerateHttp4sClient in ThisBuild := true