0.4.4 (2022-03-02)

We’re happy to announce the new patch release of Scala Native v0.4.4, which brings improved support for Arm64, introduces experimental embeding of resources and adds dedicated ScalaNativeJUnitPlugin for easier setup of tests. Also in this release we’have fixed all the issues found in the recent support for Scala 3, including Selectables, cross version with Scala 2.13 dependencies and many more.

Commits since last release 29
Merged PRs 27
Contributors 6

Top changes

Experimental support for embedding resources

Thanks to the effort of @jchyb you can embed resources of your project and use them at runtime using Class[_].getResourceAsInputStream() in the same way as on the JVM. If you use some native sources in your project, e.g. written in C, you don’t need to worry about increased size of binary - all files in resources/scala-native directory would be ignored. To enable experimental support of this feature enable it in Native Config:

  nativeConfig ~= { _.withEmbedResources(true) }

More information about this new feature can be found here

New sbt plugin - ScalaNativeJUnitPlugin

In this release we have added a new sbt plugin dedicated for easier setup of JUnit tests framework. ScalaNativeJUnitPlugin is a port of similar feature from Scala.js - it allows you to forget about specifying dedicated library dependencies for tests runtime. It does also ensure that JUnit plugin would no longer be included in dependencies of downstream libraries.

When migrating to newer version of Scala Native you enable both Scala Native support and setup JUnit runtime with the current version using only one setting in your project enablePlugins(ScalaNativeJUnitPlugin). If building with a cross project you can use the following syntax to add it to the cross project: .nativeConfigure(_.enablePlugins(ScalaNativeJUnitPlugin)). Remember to remove the old settings needed for JUnit support:

addCompilerPlugin("org.scala-native" % "junit-plugin" % nativeVersion cross CrossVersion.full)
libraryDependencies += "org.scala-native" %%% "junit-runtime" % nativeVersion % Test

Improved Arm64 support

Last but not least we have improved our support for Arm64 architecture. This means that you can now use Scala Native on Apple M1 chips and Linux based arm64 devices.

Contributors

Big thanks to everybody who contributed to this release or reported an issue!

$ git shortlog -sn --no-merges v0.4.3..v0.4.4
    19	Wojciech Mazur
     4	Jan Chyb
     3	Eric K Richardson
     1	Arman Bilge
     1	Shadaj Laddad
     1	algobardo

Merged PRs

v0.4.4 (2022-03-02)

Full Changelog

Merged pull requests:

New features

Bug fixes

Misc