From 2763b6a1003878fb1f1eb773adc030217d9a8dd3 Mon Sep 17 00:00:00 2001 From: Kyri Petrou Date: Wed, 14 Aug 2024 20:13:54 +0300 Subject: [PATCH] Support Scala Native --- .github/workflows/ci.yml | 3 ++- .sbtopts | 2 +- build.sbt | 14 ++++++++++---- project/plugins.sbt | 7 ++++--- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a90bee5..33d104ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,9 +85,10 @@ jobs: - ++2.12 zioQueryJVM - ++2.13 zioQueryJVM - ++3.3 zioQueryJVM - - ++2.12 zioQueryJS - ++2.13 zioQueryJS - ++3.3 zioQueryJS + - ++2.13 zioQueryNative + - ++3.3 zioQueryNative steps: - name: Install libuv run: sudo apt-get update && sudo apt-get install -y libuv1-dev diff --git a/.sbtopts b/.sbtopts index 4ea77471..02298fcc 100644 --- a/.sbtopts +++ b/.sbtopts @@ -1,3 +1,3 @@ -J-Xms1G --J-Xmx3G +-J-Xmx4G -J-XX:+UseG1GC diff --git a/build.sbt b/build.sbt index 7705af09..426af0d3 100644 --- a/build.sbt +++ b/build.sbt @@ -33,8 +33,9 @@ inThisBuild( ciTargetJavaVersions := List("11", "21"), ciTargetScalaVersions := Map( - (zioQueryJVM / thisProject).value.id -> allScalas, - (zioQueryJS / thisProject).value.id -> allScalas + (zioQueryJVM / thisProject).value.id -> allScalas, + (zioQueryJS / thisProject).value.id -> List("2.13", "3.3"), + (zioQueryNative / thisProject).value.id -> List("2.13", "3.3") ), ciReleaseJobs := ciReleaseJobs.value.map { job => @@ -64,7 +65,7 @@ lazy val root = project docs ) -lazy val zioQuery = crossProject(JSPlatform, JVMPlatform) +lazy val zioQuery = crossProject(JSPlatform, JVMPlatform, NativePlatform) .enablePlugins(BuildInfoPlugin) .in(file("zio-query")) .settings( @@ -87,7 +88,6 @@ lazy val zioQuery = crossProject(JSPlatform, JVMPlatform) (if (scalaBinaryVersion.value == "3") Seq() else { - Seq( "-opt:l:method", "-opt:l:inline", @@ -110,6 +110,12 @@ lazy val zioQueryJS = zioQuery.js } ) +lazy val zioQueryNative = zioQuery.native + .settings( + scala3Settings, + nativeConfig ~= { _.withMultithreading(false) } + ) + lazy val zioQueryJVM = zioQuery.jvm.settings(enableMimaSettingsJVM) lazy val benchmarks = project diff --git a/project/plugins.sbt b/project/plugins.sbt index 7ce346ba..27cce529 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -4,8 +4,9 @@ addSbtPlugin("dev.zio" % "zio-sbt-ecosystem" % zioSbtVersion) addSbtPlugin("dev.zio" % "zio-sbt-website" % zioSbtVersion) addSbtPlugin("dev.zio" % "zio-sbt-ci" % zioSbtVersion) -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.1.0") -addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.4") -addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.12.0") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.1.0") +addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.4") +addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.12.0") +addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.4") resolvers ++= Resolver.sonatypeOssRepos("public")