From 65b03e15fecd5717007505bd7ab45c75624d07df Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Thu, 14 Oct 2021 08:32:25 +0200 Subject: [PATCH 1/3] Update zio, zio-streams, zio-test, ... to 2.0.0-M4 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index e583811e..74e5a987 100644 --- a/build.sbt +++ b/build.sbt @@ -3,7 +3,7 @@ val scala213 = "2.13.6" val scala3 = "3.0.2" val zioVersion = "1.0.12" -val zio2Version = "2.0.0-M2+83-c286d83c-SNAPSHOT" +val zio2Version = "2.0.0-M4" val scalacOptions212 = Seq("-Ypartial-unification", "-deprecation", "-target:jvm-1.8") val scalacOptions213 = Seq("-deprecation", "-target:jvm-1.8") From b2f3246131dfdac472f69ae4689aea34b4147eb8 Mon Sep 17 00:00:00 2001 From: Daniel Vigovszky Date: Mon, 18 Oct 2021 13:05:07 +0200 Subject: [PATCH 2/3] Fix deprecation --- .../io/github/vigoo/prox/ProxZStream.scala | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/prox-zstream-2/src/main/scala/io/github/vigoo/prox/ProxZStream.scala b/prox-zstream-2/src/main/scala/io/github/vigoo/prox/ProxZStream.scala index 71aea99a..3dde7f25 100644 --- a/prox-zstream-2/src/main/scala/io/github/vigoo/prox/ProxZStream.scala +++ b/prox-zstream-2/src/main/scala/io/github/vigoo/prox/ProxZStream.scala @@ -119,20 +119,21 @@ trait ProxZStream extends Prox { } } - private final def flushingOutputStreamSink(managedOutput: ZManaged[Any, Nothing, io.OutputStream]): ZSink[Any, IOException, Byte, Byte, Long] = { - ZSink.managed(managedOutput) { os => - ZSink.foldLeftChunksZIO(0L) { (bytesWritten, byteChunk: Chunk[Byte]) => - ZIO.attemptBlockingInterrupt { - val bytes = byteChunk.toArray - os.write(bytes) - os.flush() - bytesWritten + bytes.length - }.refineOrDie { - case e: IOException => e + private final def flushingOutputStreamSink(managedOutput: ZManaged[Any, Nothing, io.OutputStream]): ZSink[Any, IOException, Byte, Byte, Long] = + ZSink.unwrapManaged { + managedOutput.map { os => + ZSink.foldLeftChunksZIO(0L) { (bytesWritten, byteChunk: Chunk[Byte]) => + ZIO.attemptBlockingInterrupt { + val bytes = byteChunk.toArray + os.write(bytes) + os.flush() + bytesWritten + bytes.length + }.refineOrDie { + case e: IOException => e + } } } } - } protected override final def startFiber[A](f: ProxIO[A]): ProxIO[ProxFiber[A]] = f.fork From 34facbff4308338406a9a89defa69d580892b338 Mon Sep 17 00:00:00 2001 From: Daniel Vigovszky Date: Mon, 18 Oct 2021 13:08:48 +0200 Subject: [PATCH 3/3] Fix scala version --- .github/workflows/ci.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a51bac11..74f93169 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - scala: ['2.12.13', '2.13.6', '3.0.0'] + scala: ['2.12.14', '2.13.6', '3.0.2'] steps: - name: Checkout uses: actions/checkout@v2 @@ -19,8 +19,8 @@ jobs: - name: Coursier cache uses: coursier/cache-action@v5 - name: Build and test - if: ${{ matrix.scala == '3.0.0' }} + if: ${{ matrix.scala == '3.0.2' }} run: sbt ++${{ matrix.scala }} clean test - name: Build and test - if: ${{ matrix.scala != '3.0.0' }} + if: ${{ matrix.scala != '3.0.2' }} run: sbt ++${{ matrix.scala }} clean coverage test coverageReport && bash <(curl -s https://codecov.io/bash)