Workaround for Guice Java 11 bug

main
Oliver Kennedy 2023-06-04 11:22:41 -04:00
parent 4b1803ee73
commit 0e90043cf8
Signed by: okennedy
GPG Key ID: 3E5F9B3ABD3FDB60
1 changed files with 18 additions and 0 deletions

View File

@ -8,6 +8,24 @@ object shingle extends ScalaModule
def mainClass = Some("net.okennedy.shingle.Shingle")
def ammoniteVersion = "2.5.3"
def internalJavaVersion = T {
try {
val jvm = System.getProperties().getProperty("java.version")
println(f"Running Vizier with `${jvm}`")
jvm.split("\\.")(0).toInt
} catch {
case _:NumberFormatException | _:ArrayIndexOutOfBoundsException => 8
}
}
def forkArgs = T {
if(internalJavaVersion() >= 11){
Seq(
// Needed workaround for GUICE permissions bug (dependency in MQTT)
"--add-opens", "java.base/java.lang=ALL-UNNAMED"
)
} else { Seq[String]() }
}
def ivyDeps = Agg(
ivy"com.lihaoyi::ujson:2.0.0",