Skip to content

Commit

Permalink
Merge pull request #491 from sideeffffect/scala-native-0.5.x
Browse files Browse the repository at this point in the history
Scala Native 0.5.x
  • Loading branch information
cquiroz authored May 31, 2024
2 parents c3c1787 + 0304c11 commit 4eb27b9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
run: sbt '++ ${{ matrix.scala }}' test

- name: Compress target directories
run: tar cf targets.tar target core/native/target localesMinimalEnUSDb/native/target localesFullCurrenciesDb/target macroutils/target core/js/target core/jvm/target tests/js/target localesFullDb/.js/target localesFullDb/.native/target localesMinimalEnUSDb/js/target tests/jvm/target demo/native/target localesMinimalEnDb/native/target localesMinimalEnDb/js/target tests/native/target demo/js/target project/target
run: tar cf targets.tar target localesFullCurrenciesDb/js/target core/native/target localesMinimalEnUSDb/native/target macroutils/target core/js/target localesFullCurrenciesDb/native/target core/jvm/target tests/js/target localesFullDb/.js/target localesFullDb/.native/target localesMinimalEnUSDb/js/target tests/jvm/target demo/native/target localesMinimalEnDb/native/target localesMinimalEnDb/js/target tests/native/target demo/js/target project/target

- name: Upload target directories
uses: actions/upload-artifact@v4
Expand Down
30 changes: 13 additions & 17 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import locales._
import sbt.Keys._
import sbtcrossproject.CrossPlugin.autoImport.{ CrossType, crossProject }

lazy val cldrApiVersion = "4.4.0"
lazy val cldrApiVersion = "4.5.0"

ThisBuild / versionScheme := Some("always")

Expand Down Expand Up @@ -87,7 +87,8 @@ lazy val root = project
tests.native,
localesFullDb.js,
localesFullDb.native,
localesFullCurrenciesDb,
localesFullCurrenciesDb.js,
localesFullCurrenciesDb.native,
localesMinimalEnDb.js,
localesMinimalEnDb.native,
localesMinimalEnUSDb.js,
Expand Down Expand Up @@ -133,14 +134,16 @@ lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform)
}
}
)
.nativeSettings {
scalacOptions += "-P:scalanative:genStaticForwardersForNonTopLevelObjects"
}

lazy val cldrDbVersion = "36.0"

lazy val localesFullCurrenciesDb = project
lazy val localesFullCurrenciesDb = crossProject(JSPlatform, NativePlatform)
.in(file("localesFullCurrenciesDb"))
.settings(commonSettings)
.configure(_.enablePlugins(LocalesPlugin))
.configure(_.enablePlugins(ScalaJSPlugin))
.settings(
name := "locales-full-currencies-db",
cldrVersion := CLDRVersion.Version(cldrDbVersion),
Expand All @@ -151,7 +154,7 @@ lazy val localesFullCurrenciesDb = project
supportDateTimeFormats := true,
supportNumberFormats := true,
supportISOCodes := true,
libraryDependencies += ("org.portable-scala" %%% "portable-scala-reflect" % "1.1.2")
libraryDependencies += ("org.portable-scala" %%% "portable-scala-reflect" % "1.1.3")
.cross(CrossVersion.for3Use2_13)
)

Expand All @@ -170,7 +173,7 @@ lazy val localesFullDb = crossProject(JSPlatform, NativePlatform)
supportDateTimeFormats := true,
supportNumberFormats := true,
supportISOCodes := true,
libraryDependencies += ("org.portable-scala" %%% "portable-scala-reflect" % "1.1.2")
libraryDependencies += ("org.portable-scala" %%% "portable-scala-reflect" % "1.1.3")
.cross(CrossVersion.for3Use2_13)
)

Expand All @@ -188,7 +191,7 @@ lazy val localesMinimalEnDb = crossProject(JSPlatform, NativePlatform)
supportDateTimeFormats := true,
supportNumberFormats := true,
supportISOCodes := false,
libraryDependencies += ("org.portable-scala" %%% "portable-scala-reflect" % "1.1.2")
libraryDependencies += ("org.portable-scala" %%% "portable-scala-reflect" % "1.1.3")
.cross(CrossVersion.for3Use2_13)
)

Expand All @@ -206,7 +209,7 @@ lazy val localesMinimalEnUSDb = crossProject(JSPlatform, NativePlatform)
supportDateTimeFormats := true,
supportNumberFormats := true,
supportISOCodes := false,
libraryDependencies += ("org.portable-scala" %%% "portable-scala-reflect" % "1.1.2")
libraryDependencies += ("org.portable-scala" %%% "portable-scala-reflect" % "1.1.3")
.cross(CrossVersion.for3Use2_13)
)

Expand All @@ -228,7 +231,7 @@ lazy val tests = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.jsSettings(Test / parallelExecution := false,
scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.CommonJSModule))
)
.jsConfigure(_.dependsOn(core.js, macroutils, localesFullCurrenciesDb))
.jsConfigure(_.dependsOn(core.js, macroutils, localesFullCurrenciesDb.js))
.jvmSettings(
// Fork the JVM test to ensure that the custom flags are set
Test / fork := true,
Expand All @@ -245,14 +248,7 @@ lazy val tests = crossProject(JVMPlatform, JSPlatform, NativePlatform)
Test / classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.Flat
)
.jvmConfigure(_.dependsOn(macroutils))
.nativeSettings(
nativeConfig ~= {
_.withOptimize(false)
// tests fail to link on Scala 2.11 and 2.12 in debug mode
// with the optimizer enabled
}
)
.nativeConfigure(_.dependsOn(core.native, macroutils, localesFullDb.native))
.nativeConfigure(_.dependsOn(core.native, macroutils, localesFullCurrenciesDb.native))
.platformsSettings(JSPlatform, NativePlatform)(
Test / unmanagedSourceDirectories += baseDirectory.value.getParentFile / "js-native" / "src" / "test" / "scala"
)
Expand Down
2 changes: 1 addition & 1 deletion core/native/src/main/scala/locales/NormalizerImpl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ private object NormalizerImpl {
if (src == null || form == null)
throw new NullPointerException
else
Zone { implicit z =>
Zone.acquire { implicit z =>
import Form._
import utf8proc._

Expand Down
5 changes: 2 additions & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0")
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.2")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
addSbtPlugin("io.github.cquiroz" % "sbt-locales" % "4.4.0")
addSbtPlugin("io.github.cquiroz" % "sbt-locales" % "4.5.0")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
addSbtPlugin("org.typelevel" % "sbt-tpolecat" % "0.5.1")
addSbtPlugin("com.github.sbt" % "sbt-github-actions" % "0.23.0")

0 comments on commit 4eb27b9

Please sign in to comment.