Skip to content

Commit

Permalink
add ScalaJS support (which necessitates dropping Scala 2.12 support)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpholt committed Jul 16, 2024
1 parent 589056c commit 0fc1a2c
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 24 deletions.
16 changes: 3 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12, 2.13, 3]
scala: [2.13, 3]
java: [temurin@8]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
Expand Down Expand Up @@ -67,11 +67,11 @@ jobs:

- name: Make target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
run: mkdir -p target project/target
run: mkdir -p target jvm/target js/target project/target

- name: Compress target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
run: tar cf targets.tar target project/target
run: tar cf targets.tar target jvm/target js/target project/target

- name: Upload target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
Expand Down Expand Up @@ -108,16 +108,6 @@ jobs:
if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
run: sbt +update

- name: Download target directories (2.12)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12

- name: Inflate target directories (2.12)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.13)
uses: actions/download-artifact@v4
with:
Expand Down
1 change: 0 additions & 1 deletion .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ pull_request_rules:
- or:
- body~=labels:.*early-semver-patch
- body~=labels:.*early-semver-minor
- status-success=Build and Test (ubuntu-latest, 2.12, temurin@8)
- status-success=Build and Test (ubuntu-latest, 2.13, temurin@8)
- status-success=Build and Test (ubuntu-latest, 3, temurin@8)
actions:
Expand Down
26 changes: 16 additions & 10 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ThisBuild / organization := "com.dwolla"
ThisBuild / homepage := Option(url("https://github.com/Dwolla/natchez-smithy4s"))
ThisBuild / tlBaseVersion := "0.1"
ThisBuild / crossScalaVersions := Seq("2.12.19", "2.13.14", "3.3.3")
ThisBuild / githubWorkflowScalaVersions := Seq("2.12", "2.13", "3")
ThisBuild / crossScalaVersions := Seq("2.13.14", "3.3.3")
ThisBuild / githubWorkflowScalaVersions := Seq("2.13", "3")
ThisBuild / tlJdkRelease := Option(8)
ThisBuild / tlFatalWarnings := githubIsWorkflowBuild.value
ThisBuild / startYear := Option(2024)
Expand All @@ -22,17 +22,23 @@ ThisBuild / mergifyStewardConfig ~= { _.map {
.withMergeMinors(true)
}}

lazy val `natchez-smithy4s` = project
.in(file("."))
.enablePlugins(Smithy4sCodegenPlugin)
lazy val `natchez-smithy4s` = crossProject(JVMPlatform, JSPlatform)
.crossType(CrossType.Pure)
.in(file("core"))
.settings(
Compile / smithy4sInputDirs := List(
baseDirectory.value.getParentFile / "src" / "main" / "smithy",
),
libraryDependencies ++= {
Seq(
"com.disneystreaming.smithy4s" %% "smithy4s-core" % smithy4sVersion.value,
"com.disneystreaming.smithy4s" %% "smithy4s-http4s" % smithy4sVersion.value,
"com.disneystreaming.smithy4s" %% "smithy4s-cats" % smithy4sVersion.value,
"com.disneystreaming.smithy4s" %% "smithy4s-json" % smithy4sVersion.value,
"org.tpolecat" %% "natchez-core" % "0.3.5",
"com.disneystreaming.smithy4s" %%% "smithy4s-core" % smithy4sVersion.value,
"com.disneystreaming.smithy4s" %%% "smithy4s-json" % smithy4sVersion.value,
"org.tpolecat" %%% "natchez-core" % "0.3.5",
)
},
)
.enablePlugins(Smithy4sCodegenPlugin)

lazy val root = tlCrossRootProject
.aggregate(`natchez-smithy4s`)
.enablePlugins(NoPublishPlugin)
File renamed without changes.
2 changes: 2 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2")
addSbtPlugin("org.typelevel" % "sbt-typelevel-ci-release" % "0.7.1")
addSbtPlugin("org.typelevel" % "sbt-typelevel-mergify" % "0.7.1")
addSbtPlugin("org.typelevel" % "sbt-typelevel-settings" % "0.7.1")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0")
addSbtPlugin("com.disneystreaming.smithy4s" % "smithy4s-sbt-codegen" % "0.18.22")

0 comments on commit 0fc1a2c

Please sign in to comment.