diff --git a/Dockerfile b/Dockerfile index 7d74b39..e91959a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,8 @@ # based on https://hub.docker.com/r/hseeberger/scala-sbt/dockerfile -ENV SCALA_VERSION 2.12.8 -ENV SBT_VERSION 1.2.8 +ENV SCALA_VERSION 2.13.4 +ENV SBT_VERSION 1.4.7 RUN \ apk add --no-cache curl bash && \ @@ -13,7 +13,8 @@ ENV PATH "${SCALA_HOME}/bin:${PATH}" RUN \ - curl -fsL https://piccolo.link/sbt-${SBT_VERSION}.tgz | tar xfz - -C /usr/local/ && \ + curl -fsL https://github.com/sbt/sbt/releases/download/v${SBT_VERSION}/sbt-${SBT_VERSION}.tgz | tar xfz - -C /usr/local/ && \ + cd /usr/local && \ /usr/local/sbt/bin/sbt sbtVersion ENV PATH "/usr/local/sbt/bin:${PATH}" @@ -25,4 +26,4 @@ RUN sbt assembly FROM openjdk:8-alpine -COPY --from=assembly /usr/local/src/target/scala-2.12/sparql-test-runner /usr/local/bin/ +COPY --from=assembly /usr/local/src/target/scala-2.13/sparql-test-runner /usr/local/bin/ diff --git a/build.sbt b/build.sbt index e1e4e1c..13761f1 100644 --- a/build.sbt +++ b/build.sbt @@ -1,34 +1,40 @@ import sbtassembly.AssemblyPlugin.defaultShellScript -name := "sparql-test-runner" +ThisBuild / scalaVersion := "2.13.4" +ThisBuild / organizationName := "Alex Tucker" -version := "1.3" - -organizationName := "Alex Tucker" - -startYear := Some(2018) - -licenses += ("Apache-2.0", new URL("https://www.apache.org/licenses/LICENSE-2.0.txt")) - -scalaVersion := "2.13.4" - -libraryDependencies ++= Seq( - "org.apache.jena" % "jena-arq" % "3.6.0", - "org.apache.jena" % "jena-cmds" % "3.6.0", - "com.github.scopt" %% "scopt" % "4.0.0", - "org.scala-lang.modules" %% "scala-xml" % "1.3.0" +lazy val sparqlTestRunner = (project in file(".")) + .enablePlugins(NativeImagePlugin) + .settings( + name := "sparql-test-runner", + version := "1.4", + Compile / mainClass := Some("uk.org.floop.sparqlTestRunner.Run"), + nativeImageOptions ++= List( + "-H:+ReportExceptionStackTraces", + "--no-fallback", + "--allow-incomplete-classpath", + "-H:ResourceConfigurationFiles=../../configs/resource-config.json", + "-H:ReflectionConfigurationFiles=../../configs/reflect-config.json", + "-H:JNIConfigurationFiles=../../configs/jni-config.json", + "-H:DynamicProxyConfigurationFiles=../../configs/proxy-config.json", + "-H:EnableURLProtocols=https"), + libraryDependencies ++= Seq( + "org.apache.jena" % "jena-arq" % "3.17.0", + "org.apache.jena" % "jena-cmds" % "3.17.0", + "com.github.scopt" %% "scopt" % "4.0.0", + "org.scala-lang.modules" %% "scala-xml" % "1.3.0", + "org.slf4j" % "slf4j-simple" % "1.7.30", + "xerces" % "xercesImpl" % "2.12.1" + ), + assemblyMergeStrategy in assembly := { + case "module-info.class" => MergeStrategy.discard + case PathList("org", "apache", "commons", "logging", xs @ _*) => MergeStrategy.first + case PathList("org", "apache", "jena", "tdb", "tdb-properties.xml") => MergeStrategy.first + case x => + val oldStrategy = (assemblyMergeStrategy in assembly).value + oldStrategy(x) + }, + mainClass in assembly := Some("uk.org.floop.sparqlTestRunner.Run"), + assemblyOption in assembly := (assemblyOption in assembly).value.copy(prependShellScript = Some(defaultShellScript)), + assemblyJarName in assembly := "sparql-test-runner" ) - -mainClass in assembly := Some("uk.org.floop.sparqlTestRunner.Run") - -assemblyMergeStrategy in assembly := { - case PathList("org", "apache", "commons", "logging", xs @ _*) => MergeStrategy.first - case PathList("org", "apache", "jena", "tdb", "tdb-properties.xml") => MergeStrategy.first - case x => - val oldStrategy = (assemblyMergeStrategy in assembly).value - oldStrategy(x) -} - -assemblyOption in assembly := (assemblyOption in assembly).value.copy(prependShellScript = Some(defaultShellScript)) - -assemblyJarName in assembly := "sparql-test-runner" diff --git a/project/plugins.sbt b/project/plugins.sbt index 14a6ca1..d8e89cb 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1 +1,3 @@ -logLevel := Level.Warn \ No newline at end of file +logLevel := Level.Warn +addSbtPlugin("org.scalameta" % "sbt-native-image" % "0.3.0") +addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.10.0-RC1") \ No newline at end of file