Skip to content

Commit

Permalink
Merge pull request #379 from circe/scalanative
Browse files Browse the repository at this point in the history
Add build for scala-native 0.5
  • Loading branch information
zarthross authored Oct 4, 2024
2 parents b32d98e + c14450e commit 6422e70
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 8 deletions.
32 changes: 29 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

Expand All @@ -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')
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand All @@ -39,6 +39,9 @@ lazy val optics = crossProject(JVMPlatform, JSPlatform)
"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", "[email protected]", url("https://twitter.com/travisbrown"))
Expand Down
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
addSbtPlugin("io.circe" % "sbt-circe-org" % "0.4.3")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.17.0")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.5")

0 comments on commit 6422e70

Please sign in to comment.