From 94423be8f60a5f9e267623ac6e1e1482ac19dd5a Mon Sep 17 00:00:00 2001 From: Adam Hudspith Date: Wed, 25 Sep 2024 14:12:13 +0100 Subject: [PATCH 1/7] Bump up dependency versions to upgrade to Scala Native 0.5.5 and align with zio 2.1.9 --- .github/workflows/ci.yml | 2 +- build.sbt | 8 ++++---- project/BuildHelper.scala | 15 ++++++--------- project/build.properties | 2 +- project/plugins.sbt | 32 ++++++++++++++++---------------- 5 files changed, 28 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18d40db..c1b2ec7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,7 +56,7 @@ jobs: fail-fast: false matrix: java: ['8', '11', '17'] - scala: ['2.12.17', '2.13.10', '3.3.1'] + scala: ['2.12.19', '2.13.14', '3.3.3'] platform: ['JVM', 'JS', 'Native'] steps: - name: Checkout current branch diff --git a/build.sbt b/build.sbt index f75fef8..0a4ceac 100644 --- a/build.sbt +++ b/build.sbt @@ -37,10 +37,10 @@ addCommandAlias( ) addCommandAlias( "testNative", - ";mockNative/compile" + ";mockNative/test" ) -val zioVersion = "2.0.19" +val zioVersion = "2.1.9" lazy val root = (project in file(".")) .aggregate( @@ -94,9 +94,9 @@ lazy val mockJS = mock.js lazy val mockNative = mock.native .settings(nativeSettings) - .settings(libraryDependencies += "org.ekrich" %%% "sjavatime" % "1.1.9") + .settings(dottySettings) -lazy val mockTests = crossProject(JSPlatform, JVMPlatform) +lazy val mockTests = crossProject(JSPlatform, JVMPlatform, NativePlatform) .in(file("mock-tests")) .dependsOn(mock) .settings( diff --git a/project/BuildHelper.scala b/project/BuildHelper.scala index bb7f9d2..ad3ecf2 100644 --- a/project/BuildHelper.scala +++ b/project/BuildHelper.scala @@ -24,8 +24,8 @@ object BuildHelper { val Scala213: String = versions("2.13") val Scala3: String = versions("3.3") - val SilencerVersion = "1.7.12" - val SjsJavaTimeVersion = "2.3.0" + val SilencerVersion = "1.7.17" + val ScalaJavaTimeVersion = "2.6.0" private val stdOptions = Seq( "-deprecation", @@ -66,7 +66,6 @@ object BuildHelper { ) val dottySettings = Seq( - crossScalaVersions += Scala3, scalacOptions ++= { if (scalaVersion.value == Scala3) Seq("-noindent", "-Xcheck-macros") @@ -266,8 +265,8 @@ object BuildHelper { ) def jsSettings = Seq( - libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % SjsJavaTimeVersion, - libraryDependencies += "io.github.cquiroz" %%% "scala-java-time-tzdb" % SjsJavaTimeVersion, + libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % ScalaJavaTimeVersion, + libraryDependencies += "io.github.cquiroz" %%% "scala-java-time-tzdb" % ScalaJavaTimeVersion, libraryDependencies += ("org.scala-js" %%% "scalajs-java-securerandom" % "1.0.0").cross(CrossVersion.for3Use2_13), scalacOptions ++= { if (scalaVersion.value == Scala3) Seq("-scalajs") @@ -276,10 +275,8 @@ object BuildHelper { ) def nativeSettings = Seq( - Test / test := (Test / compile).value, - doc / skip := true, - Compile / doc / sources := Seq.empty, - crossScalaVersions -= Scala3 + libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % ScalaJavaTimeVersion, + libraryDependencies += "io.github.cquiroz" %%% "scala-java-time-tzdb" % ScalaJavaTimeVersion ) val scalaReflectTestSettings: List[Setting[_]] = List( diff --git a/project/build.properties b/project/build.properties index c8fcab5..ee4c672 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.6.2 +sbt.version=1.10.1 diff --git a/project/plugins.sbt b/project/plugins.sbt index 49e7033..ce0da01 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,21 +1,21 @@ -addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.4.12") -addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.4") -addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0") +addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.6.0") +addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.1") +addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.12.0") addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0") -addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10") -addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "0.2.16") -addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "3.0.0") -addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.0.1") -addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0") +addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") +addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "0.3.1") +addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "3.0.2") +addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.3") +addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0") 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.14.0") -addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.16") -addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.3.0") -addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0") +addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.5") +addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.5.4") +addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") addSbtPlugin("pl.project13.scala" % "sbt-jcstress" % "0.2.0") -addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.3") -addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.1") -addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.3.4") +addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7") +addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4") +addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.3.9") -libraryDependencies += "org.snakeyaml" % "snakeyaml-engine" % "2.3" +libraryDependencies += "org.snakeyaml" % "snakeyaml-engine" % "2.7" From 1ab72c7698cf141aceae7f9d762b244f80980448 Mon Sep 17 00:00:00 2001 From: Adam Hudspith Date: Wed, 2 Oct 2024 11:48:50 +0100 Subject: [PATCH 2/7] Fix some linting, formatting and unused import --- README.md | 4 ++-- build.sbt | 2 +- mock/shared/src/main/scala/zio/mock/Expectation.scala | 2 +- project/BuildHelper.scala | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d574c09..b8bfcf4 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,14 @@ # ZIO Mock -[![Development](https://img.shields.io/badge/Project%20Stage-Development-green.svg)](https://github.com/zio/zio/wiki/Project-Stages) ![CI Badge](https://github.com/zio/zio-mock/workflows/CI/badge.svg) [![Sonatype Releases](https://img.shields.io/nexus/r/https/oss.sonatype.org/dev.zio/zio-mock_2.13.svg?label=Sonatype%20Release)](https://oss.sonatype.org/content/repositories/releases/dev/zio/zio-mock_2.13/) [![Sonatype Snapshots](https://img.shields.io/nexus/s/https/oss.sonatype.org/dev.zio/zio-mock_2.13.svg?label=Sonatype%20Snapshot)](https://oss.sonatype.org/content/repositories/snapshots/dev/zio/zio-mock_2.13/) [![javadoc](https://javadoc.io/badge2/dev.zio/zio-mock-docs_2.13/javadoc.svg)](https://javadoc.io/doc/dev.zio/zio-mock-docs_2.13) [![ZIO Mock](https://img.shields.io/github/stars/zio/zio-mock?style=social)](https://github.com/zio/zio-mock) +[![Development](https://img.shields.io/badge/Project%20Stage-Development-green.svg)](https://github.com/zio/zio/wiki/Project-Stages) ![CI Badge](https://github.com/zio/zio-mock/workflows/CI/badge.svg) [![Sonatype Snapshots](https://img.shields.io/nexus/s/https/oss.sonatype.org/dev.zio/zio-mock_2.13.svg?label=Sonatype%20Snapshot)](https://oss.sonatype.org/content/repositories/snapshots/dev/zio/zio-mock_2.13/) [![ZIO Mock](https://img.shields.io/github/stars/zio/zio-mock?style=social)](https://github.com/zio/zio-mock) ## Installation In order to use this library, we need to add the following line in our `build.sbt` file: ```scala -libraryDependencies += "dev.zio" %% "zio-mock" % "1.0.0-RC12" +libraryDependencies += "dev.zio" %% "zio-mock" % "1.0.0-RC13" ``` ## The Problem diff --git a/build.sbt b/build.sbt index 0a4ceac..3781e2e 100644 --- a/build.sbt +++ b/build.sbt @@ -78,7 +78,7 @@ lazy val mock = crossProject(JSPlatform, JVMPlatform, NativePlatform) if (scalaVersion.value == Scala3) Seq.empty else - Seq("-P:silencer:globalFilters=[zio.stacktracer.TracingImplicits.disableAutoTrace]") + Seq("-Wconf:msg=[zio.stacktracer.TracingImplicits.disableAutoTrace]:silent") } ) .enablePlugins(BuildInfoPlugin) diff --git a/mock/shared/src/main/scala/zio/mock/Expectation.scala b/mock/shared/src/main/scala/zio/mock/Expectation.scala index c72e795..a10e2a0 100644 --- a/mock/shared/src/main/scala/zio/mock/Expectation.scala +++ b/mock/shared/src/main/scala/zio/mock/Expectation.scala @@ -18,7 +18,7 @@ package zio.mock import zio.mock.Expectation.{And, Chain, Exactly, Or, Repeated} import zio.mock.Result.{Fail, Succeed} -import zio.mock.internal.{ExpectationState, MockException, MockState, ProxyFactory} +import zio.mock.internal.{ExpectationState, MockState, ProxyFactory} import zio.stacktracer.TracingImplicits.disableAutoTrace import zio.test.Assertion import zio.{EnvironmentTag, IO, Trace, ULayer, URLayer, ZIO, ZLayer} diff --git a/project/BuildHelper.scala b/project/BuildHelper.scala index ad3ecf2..53d7e65 100644 --- a/project/BuildHelper.scala +++ b/project/BuildHelper.scala @@ -24,7 +24,7 @@ object BuildHelper { val Scala213: String = versions("2.13") val Scala3: String = versions("3.3") - val SilencerVersion = "1.7.17" + val SilencerVersion = "1.7.17" val ScalaJavaTimeVersion = "2.6.0" private val stdOptions = Seq( From ac5290c3647fee8de1391393a2ac74ca1f447306 Mon Sep 17 00:00:00 2001 From: Adam Hudspith Date: Wed, 2 Oct 2024 11:52:36 +0100 Subject: [PATCH 3/7] Run sbt docs/generateReadme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b8bfcf4..21f2268 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ In order to use this library, we need to add the following line in our `build.sbt` file: ```scala -libraryDependencies += "dev.zio" %% "zio-mock" % "1.0.0-RC13" +libraryDependencies += "dev.zio" %% "zio-mock" % "" ``` ## The Problem From 673726975026303d689820b5a1cc16b1077c0da9 Mon Sep 17 00:00:00 2001 From: Adam Hudspith Date: Wed, 2 Oct 2024 12:11:20 +0100 Subject: [PATCH 4/7] Remove JDK 8 and include JDK 21 in testing matrix --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1b2ec7..fed5e8c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,7 +55,7 @@ jobs: strategy: fail-fast: false matrix: - java: ['8', '11', '17'] + java: ['11', '17', '21'] scala: ['2.12.19', '2.13.14', '3.3.3'] platform: ['JVM', 'JS', 'Native'] steps: From 7c44e073c1b5590093be3aa647388a85a05f9395 Mon Sep 17 00:00:00 2001 From: Adam Hudspith Date: Wed, 2 Oct 2024 12:18:27 +0100 Subject: [PATCH 5/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 21f2268..b8bfcf4 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ In order to use this library, we need to add the following line in our `build.sbt` file: ```scala -libraryDependencies += "dev.zio" %% "zio-mock" % "" +libraryDependencies += "dev.zio" %% "zio-mock" % "1.0.0-RC13" ``` ## The Problem From 4b2a0d6595a16067743ba04967352b91f01ee4e7 Mon Sep 17 00:00:00 2001 From: Adam Hudspith Date: Wed, 2 Oct 2024 14:04:02 +0100 Subject: [PATCH 6/7] Update README.md and site.yml --- .github/workflows/site.yml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/site.yml b/.github/workflows/site.yml index 3550fbe..a9e071b 100644 --- a/.github/workflows/site.yml +++ b/.github/workflows/site.yml @@ -62,7 +62,7 @@ jobs: generate-readme: name: Generate README runs-on: ubuntu-latest - if: ${{ (github.event_name == 'push') || ((github.event_name == 'release') && (github.event_name == 'published')) }} + if: ${{ (github.event_name == 'push') || ((github.event_name == 'release') && (github.event.action == 'published')) }} steps: - name: Git Checkout uses: actions/checkout@v3.3.0 diff --git a/README.md b/README.md index b8bfcf4..21f2268 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ In order to use this library, we need to add the following line in our `build.sbt` file: ```scala -libraryDependencies += "dev.zio" %% "zio-mock" % "1.0.0-RC13" +libraryDependencies += "dev.zio" %% "zio-mock" % "" ``` ## The Problem From 9d889436d758e2119315eb619490268dbbe06191 Mon Sep 17 00:00:00 2001 From: Adam Hudspith Date: Wed, 2 Oct 2024 14:58:17 +0100 Subject: [PATCH 7/7] Update README.md version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 21f2268..b8bfcf4 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ In order to use this library, we need to add the following line in our `build.sbt` file: ```scala -libraryDependencies += "dev.zio" %% "zio-mock" % "" +libraryDependencies += "dev.zio" %% "zio-mock" % "1.0.0-RC13" ``` ## The Problem