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

Cross-build for Scala 3 + Native #4228

Merged
merged 14 commits into from
Jun 11, 2022
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
12 changes: 10 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ jobs:
java: temurin@17
- project: rootNative
java: graalvm@11
- project: rootNative
scala: 3.1.2
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
Expand Down Expand Up @@ -334,6 +332,16 @@ jobs:
tar xf targets.tar
rm targets.tar

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

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

- name: Import signing key
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
run: echo $PGP_SECRET | base64 -di | gpg --import
Expand Down
23 changes: 12 additions & 11 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
ThisBuild / tlBaseVersion := "2.8"

val scalaCheckVersion = "1.15.4"
val scalaCheckVersion = "1.16.0"

val disciplineVersion = "1.4.0"
val disciplineVersion = "1.5.1"

val disciplineMunitVersion = "1.0.9"
val disciplineMunitVersion = "2.0.0-M2"

val munitVersion = "0.7.29"
val munitVersion = "1.0.0-M5"

val kindProjectorVersion = "0.13.2"

Expand All @@ -26,10 +26,6 @@ ThisBuild / scalaVersion := Scala212
ThisBuild / tlFatalWarnings := false
ThisBuild / tlFatalWarningsInCi := false

ThisBuild / githubWorkflowBuildMatrixExclusions +=
MatrixExclude(Map("project" -> "rootNative", "scala" -> Scala3))
// Dotty is not yet supported by Scala Native

ThisBuild / githubWorkflowAddedJobs ++= Seq(
WorkflowJob(
"scalafix",
Expand Down Expand Up @@ -73,9 +69,7 @@ lazy val commonJsSettings = Seq(

lazy val commonNativeSettings = Seq(
doctestGenTests := Seq.empty,
// Currently scala-native does not support Dotty
crossScalaVersions := { (ThisBuild / crossScalaVersions).value.filterNot(Scala3 == _) },
tlVersionIntroduced ++= List("2.12", "2.13").map(_ -> "2.4.0").toMap
tlVersionIntroduced ++= List("2.12", "2.13").map(_ -> "2.4.0").toMap + ("3" -> "2.8.0")
)

lazy val disciplineDependencies = Seq(
Expand Down Expand Up @@ -135,6 +129,11 @@ lazy val algebraSettings = Seq[Setting[_]](
tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "2.7.0").toMap
)

lazy val algebraNativeSettings = Seq[Setting[_]](
tlMimaPreviousVersions ~= (_ - "2.2.3"),
tlVersionIntroduced += ("3" -> "2.8.0")
)

lazy val algebra = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.crossType(CrossType.Pure)
.in(file("algebra-core"))
Expand All @@ -149,6 +148,7 @@ lazy val algebra = crossProject(JSPlatform, JVMPlatform, NativePlatform)
libraryDependencies += "org.scalacheck" %%% "scalacheck" % scalaCheckVersion % Test,
testingDependencies
)
.nativeSettings(algebraNativeSettings)

lazy val algebraLaws = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.in(file("algebra-laws"))
Expand All @@ -160,6 +160,7 @@ lazy val algebraLaws = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.jvmSettings(commonJvmSettings)
.nativeSettings(commonNativeSettings)
.settings(algebraSettings)
.nativeSettings(algebraNativeSettings)

lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.crossType(CrossType.Pure)
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.3")
addSbtPlugin("com.github.tkawachi" % "sbt-doctest" % "0.10.0")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.2.0")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.2.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.7.1")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.0")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.4")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")