From 83fd34ea4d0566535c80671dbdc5301fbc90a1ac Mon Sep 17 00:00:00 2001 From: Erlend Hamnaberg Date: Tue, 24 Sep 2024 13:55:19 +0200 Subject: [PATCH 1/3] Add build for scala-native 0.5 --- .github/workflows/ci.yml | 32 +++++++++++++++++++++++++++++--- build.sbt | 2 +- project/plugins.sbt | 1 + 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9d0b928..4326ed20 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,12 +30,14 @@ jobs: os: [ubuntu-latest] scala: [2.13, 3] java: [temurin@11, temurin@17] - project: [rootJS, rootJVM] + project: [rootJS, rootJVM, rootNative] exclude: - scala: 3 java: temurin@17 - project: rootJS java: temurin@17 + - project: rootNative + java: temurin@17 runs-on: ${{ matrix.os }} timeout-minutes: 60 steps: @@ -89,6 +91,10 @@ jobs: if: matrix.project == 'rootJS' run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' Test/scalaJSLinkerResult + - name: nativeLink + if: matrix.project == 'rootNative' + run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' Test/nativeLink + - name: Test run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' test @@ -102,11 +108,11 @@ jobs: - name: Make target directories if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') - run: mkdir -p optics/.jvm/target optics/.js/target project/target + run: mkdir -p optics/.native/target optics/.jvm/target optics/.js/target project/target - name: Compress target directories if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') - run: tar cf targets.tar optics/.jvm/target optics/.js/target project/target + run: tar cf targets.tar optics/.native/target optics/.jvm/target optics/.js/target project/target - name: Upload target directories if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') @@ -180,6 +186,16 @@ jobs: tar xf targets.tar rm targets.tar + - name: Download target directories (2.13, rootNative) + uses: actions/download-artifact@v4 + with: + name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootNative + + - name: Inflate target directories (2.13, rootNative) + run: | + tar xf targets.tar + rm targets.tar + - name: Download target directories (3, rootJS) uses: actions/download-artifact@v4 with: @@ -200,6 +216,16 @@ jobs: tar xf targets.tar rm targets.tar + - name: Download target directories (3, rootNative) + uses: actions/download-artifact@v4 + with: + name: target-${{ matrix.os }}-${{ matrix.java }}-3-rootNative + + - name: Inflate target directories (3, rootNative) + run: | + tar xf targets.tar + rm targets.tar + - name: Import signing key if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == '' env: diff --git a/build.sbt b/build.sbt index f133172d..f1b140ab 100644 --- a/build.sbt +++ b/build.sbt @@ -21,7 +21,7 @@ val semVerRegex = """(\d+\.\d+\.)(\d+)(?:-SNAPSHOT)?""".r lazy val root = tlCrossRootProject.aggregate(optics) -lazy val optics = crossProject(JVMPlatform, JSPlatform) +lazy val optics = crossProject(JVMPlatform, JSPlatform, NativePlatform) .withoutSuffixFor(JVMPlatform) .crossType(CrossType.Pure) .in(file("optics")) diff --git a/project/plugins.sbt b/project/plugins.sbt index 5e48a521..d33fa6b3 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,2 +1,3 @@ addSbtPlugin("io.circe" % "sbt-circe-org" % "0.4.2") addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0") +addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.5") From 608c936ac7221390c9459a79fdcc341a9827400c Mon Sep 17 00:00:00 2001 From: Erlend Hamnaberg Date: Tue, 24 Sep 2024 14:07:46 +0200 Subject: [PATCH 2/3] Set mima target --- build.sbt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.sbt b/build.sbt index f1b140ab..4c1919b0 100644 --- a/build.sbt +++ b/build.sbt @@ -39,6 +39,9 @@ lazy val optics = crossProject(JVMPlatform, JSPlatform, NativePlatform) "org.typelevel" %%% "discipline-scalatest" % Versions.discipline % Test ) ) + .nativeSettings( + tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "0.15.1").toMap + ) ThisBuild / developers := List( Developer("travisbrown", "Travis Brown", "travisrobertbrown@gmail.com", url("https://twitter.com/travisbrown")) From ae05f38ed9267734be46b4a0accb1f3229587416 Mon Sep 17 00:00:00 2001 From: Erlend Hamnaberg Date: Tue, 24 Sep 2024 14:09:53 +0200 Subject: [PATCH 3/3] Update readme --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e5cb4a98..c9d9d2d3 100644 --- a/README.md +++ b/README.md @@ -16,10 +16,10 @@ This library releases at a different cadence than [Circe], any apparent relation and circe-optics version numbers are a coincidence and NOT intentional. Please use the following table for determining capability with the corresponding [Circe] versions. -| Circe Optics Version | Circe | Monocle | Scala 2.12 | Scala 2.13 | Scala 3 | Scala JVM | Scala.JS | -|----------------------|--------|---------|------------|------------|---------|-----------|----------| -| 0.15.x | 0.14.x | 3.x | ❌ | ✅ | ✅ | ✅ | ✅ | -| 0.14.x | 0.14.x | 2.x | ✅ | ✅ | ❌ | ✅ | ✅ | +| Circe Optics Version | Circe | Monocle | Scala 2.12 | Scala 2.13 | Scala 3 | Scala JVM | Scala.JS | Scala Native | +|----------------------|--------|---------|------------|------------|---------|-----------|----------|--------------| +| 0.15.x | 0.14.x | 3.x | ❌ | ✅ | ✅ | ✅ | ✅ |✅ | +| 0.14.x | 0.14.x | 2.x | ✅ | ✅ | ❌ | ✅ | ✅ |❌ | ## Contributors and participation