Skip to content

Commit fe81e9d

Browse files
committed
Add support for Scala Native 0.5.x.
Unfortunately, there is no patch Scala version in common between Scala.js 0.6.x and Scala Native 0.5.x. This means we have to force different versions when building for Native 0.5.x.
1 parent 8a4a7b3 commit fe81e9d

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

.github/workflows/ci.yml

+11-4
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,16 @@ jobs:
1414
matrix:
1515
scalaversion: ["2.11.12", "2.12.13", "2.13.4"]
1616
platform: ["JVM", "JS", "JS-0.6.x", "Native"]
17+
include:
18+
# Earliest Scala versions supported by Scala Native 0.5.x
19+
- scalaversion: "2.12.14"
20+
platform: "Native-0.5.x"
21+
- scalaversion: "2.13.8"
22+
platform: "Native-0.5.x"
1723
env:
1824
SCALAJS_VERSION: "${{ matrix.platform == 'JS-0.6.x' && '0.6.33' || '' }}"
19-
PROJECT_NAME: "portable-scala-reflect${{ matrix.platform == 'JS-0.6.x' && 'JS' || matrix.platform }}"
25+
SCALANATIVE_VERSION: "${{ matrix.platform == 'Native-0.5.x' && '0.5.2' || '' }}"
26+
PROJECT_NAME: "portable-scala-reflect${{ matrix.platform == 'JS-0.6.x' && 'JS' || matrix.platform == 'Native-0.5.x' && 'Native' || matrix.platform }}"
2027
steps:
2128
- uses: actions/checkout@v2
2229
- uses: actions/setup-node@v4
@@ -27,8 +34,8 @@ jobs:
2734
java-version: "adopt@1.8"
2835
- uses: coursier/cache-action@v5
2936
- name: Unit tests
30-
run: sbt "++${{ matrix.scalaversion }}" "${{ env.PROJECT_NAME }}/test"
37+
run: sbt "++${{ matrix.scalaversion }}!" "${{ env.PROJECT_NAME }}/test"
3138
- name: Test generate documentation
32-
run: sbt "++${{ matrix.scalaversion }}" "${{ env.PROJECT_NAME }}/doc"
39+
run: sbt "++${{ matrix.scalaversion }}!" "${{ env.PROJECT_NAME }}/doc"
3340
- name: MiMa
34-
run: sbt "++${{ matrix.scalaversion }}" "${{ env.PROJECT_NAME }}/mimaReportBinaryIssues"
41+
run: sbt "++${{ matrix.scalaversion }}!" "${{ env.PROJECT_NAME }}/mimaReportBinaryIssues"

build.sbt

+8-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,14 @@ lazy val `portable-scala-reflect` = crossProject(JSPlatform, JVMPlatform, Native
3232
.settings(
3333
scalacOptions in (Compile, doc) -= "-Xfatal-warnings",
3434

35-
mimaPreviousArtifacts +=
36-
organization.value %%% moduleName.value % previousVersion,
35+
mimaPreviousArtifacts ++= {
36+
val isNewInThisRelease = System.getenv("SCALANATIVE_VERSION") == "0.5.2"
37+
if (isNewInThisRelease)
38+
Set.empty
39+
else
40+
Set(organization.value %%% moduleName.value % previousVersion)
41+
},
42+
mimaFailOnNoPrevious := false,
3743

3844
publishMavenStyle := true,
3945
publishTo := {

project/plugins.sbt

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
val scalaJSVersion =
22
Option(System.getenv("SCALAJS_VERSION")).filter(_ != "").getOrElse("1.0.0")
33

4+
val scalaNativeVersion =
5+
Option(System.getenv("SCALANATIVE_VERSION")).filter(_ != "").getOrElse("0.4.4")
6+
47
addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion)
58
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2")
69

7-
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.4")
10+
addSbtPlugin("org.scala-native" % "sbt-scala-native" % scalaNativeVersion)
811
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2")
912

1013
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.8.1")

0 commit comments

Comments
 (0)