From 6df542547b636a9e225d982d483b85f33b4029b1 Mon Sep 17 00:00:00 2001 From: Moritz Lintterer Date: Tue, 11 Jul 2023 09:55:08 +0200 Subject: [PATCH] feat: adding play native loader --- build.sbt | 2 +- .../de/innfactory/play/common/PlayNativeLoader.scala | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 util-play/src/main/scala/de/innfactory/play/common/PlayNativeLoader.scala diff --git a/build.sbt b/build.sbt index 72c0a7b..9e063af 100755 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ import sbt._ //settings name := """scala-utils""" -val releaseVersion = "2.0.7" +val releaseVersion = "2.0.8" val token = sys.env.getOrElse("GITHUB_TOKEN", "") diff --git a/util-play/src/main/scala/de/innfactory/play/common/PlayNativeLoader.scala b/util-play/src/main/scala/de/innfactory/play/common/PlayNativeLoader.scala new file mode 100644 index 0000000..e8cf06f --- /dev/null +++ b/util-play/src/main/scala/de/innfactory/play/common/PlayNativeLoader.scala @@ -0,0 +1,10 @@ +package de.innfactory.play.common + +final class PlayNativeLoader { + + // native library and play class loader must be same. Thus loadLibrary must be called from a jar. + // https://github.com/playframework/playframework/issues/2212#issuecomment-58824866 + def load(name: String): Unit = + System.loadLibrary(name) + +}