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

Scala Native 0.5.x #491

Merged
merged 9 commits into from
May 31, 2024
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
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(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this isn't needed anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently not. CI is green.

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 =>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scala 3 failed otherwise 🤷

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")

Loading