Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scala-native support 🎉 #100

Merged
merged 3 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 39 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,16 @@ jobs:
os: [ubuntu-latest]
scala: [3, 2.13, 2.12]
java: [temurin@8, temurin@17]
project: [rootJS, rootJVM]
project: [rootJS, rootJVM, rootNative]
exclude:
- scala: 3
java: temurin@17
- scala: 2.12
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 @@ -83,6 +85,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 @@ -96,11 +102,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 enclosure/js/target enclosure/jvm/target project/target
run: mkdir -p enclosure/js/target enclosure/native/target enclosure/jvm/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 enclosure/js/target enclosure/jvm/target project/target
run: tar cf targets.tar enclosure/js/target enclosure/native/target enclosure/jvm/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 @@ -170,6 +176,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: Download target directories (2.13, rootJS)
uses: actions/download-artifact@v4
with:
Expand All @@ -190,6 +206,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 (2.12, rootJS)
uses: actions/download-artifact@v4
with:
Expand All @@ -210,6 +236,16 @@ jobs:
tar xf targets.tar
rm targets.tar

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

- name: Inflate target directories (2.12, rootNative)
run: |
tar xf targets.tar
rm targets.tar

- name: Import signing key
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
env:
Expand Down
12 changes: 8 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

# unreleased

Cross publish to Scala Native!

### Scala versions:

- `2.12.18`, JVM and JS
- `2.13.12`, JVM and JS
- `3.3.1`, JVM and JS
- `2.12.18`, JVM, JS, Native
- `2.13.12`, JVM, JS, Native
- `3.3.1`, JVM, JS, Native

### internals:
- bump sbt-scalajs to `1.15.0`
- bump sbt-scalafmt to `2.5.2`
- bump scalafmt to `3.7.17`
- bump sbt to `1.9.8`
- bump munit to `1.0.0-M10`
- bump sbt-typelevel tp `0.6.5`
- bump sbt-typelevel to `0.6.5`
- introduce sbt-scala-native `0.4.17`
- introduce sbt-scala-native-crossproject `1.3.2`

# 1.0.0

Expand Down
6 changes: 5 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ ThisBuild / tlCiHeaderCheck := true
ThisBuild / tlCiScalafmtCheck := true
ThisBuild / tlCiScalafixCheck := false
ThisBuild / tlCiMimaBinaryIssueCheck := true
ThisBuild / tlCiReleaseBranches := List.empty // we do not release snapshot versions

//=============================================================================
//============================== Project details ==============================
Expand All @@ -64,7 +65,7 @@ val munitVersion = "1.0.0-M10" // https://github.com/scalameta/munit/r

lazy val root = tlCrossRootProject.aggregate(enclosure)

lazy val enclosure = crossProject(JVMPlatform, JSPlatform)
lazy val enclosure = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.crossType(CrossType.Full)
.in(file("enclosure"))
.settings(
Expand All @@ -75,6 +76,9 @@ lazy val enclosure = crossProject(JVMPlatform, JSPlatform)
)
.settings(macroSettings)
.settings(scala3Flags)
.nativeSettings(
tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "1.1.0").toMap
)

lazy val macroSettings = Seq(
libraryDependencies ++= {
Expand Down
8 changes: 5 additions & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// format: off
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") // https://github.com/scalameta/sbt-scalafmt/releases
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.15.0") // https://github.com/scala-js/scala-js/releases/
addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.6.5") // https://github.com/typelevel/sbt-typelevel/releases
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") // https://github.com/scalameta/sbt-scalafmt/releases
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.15.0") // https://github.com/scala-js/scala-js/releases/
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.17") // https://github.com/scala-native/scala-native/releases
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2") // https://github.com/portable-scala/sbt-crossproject/releases
addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.6.5") // https://github.com/typelevel/sbt-typelevel/releases
Loading