From 154f6b1242040270caac3834cbf47ad1fb0efc69 Mon Sep 17 00:00:00 2001 From: Nabil Abdel-Hafeez <7283535+987Nabil@users.noreply.github.com> Date: Tue, 13 Aug 2024 14:26:58 +0200 Subject: [PATCH] Update dependencies (#1142) * Update dependencies * Update workflow * Mark macro test flaky * Downgrade Scala native to fix tests * Upgrade Scala native * Disable native multi threading * Disable native multi threading --- .github/workflows/ci.yml | 6 ++-- build.sbt | 34 ++++++++++--------- project/BuildHelper.scala | 11 +++--- project/plugins.sbt | 7 ++-- .../src/test/scala/zio/json/DeriveSpec.scala | 2 +- 5 files changed, 33 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2bfc67ef..ee02a60b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: uses: actions/setup-java@v4.2.1 with: distribution: temurin - java-version: 11 + java-version: 21 check-latest: true - name: Cache scala dependencies uses: coursier/cache-action@v6 @@ -37,7 +37,7 @@ jobs: strategy: fail-fast: false matrix: - java: ['11', '17'] + java: ['17', '21'] scala: ['2.13.13'] steps: - name: Checkout current branch @@ -78,7 +78,7 @@ jobs: strategy: fail-fast: false matrix: - java: ['11', '17'] + java: ['17', '21'] scala: ['2.12.19', '2.13.13', '3.3.3'] platform: ['JVM', 'JS', 'Native'] steps: diff --git a/build.sbt b/build.sbt index 08edd179..d8afc9e9 100644 --- a/build.sbt +++ b/build.sbt @@ -55,7 +55,7 @@ addCommandAlias( "zioJsonNative/test; zioJsonInteropScalaz7xNative/test" ) -val zioVersion = "2.0.21" +val zioVersion = "2.1.7" lazy val zioJsonRoot = project .in(file(".")) @@ -82,7 +82,7 @@ lazy val zioJsonRoot = project zioJsonGolden ) -val circeVersion = "0.14.3" +val circeVersion = "0.14.9" lazy val zioJson = crossProject(JSPlatform, JVMPlatform, NativePlatform) .in(file("zio-json")) @@ -105,7 +105,7 @@ lazy val zioJson = crossProject(JSPlatform, JVMPlatform, NativePlatform) libraryDependencies ++= Seq( "dev.zio" %%% "zio" % zioVersion, "dev.zio" %%% "zio-streams" % zioVersion, - "org.scala-lang.modules" %%% "scala-collection-compat" % "2.9.0", + "org.scala-lang.modules" %%% "scala-collection-compat" % "2.12.0", "dev.zio" %%% "zio-test" % zioVersion % "test", "dev.zio" %%% "zio-test-sbt" % zioVersion % "test", "io.circe" %%% "circe-core" % circeVersion % "test", @@ -117,16 +117,16 @@ lazy val zioJson = crossProject(JSPlatform, JVMPlatform, NativePlatform) CrossVersion.partialVersion(scalaVersion.value) match { case Some((3, _)) => Vector( - "com.softwaremill.magnolia1_3" %%% "magnolia" % "1.3.0" + "com.softwaremill.magnolia1_3" %%% "magnolia" % "1.3.7" ) case _ => Vector( "org.scala-lang" % "scala-reflect" % scalaVersion.value % Provided, - "com.softwaremill.magnolia1_2" %%% "magnolia" % "1.1.8", - "io.circe" %%% "circe-generic-extras" % circeVersion % "test", - "com.github.plokhotnyuk.jsoniter-scala" %%% "jsoniter-scala-core" % "2.23.3" % "test", - "com.github.plokhotnyuk.jsoniter-scala" %%% "jsoniter-scala-macros" % "2.23.3" % "test" + "com.softwaremill.magnolia1_2" %%% "magnolia" % "1.1.10", + "io.circe" %%% "circe-generic-extras" % "0.14.4" % "test", + "com.github.plokhotnyuk.jsoniter-scala" %%% "jsoniter-scala-core" % "2.30.7" % "test", + "com.github.plokhotnyuk.jsoniter-scala" %%% "jsoniter-scala-macros" % "2.30.7" % "test" ) } }, @@ -218,8 +218,8 @@ lazy val zioJson = crossProject(JSPlatform, JVMPlatform, NativePlatform) .settings(testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework")) .jsSettings( libraryDependencies ++= Seq( - "io.github.cquiroz" %%% "scala-java-time" % "2.5.0", - "io.github.cquiroz" %%% "scala-java-time-tzdb" % "2.6.0" + "io.github.cquiroz" %%% "scala-java-time" % scalaJavaTimeVersion, + "io.github.cquiroz" %%% "scala-java-time-tzdb" % scalaJavaTimeVersion ) ) .jvmSettings( @@ -253,8 +253,9 @@ lazy val zioJson = crossProject(JSPlatform, JVMPlatform, NativePlatform) .nativeSettings(Test / fork := false) .nativeSettings( libraryDependencies ++= Seq( - "io.github.cquiroz" %%% "scala-java-time" % "2.5.0" - ) + "io.github.cquiroz" %%% "scala-java-time" % scalaJavaTimeVersion + ), + nativeConfig ~= { _.withMultithreading(false) } ) .enablePlugins(BuildInfoPlugin) @@ -313,7 +314,8 @@ lazy val zioJsonMacros = crossProject(JSPlatform, JVMPlatform, NativePlatform) "dev.zio" %%% "zio-test" % zioVersion % "test", "dev.zio" %%% "zio-test-sbt" % zioVersion % "test" ), - testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework") + testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework"), + nativeConfig ~= { _.withMultithreading(false) } ) .nativeSettings(Test / fork := false) @@ -333,7 +335,7 @@ lazy val zioJsonInteropHttp4s = project "org.http4s" %% "http4s-dsl" % "0.23.26", "dev.zio" %% "zio" % zioVersion, "org.typelevel" %% "cats-effect" % "3.4.9", - "dev.zio" %% "zio-interop-cats" % "23.0.03" % "test", + "dev.zio" %% "zio-interop-cats" % "23.1.0.3" % "test", "dev.zio" %% "zio-test" % zioVersion % "test", "dev.zio" %% "zio-test-sbt" % zioVersion % "test" ), @@ -349,7 +351,7 @@ lazy val zioJsonInteropRefined = crossProject(JSPlatform, JVMPlatform, NativePla .settings(buildInfoSettings("zio.json.interop.refined")) .settings( libraryDependencies ++= Seq( - "eu.timepit" %%% "refined" % "0.10.2", + "eu.timepit" %%% "refined" % "0.11.2", "dev.zio" %%% "zio-test" % zioVersion % "test", "dev.zio" %%% "zio-test-sbt" % zioVersion % "test" ), @@ -365,7 +367,7 @@ lazy val zioJsonInteropScalaz7x = crossProject(JSPlatform, JVMPlatform, NativePl .settings( crossScalaVersions -= ScalaDotty, libraryDependencies ++= Seq( - "org.scalaz" %%% "scalaz-core" % "7.3.7", + "org.scalaz" %%% "scalaz-core" % "7.3.8", "dev.zio" %%% "zio-test" % zioVersion % "test", "dev.zio" %%% "zio-test-sbt" % zioVersion % "test" ), diff --git a/project/BuildHelper.scala b/project/BuildHelper.scala index 9fb86145..abc9e828 100644 --- a/project/BuildHelper.scala +++ b/project/BuildHelper.scala @@ -264,10 +264,13 @@ object BuildHelper { } ) - def jsSettings = Seq( - libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % "2.2.2", - libraryDependencies += "io.github.cquiroz" %%% "scala-java-time-tzdb" % "2.2.2" - ) + val scalaJavaTimeVersion = "2.6.0" + + def jsSettings = + Seq( + libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % scalaJavaTimeVersion, + libraryDependencies += "io.github.cquiroz" %%% "scala-java-time-tzdb" % scalaJavaTimeVersion + ) def nativeSettings = Seq( Test / skip := true, diff --git a/project/plugins.sbt b/project/plugins.sbt index a6835610..e62b4e07 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -3,13 +3,14 @@ addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.11") addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "0.3.1") addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.1") addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0") -addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.1") -addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.1") +addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2") +addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2") addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0") -addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.17") +addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.4") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0") addSbtPlugin("pl.project13.scala" % "sbt-jcstress" % "0.2.0") addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.11") +addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.4.0-alpha.28") addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.4.0-alpha.27") libraryDependencies += "org.snakeyaml" % "snakeyaml-engine" % "2.7" diff --git a/zio-json-macros/shared/src/test/scala/zio/json/DeriveSpec.scala b/zio-json-macros/shared/src/test/scala/zio/json/DeriveSpec.scala index c88f87a1..fe1d9584 100644 --- a/zio-json-macros/shared/src/test/scala/zio/json/DeriveSpec.scala +++ b/zio-json-macros/shared/src/test/scala/zio/json/DeriveSpec.scala @@ -54,7 +54,7 @@ object DeriveSpec extends ZIOSpecDefault { assert("""{"hint":"Child1"}""".fromJson[Parent])(isLeft(equalTo("(invalid disambiguator)"))) && assert("""{"child1":{}}""".fromJson[Parent])(isLeft(equalTo("(missing hint 'hint')"))) } - ) + ) @@ TestAspect.flaky // flaky only for Scala Native ) object exampleproducts {