From 53cf51b7a815f0e81480dcccd3bfcf98f01d7cb3 Mon Sep 17 00:00:00 2001 From: Ali Rashid Date: Fri, 31 Jan 2025 12:23:22 +0300 Subject: [PATCH 1/9] Update sbt to 1.10.7 --- project/build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/build.properties b/project/build.properties index abbbce5da..73df629ac 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.8 +sbt.version=1.10.7 From 8ed834486a278de5e839ae563e811a2e626a9b8f Mon Sep 17 00:00:00 2001 From: Ali Rashid Date: Fri, 31 Jan 2025 12:27:30 +0300 Subject: [PATCH 2/9] Update sbt-crossproject to 1.3.2 Explicitly include sbt-scalajs-crossproject --- project/plugins.sbt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index d6d47abbf..e7c24a89b 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -2,7 +2,8 @@ val sbtTypelevelVersion = "0.7.4" addSbtPlugin("org.typelevel" % "sbt-typelevel" % sbtTypelevelVersion) addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % sbtTypelevelVersion) -addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.1") +addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2") +addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2") addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.17") addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0") From 7b6bbce03c28e8b4f9ee398702fd30995e5f9610 Mon Sep 17 00:00:00 2001 From: Ali Rashid Date: Fri, 31 Jan 2025 12:33:31 +0300 Subject: [PATCH 3/9] Update Scala 3 version to 3.3.5 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 0a313da35..0e8baf1e9 100644 --- a/build.sbt +++ b/build.sbt @@ -26,7 +26,7 @@ lazy val jscienceVersion = "4.3.1" lazy val apacheCommonsMath3Version = "3.6.1" val Scala213 = "2.13.15" -val Scala3 = "3.2.2" +val Scala3 = "3.3.5" Global / onChangedBuildSource := ReloadOnSourceChanges From cf8351531c7bf491cfe603ad95def015d11d671a Mon Sep 17 00:00:00 2001 From: Ali Rashid Date: Fri, 31 Jan 2025 12:34:28 +0300 Subject: [PATCH 4/9] Update Scala 2 version to 2.13.16 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 0e8baf1e9..e08630ead 100644 --- a/build.sbt +++ b/build.sbt @@ -25,7 +25,7 @@ lazy val apfloatVersion = "1.10.1" lazy val jscienceVersion = "4.3.1" lazy val apacheCommonsMath3Version = "3.6.1" -val Scala213 = "2.13.15" +val Scala213 = "2.13.16" val Scala3 = "3.3.5" Global / onChangedBuildSource := ReloadOnSourceChanges From 305c2a72d4e2da76f06b6d6ec5b5f62e30720d7d Mon Sep 17 00:00:00 2001 From: Ali Rashid Date: Fri, 31 Jan 2025 16:23:28 +0300 Subject: [PATCH 5/9] Update Scala JS to 1.18.2 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index e7c24a89b..da436bdc5 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -8,4 +8,4 @@ addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.17") addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0") addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7") -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.17.0") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.18.2") From 9d0f5191325404c4d2ac605ce9ac7490ce83252e Mon Sep 17 00:00:00 2001 From: Ali Rashid Date: Sun, 2 Feb 2025 14:29:49 +0300 Subject: [PATCH 6/9] Update algebra. Update Scala Native to 0.5.6. --- build.sbt | 12 ++++++------ project/plugins.sbt | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build.sbt b/build.sbt index e08630ead..02c78947a 100644 --- a/build.sbt +++ b/build.sbt @@ -14,12 +14,12 @@ val header = """|*************************************************************** import scala.language.existentials -lazy val scalaCheckVersion = "1.17.0" +lazy val scalaCheckVersion = "1.18.1" -lazy val munit = "1.0.0-M7" -lazy val munitDiscipline = "2.0.0-M3" +lazy val munit = "1.1.0" +lazy val munitDiscipline = "2.0.0" -lazy val algebraVersion = "2.9.0" +lazy val catsVersion = "2.13.0" lazy val apfloatVersion = "1.10.1" lazy val jscienceVersion = "4.3.1" @@ -133,7 +133,7 @@ lazy val laws = crossProject(JSPlatform, JVMPlatform, NativePlatform) .settings(spireSettings: _*) .settings( libraryDependencies ++= Seq( - "org.typelevel" %%% "algebra-laws" % algebraVersion, + "org.typelevel" %%% "algebra-laws" % catsVersion, "org.scalacheck" %%% "scalacheck" % scalaCheckVersion ) ) @@ -178,7 +178,7 @@ lazy val buildSettings = Seq( lazy val commonDeps = Seq( libraryDependencies ++= Seq( - "org.typelevel" %%% "algebra" % algebraVersion + "org.typelevel" %%% "algebra" % catsVersion, ) ) diff --git a/project/plugins.sbt b/project/plugins.sbt index da436bdc5..16f03a211 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -4,7 +4,7 @@ addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % sbtTypelevelVersion) addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2") addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2") -addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.17") +addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.6") addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0") addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7") From 4e3d7e78583d267eeb34c7f3b0cf2bba911a614f Mon Sep 17 00:00:00 2001 From: Ali Rashid Date: Sun, 2 Feb 2025 16:06:23 +0300 Subject: [PATCH 7/9] Update sbt-typelevel to 0.7.7 Enable tests with JDK 21. --- .github/workflows/ci.yml | 103 ++++++++++++++++++++++++++++++--------- build.sbt | 5 +- project/plugins.sbt | 2 +- 3 files changed, 85 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c2a93ede2..89c6ca3e2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,37 +24,44 @@ concurrency: jobs: build: - name: Build and Test + name: Test strategy: + fail-fast: false matrix: - os: [ubuntu-latest] + os: [ubuntu-22.04] scala: [2.13, 3] - java: [temurin@8, temurin@11, temurin@17] + java: [temurin@8, temurin@11, temurin@17, temurin@21] project: [rootJS, rootJVM, rootNative] exclude: - scala: 3 java: temurin@11 - scala: 3 java: temurin@17 + - scala: 3 + java: temurin@21 - project: rootJS java: temurin@11 - project: rootJS java: temurin@17 + - project: rootJS + java: temurin@21 - project: rootNative java: temurin@11 - project: rootNative java: temurin@17 + - project: rootNative + java: temurin@21 runs-on: ${{ matrix.os }} timeout-minutes: 60 steps: - - name: Install sbt - uses: sbt/setup-sbt@v1 - - name: Checkout current branch (full) uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Setup sbt + uses: sbt/setup-sbt@v1 + - name: Setup Java (temurin@8) id: setup-java-temurin-8 if: matrix.java == 'temurin@8' @@ -94,11 +101,24 @@ jobs: if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false' run: sbt +update + - name: Setup Java (temurin@21) + id: setup-java-temurin-21 + if: matrix.java == 'temurin@21' + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 21 + cache: sbt + + - name: sbt update + if: matrix.java == 'temurin@21' && steps.setup-java-temurin-21.outputs.cache-hit == 'false' + run: sbt +update + - name: Check that workflows are up to date run: sbt githubWorkflowCheck - name: Check headers and formatting - if: matrix.java == 'temurin@8' && matrix.os == 'ubuntu-latest' + if: matrix.java == 'temurin@8' && matrix.os == 'ubuntu-22.04' run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' headerCheckAll scalafmtCheckAll 'project /' scalafmtSbtCheck - name: scalaJSLink @@ -113,11 +133,11 @@ jobs: run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' test - name: Check binary compatibility - if: matrix.java == 'temurin@8' && matrix.os == 'ubuntu-latest' + if: matrix.java == 'temurin@8' && matrix.os == 'ubuntu-22.04' run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' mimaReportBinaryIssues - name: Generate API documentation - if: matrix.java == 'temurin@8' && matrix.os == 'ubuntu-latest' + if: matrix.java == 'temurin@8' && matrix.os == 'ubuntu-22.04' run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' doc - name: Make target directories @@ -141,18 +161,18 @@ jobs: if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') strategy: matrix: - os: [ubuntu-latest] + os: [ubuntu-22.04] java: [temurin@8] runs-on: ${{ matrix.os }} steps: - - name: Install sbt - uses: sbt/setup-sbt@v1 - - name: Checkout current branch (full) uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Setup sbt + uses: sbt/setup-sbt@v1 + - name: Setup Java (temurin@8) id: setup-java-temurin-8 if: matrix.java == 'temurin@8' @@ -192,6 +212,19 @@ jobs: if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false' run: sbt +update + - name: Setup Java (temurin@21) + id: setup-java-temurin-21 + if: matrix.java == 'temurin@21' + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 21 + cache: sbt + + - name: sbt update + if: matrix.java == 'temurin@21' && steps.setup-java-temurin-21.outputs.cache-hit == 'false' + run: sbt +update + - name: Download target directories (2.13, rootJS) uses: actions/download-artifact@v4 with: @@ -281,18 +314,18 @@ jobs: if: github.event.repository.fork == false && github.event_name != 'pull_request' strategy: matrix: - os: [ubuntu-latest] + os: [ubuntu-22.04] java: [temurin@8] runs-on: ${{ matrix.os }} steps: - - name: Install sbt - uses: sbt/setup-sbt@v1 - - name: Checkout current branch (full) uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Setup sbt + uses: sbt/setup-sbt@v1 + - name: Setup Java (temurin@8) id: setup-java-temurin-8 if: matrix.java == 'temurin@8' @@ -332,28 +365,41 @@ jobs: if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false' run: sbt +update + - name: Setup Java (temurin@21) + id: setup-java-temurin-21 + if: matrix.java == 'temurin@21' + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 21 + cache: sbt + + - name: sbt update + if: matrix.java == 'temurin@21' && steps.setup-java-temurin-21.outputs.cache-hit == 'false' + run: sbt +update + - name: Submit Dependencies uses: scalacenter/sbt-dependency-submission@v2 with: - modules-ignore: spire-examples_2.13 spire-examples_3 rootjs_2.13 rootjs_3 docs_2.13 docs_3 spire-tests_sjs1_2.13 spire-tests_sjs1_3 rootjvm_2.13 rootjvm_3 rootnative_2.13 rootnative_3 spire-tests_2.13 spire-tests_3 spire-benchmark_2.13 spire-benchmark_3 spire-tests_native0.4_2.13 spire-tests_native0.4_3 + modules-ignore: spire-examples_2.13 spire-examples_3 rootjs_2.13 rootjs_3 docs_2.13 docs_3 spire-tests_sjs1_2.13 spire-tests_sjs1_3 rootjvm_2.13 rootjvm_3 rootnative_2.13 rootnative_3 spire-tests_2.13 spire-tests_3 spire-benchmark_2.13 spire-benchmark_3 spire-tests_native0.5_2.13 spire-tests_native0.5_3 configs-ignore: test scala-tool scala-doc-tool test-internal site: name: Generate Site strategy: matrix: - os: [ubuntu-latest] + os: [ubuntu-22.04] java: [temurin@11] runs-on: ${{ matrix.os }} steps: - - name: Install sbt - uses: sbt/setup-sbt@v1 - - name: Checkout current branch (full) uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Setup sbt + uses: sbt/setup-sbt@v1 + - name: Setup Java (temurin@8) id: setup-java-temurin-8 if: matrix.java == 'temurin@8' @@ -393,6 +439,19 @@ jobs: if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false' run: sbt +update + - name: Setup Java (temurin@21) + id: setup-java-temurin-21 + if: matrix.java == 'temurin@21' + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 21 + cache: sbt + + - name: sbt update + if: matrix.java == 'temurin@21' && steps.setup-java-temurin-21.outputs.cache-hit == 'false' + run: sbt +update + - name: Generate site run: sbt docs/tlSite diff --git a/build.sbt b/build.sbt index 02c78947a..7e880d027 100644 --- a/build.sbt +++ b/build.sbt @@ -34,7 +34,8 @@ ThisBuild / tlBaseVersion := "0.18" ThisBuild / scalaVersion := Scala213 ThisBuild / crossScalaVersions := Seq(Scala213, Scala3) -ThisBuild / githubWorkflowJavaVersions := Seq("8", "11", "17").map(JavaSpec.temurin(_)) +ThisBuild / githubWorkflowJavaVersions := Seq("8", "11", "17", "21").map(JavaSpec.temurin) +ThisBuild / githubWorkflowBuildMatrixFailFast := Some(false) ThisBuild / homepage := Some(url("https://typelevel.org/spire/")) ThisBuild / licenses := Seq("MIT" -> url("https://opensource.org/licenses/MIT")) @@ -178,7 +179,7 @@ lazy val buildSettings = Seq( lazy val commonDeps = Seq( libraryDependencies ++= Seq( - "org.typelevel" %%% "algebra" % catsVersion, + "org.typelevel" %%% "algebra" % catsVersion ) ) diff --git a/project/plugins.sbt b/project/plugins.sbt index 16f03a211..b1faa4043 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,4 +1,4 @@ -val sbtTypelevelVersion = "0.7.4" +val sbtTypelevelVersion = "0.7.7" addSbtPlugin("org.typelevel" % "sbt-typelevel" % sbtTypelevelVersion) addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % sbtTypelevelVersion) From 291fb1f38049acea58bae07eec01d5a88c0f4bfd Mon Sep 17 00:00:00 2001 From: Ali Rashid Date: Sun, 2 Feb 2025 17:51:58 +0300 Subject: [PATCH 8/9] Update CforSuite for current Java 8 changes. Use lower precision for native platform for NRootSuite --- .../src/main/scala/spire/tests/Platform.scala | 24 ++++++++++++++++++ .../src/test/scala/spire/tests/Platform.scala | 24 ++++++++++++++++++ .../src/main/scala/spire/tests/Platform.scala | 24 ++++++++++++++++++ .../test/scala/spire/algebra/NRootSuite.scala | 2 +- .../test/scala/spire/syntax/CforSuite.scala | 25 +++++++++++-------- 5 files changed, 88 insertions(+), 11 deletions(-) create mode 100644 tests/js/src/main/scala/spire/tests/Platform.scala create mode 100644 tests/jvm/src/test/scala/spire/tests/Platform.scala create mode 100644 tests/native/src/main/scala/spire/tests/Platform.scala diff --git a/tests/js/src/main/scala/spire/tests/Platform.scala b/tests/js/src/main/scala/spire/tests/Platform.scala new file mode 100644 index 000000000..9b8dc66d4 --- /dev/null +++ b/tests/js/src/main/scala/spire/tests/Platform.scala @@ -0,0 +1,24 @@ +/* + * **********************************************************************\ + * * Project ** + * * ______ ______ __ ______ ____ ** + * * / ____/ / __ / / / / __ / / __/ (c) 2011-2021 ** + * * / /__ / /_/ / / / / /_/ / / /_ ** + * * /___ / / ____/ / / / __ / / __/ Erik Osheim, Tom Switzer ** + * * ____/ / / / / / / / | | / /__ ** + * * /_____/ /_/ /_/ /_/ |_| /____/ All rights reserved. ** + * * ** + * * Redistribution and use permitted under the MIT license. ** + * * ** + * \*********************************************************************** + */ + +package spire.tests + +object Platform { + + final val isJVM = false + final val isJS = true + final val isNative = false + +} diff --git a/tests/jvm/src/test/scala/spire/tests/Platform.scala b/tests/jvm/src/test/scala/spire/tests/Platform.scala new file mode 100644 index 000000000..2c6b513d9 --- /dev/null +++ b/tests/jvm/src/test/scala/spire/tests/Platform.scala @@ -0,0 +1,24 @@ +/* + * **********************************************************************\ + * * Project ** + * * ______ ______ __ ______ ____ ** + * * / ____/ / __ / / / / __ / / __/ (c) 2011-2021 ** + * * / /__ / /_/ / / / / /_/ / / /_ ** + * * /___ / / ____/ / / / __ / / __/ Erik Osheim, Tom Switzer ** + * * ____/ / / / / / / / | | / /__ ** + * * /_____/ /_/ /_/ /_/ |_| /____/ All rights reserved. ** + * * ** + * * Redistribution and use permitted under the MIT license. ** + * * ** + * \*********************************************************************** + */ + +package spire.tests + +object Platform { + + final val isJVM = true + final val isJS = false + final val isNative = false + +} diff --git a/tests/native/src/main/scala/spire/tests/Platform.scala b/tests/native/src/main/scala/spire/tests/Platform.scala new file mode 100644 index 000000000..57b197112 --- /dev/null +++ b/tests/native/src/main/scala/spire/tests/Platform.scala @@ -0,0 +1,24 @@ +/* + * **********************************************************************\ + * * Project ** + * * ______ ______ __ ______ ____ ** + * * / ____/ / __ / / / / __ / / __/ (c) 2011-2021 ** + * * / /__ / /_/ / / / / /_/ / / /_ ** + * * /___ / / ____/ / / / __ / / __/ Erik Osheim, Tom Switzer ** + * * ____/ / / / / / / / | | / /__ ** + * * /_____/ /_/ /_/ /_/ |_| /____/ All rights reserved. ** + * * ** + * * Redistribution and use permitted under the MIT license. ** + * * ** + * \*********************************************************************** + */ + +package spire.tests + +object Platform { + + final val isJVM = false + final val isJS = false + final val isNative = true + +} diff --git a/tests/shared/src/test/scala/spire/algebra/NRootSuite.scala b/tests/shared/src/test/scala/spire/algebra/NRootSuite.scala index d2b8bb089..e50a7dbc1 100644 --- a/tests/shared/src/test/scala/spire/algebra/NRootSuite.scala +++ b/tests/shared/src/test/scala/spire/algebra/NRootSuite.scala @@ -56,7 +56,7 @@ class NRootSuite extends munit.FunSuite { } } - val HighPrecision = new java.math.MathContext(250) + val HighPrecision = new java.math.MathContext(if (spire.tests.Platform.isNative) 150 else 250) val bases = Seq( BigDecimal(2), diff --git a/tests/shared/src/test/scala/spire/syntax/CforSuite.scala b/tests/shared/src/test/scala/spire/syntax/CforSuite.scala index 1fea3eef8..ae7c500c0 100644 --- a/tests/shared/src/test/scala/spire/syntax/CforSuite.scala +++ b/tests/shared/src/test/scala/spire/syntax/CforSuite.scala @@ -35,6 +35,7 @@ class CforSuite extends munit.FunSuite { cfor(0)(_ < 10, _ + 1) { x => cfor(10)(_ < 100, _ + 10) { y => s.add(x + y) + () } } assertEquals(s.toSet, (10 to 99).toSet) @@ -42,7 +43,7 @@ class CforSuite extends munit.FunSuite { test("symbol collision cfor") { val b = mutable.ArrayBuffer.empty[Int] - cfor(0)(_ < 3, _ + 1) { x => + cfor(0)(_ < 3, _ + 1) { _ => cfor(0)(_ < 2, _ + 1) { y => val x = y b += x @@ -100,17 +101,21 @@ class CforSuite extends munit.FunSuite { } test("capture value in closure") { - val b1 = collection.mutable.ArrayBuffer.empty[() => Int] + val capturedValues = collection.mutable.ArrayBuffer.empty[Int] + val b1 = collection.mutable.ArrayBuffer.empty[() => Unit] cfor(0)(_ < 3, _ + 1) { x => - b1 += (() => x) + val value = x // Explicitly define. Avoids failures on certain JDKs + val closure = () => { capturedValues += value; () } + b1 += closure } - val b2 = collection.mutable.ArrayBuffer[() => Int]() - var i = 0 - while (i < 3) { - b2 += (() => i) - i += 1 + b1.foreach(_.apply()) + + val b2 = collection.mutable.ArrayBuffer.empty[() => Int] + cfor(0)(_ < 3, _ + 1) { i => + val value = i + b2 += (() => value) } - assertEquals(b1.map(_.apply()).toList, b2.map(_.apply()).toList) + assertEquals(capturedValues.toList, b2.map(_.apply()).toList) } test("capture value in inner class") { @@ -168,7 +173,7 @@ class CforSuite extends munit.FunSuite { test("cforRange(0 to 0 by -1)") { var t = 0 - cforRange(0 to 0 by -1) { x => + cforRange(0 to 0 by -1) { _ => t += 1 } assertEquals(t, 1) From 9ec76d06d5f3732c19c00529217af979ada9f609 Mon Sep 17 00:00:00 2001 From: Ali Rashid Date: Sun, 2 Feb 2025 21:48:49 +0300 Subject: [PATCH 9/9] Exclude versions 0.18.x and below from scala-native MiMa checks --- build.sbt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/build.sbt b/build.sbt index 7e880d027..bf5d60680 100644 --- a/build.sbt +++ b/build.sbt @@ -69,6 +69,7 @@ lazy val platform = crossProject(JSPlatform, JVMPlatform, NativePlatform) .settings(spireSettings: _*) .jvmSettings(commonJvmSettings: _*) .jsSettings(commonJsSettings: _*) + .nativeSettings(commonNativeSettings*) .dependsOn(macros, util) lazy val macros = crossProject(JSPlatform, JVMPlatform, NativePlatform) @@ -79,6 +80,7 @@ lazy val macros = crossProject(JSPlatform, JVMPlatform, NativePlatform) .settings(munitSettings: _*) .jvmSettings(commonJvmSettings: _*) .jsSettings(commonJsSettings: _*) + .nativeSettings(commonNativeSettings*) lazy val util = crossProject(JSPlatform, JVMPlatform, NativePlatform) .crossType(CrossType.Pure) @@ -86,6 +88,7 @@ lazy val util = crossProject(JSPlatform, JVMPlatform, NativePlatform) .settings(spireSettings: _*) .jvmSettings(commonJvmSettings: _*) .jsSettings(commonJsSettings: _*) + .nativeSettings(commonNativeSettings*) .dependsOn(macros) lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform) @@ -95,6 +98,7 @@ lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform) .settings(coreSettings: _*) .jvmSettings(commonJvmSettings: _*) .jsSettings(commonJsSettings: _*) + .nativeSettings(commonNativeSettings*) .dependsOn(macros, platform, util) lazy val extras = crossProject(JSPlatform, JVMPlatform, NativePlatform) @@ -104,6 +108,7 @@ lazy val extras = crossProject(JSPlatform, JVMPlatform, NativePlatform) .settings(extrasSettings: _*) .jvmSettings(commonJvmSettings: _*) .jsSettings(commonJsSettings: _*) + .nativeSettings(commonNativeSettings*) .dependsOn(macros, platform, util, core) lazy val docs = project @@ -140,6 +145,7 @@ lazy val laws = crossProject(JSPlatform, JVMPlatform, NativePlatform) ) .jvmSettings(commonJvmSettings: _*) .jsSettings(commonJsSettings: _*) + .nativeSettings(commonNativeSettings*) .dependsOn(core, extras) lazy val tests = crossProject(JSPlatform, JVMPlatform, NativePlatform) @@ -150,6 +156,7 @@ lazy val tests = crossProject(JSPlatform, JVMPlatform, NativePlatform) .enablePlugins(NoPublishPlugin) .jvmSettings(commonJvmSettings: _*) .jsSettings(commonJsSettings: _*) + .nativeSettings(commonNativeSettings*) .dependsOn(core, extras, laws) lazy val benchmark: Project = project @@ -191,6 +198,13 @@ lazy val commonJsSettings = Seq() lazy val commonJvmSettings = Seq() +lazy val commonNativeSettings = Seq( + tlVersionIntroduced := Map( + "2.13" -> "0.19.0", // Next release with Scala Native 0.5.x is 0.19 + "3" -> "0.19.0" // Set 0.19.0 as the new baseline and Ignore previous releases + ) +) + ThisBuild / tlSiteApiUrl := Some(url("https://www.javadoc.io/doc/org.typelevel/spire_2.13/latest/spire/index.html")) lazy val coreSettings = Seq(