Commit bcaf539c authored by Romain Reuillon's avatar Romain Reuillon
Browse files

[Lib] enh: update in preparation for 2.13

parent 0540bc40
Pipeline #438 passed with stage
in 14 minutes and 8 seconds
......@@ -17,13 +17,15 @@ def settings = Seq(
)
lazy val scalatraVersion = "2.6.3"
lazy val jettyVersion = "9.3.25.v20180904"
lazy val scalatraVersion = "2.7.0-RC1"
lazy val jettyVersion = "9.4.24.v20191120"
//lazy val jettyVersion = "9.3.25.v20180904"
lazy val scalatra = OsgiProject(dir, "org.scalatra",
exports = Seq("org.scalatra.*, org.fusesource.*", "grizzled.*", "org.eclipse.jetty.*", "javax.*"),
privatePackages = Seq("!scala.*", "!org.slf4j.*", "*"),
imports = Seq("scala.*", "org.slf4j.*")) settings(
privatePackages = Seq("!scala.*", "!org.slf4j.*", "**"),
imports = Seq("scala.*", "org.slf4j.*"),
global = true) settings(
libraryDependencies += "org.scalatra" %% "scalatra" % scalatraVersion,
libraryDependencies += "org.scalatra" %% "scalatra-auth" % scalatraVersion,
libraryDependencies += "org.eclipse.jetty" % "jetty-webapp" % jettyVersion,
......@@ -63,7 +65,7 @@ lazy val h2 = OsgiProject(dir, "org.h2", dynamicImports = Seq("*"), privatePacka
(libraryDependencies += "com.h2database" % "h2" % h2Version, version := h2Version) settings(settings: _*)
lazy val bonecp = OsgiProject(dir, "com.jolbox.bonecp", dynamicImports = Seq("*")) settings
(libraryDependencies += "com.jolbox" % "bonecp" % "0.8.0-rc1", version := "0.8.0-rc1") settings(settings: _*)
(libraryDependencies += "com.jolbox" % "bonecp" % "0.8.0.RELEASE", version := "0.8.0.RELEASE") settings(settings: _*)
lazy val slickVersion = "3.3.0"
lazy val slick = OsgiProject(dir,"com.typesafe.slick", exports = Seq("slick.*"), privatePackages = Seq("org.reactivestreams.*")) settings
......@@ -164,7 +166,7 @@ lazy val scalaTagsVersion = "0.6.5"
lazy val scalaRxVersion = "0.4.0"
lazy val scalaDomVersion = "0.9.3"
lazy val scalaUpickleVersion = "0.4.4"
lazy val scalaBoopickleVersion = "1.2.6"
lazy val scalaBoopickleVersion = "1.3.1"
lazy val scalaAutowireVersion = "0.2.6"
lazy val scalajsVersion = "0.6.31"
......@@ -275,8 +277,8 @@ lazy val scopt = OsgiProject(dir, "com.github.scopt", exports = Seq("scopt.*"))
lazy val async =
OsgiProject(dir, "scala-async") settings (
libraryDependencies += "org.scala-lang.modules" %% "scala-async" % "0.9.6",
version := "0.9.6",
libraryDependencies += "org.scala-lang.modules" %% "scala-async" % "0.10.0",
version := "0.10.0",
exportPackage := Seq("scala.async.*")) settings(settings: _*)
lazy val mathVersion = "3.6.1"
......
......@@ -644,7 +644,7 @@ lazy val clientToolGUI = OsgiProject(guiClientDir, "org.openmole.gui.client.tool
def guiServerDir = guiDir / "server"
lazy val serverGUI = OsgiProject(guiServerDir, "org.openmole.gui.server.core") settings
lazy val serverGUI = OsgiProject(guiServerDir, "org.openmole.gui.server.core", dynamicImports = Seq("org.eclipse.jetty.*")) settings
(libraryDependencies ++= Seq(Libraries.arm, Libraries.autowire, Libraries.boopickle, Libraries.circe, Libraries.scalaTags, Libraries.logback, Libraries.scalatra, Libraries.clapper, Libraries.opencsv)) dependsOn(
sharedGUI,
dataGUI,
......
......@@ -19,25 +19,19 @@ package org.openmole.gui.server.core
import java.util.concurrent.Semaphore
import javax.servlet.http.{ HttpServletRequest, HttpServletResponse }
import org.eclipse.jetty.server.{ Server, ServerConnector }
import org.eclipse.jetty.servlet.DefaultServlet
import org.eclipse.jetty.webapp._
import org.openmole.core.workspace.{ TmpDirectory, Workspace }
import org.scalatra.servlet.ScalatraListener
import javax.servlet.ServletContext
import org.scalatra._
import org.eclipse.jetty.server.{ Server, ServerConnector }
import org.eclipse.jetty.util.resource.{ Resource Res }
import org.eclipse.jetty.webapp._
import org.openmole.core.fileservice.FileService
import org.openmole.core.location._
import org.openmole.core.preference.{ ConfigurationLocation, Preference }
import org.openmole.tool.hash._
import org.openmole.tool.file._
import org.openmole.core.services._
import org.openmole.core.workspace.{ TmpDirectory, Workspace }
import org.openmole.tool.crypto.KeyStore
import org.openmole.tool.file._
import org.openmole.tool.network.Network
import org.openmole.core.location._
import scala.xml.XML
import org.scalatra._
import org.scalatra.servlet.ScalatraListener
object GUIServer {
......@@ -122,17 +116,19 @@ class StartingPage extends ScalatraServlet with LifeCycle {
}
import GUIServer._
import org.openmole.gui.server.core.GUIServer._
class GUIServer(port: Int, localhost: Boolean, http: Boolean, services: GUIServices, password: Option[String], extraHeader: String, optimizedJS: Boolean, subDir: Option[String]) {
val server = new Server()
lazy val server = new Server()
var exitStatus: GUIServer.ExitStatus = GUIServer.Ok
val semaphore = new Semaphore(0)
import services._
def start() = {
//org.eclipse.jetty.util.log.Log.setLog(new log.StdErrLog())
lazy val contextFactory = {
val contextFactory = new org.eclipse.jetty.util.ssl.SslContextFactory()
......@@ -149,16 +145,19 @@ class GUIServer(port: Int, localhost: Boolean, http: Boolean, services: GUIServi
val connector = if (!http) new ServerConnector(server, contextFactory) else new ServerConnector(server)
connector.setPort(port)
if (!localhost) connector.setHost("localhost")
server.addConnector(connector)
val startingContext = new WebAppContext()
startingContext.setContextPath(subDir.map { s "/" + s }.getOrElse("") + "/")
startingContext.setBaseResource(Res.newResource(classOf[StartingPage].getClassLoader.getResource("/")))
startingContext.setClassLoader(classOf[StartingPage].getClassLoader)
startingContext.setInitParameter(ScalatraListener.LifeCycleKey, classOf[StartingPage].getCanonicalName)
startingContext.setResourceBase(fromWebAppLocation.getAbsolutePath)
startingContext.setContextPath("/")
startingContext.setContextPath(subDir.map { s "/" + s }.getOrElse("") + "/")
startingContext.addEventListener(new ScalatraListener)
server.setHandler(startingContext)
......@@ -182,8 +181,6 @@ class GUIServer(port: Int, localhost: Boolean, http: Boolean, services: GUIServi
context.setContextPath(subDir.map { s "/" + s }.getOrElse("") + "/")
import services._
context.setResourceBase(webappCache.getAbsolutePath)
context.setClassLoader(classOf[GUIServer].getClassLoader)
context.setInitParameter(ScalatraListener.LifeCycleKey, classOf[GUIBootstrap].getCanonicalName)
......
......@@ -21,7 +21,7 @@ import java.nio.ByteBuffer
import org.scalatra._
import org.scalatra.auth.{ ScentryConfig, ScentrySupport }
import org.scalatra.auth.strategy.BasicAuthSupport
import org.scalatra.servlet.{ FileItem, FileUploadSupport, MultipartConfig }
import org.scalatra.servlet.{ FileItem, FileSingleParams, FileUploadSupport, MultipartConfig }
import org.scalatra.util.MultiMapHeadView
import boopickle.Default._
......@@ -182,7 +182,7 @@ class GUIServlet(val arguments: GUIServer.ServletArguments) extends ScalatraServ
}.sorted
def recordUser(u: UserID) = {
session.put(USER_ID, u)
session.setAttribute(USER_ID, u)
// connectedUsers() = connectedUsers.now :+ u
}
......@@ -233,9 +233,10 @@ class GUIServlet(val arguments: GUIServer.ServletArguments) extends ScalatraServ
}
post(uploadFilesRoute) {
def move(fileParams: MultiMapHeadView[String, FileItem], fileType: String) = {
def move(fileParams: FileSingleParams, fileType: String) = {
def copyTo(rootFile: File) =
for (file fileParams) yield {
for (file fileParams) {
val path = new java.net.URI(file._1).getPath
val destination = new File(rootFile, path)
destination.getParentFile.mkdirs()
......@@ -246,7 +247,6 @@ class GUIServlet(val arguments: GUIServer.ServletArguments) extends ScalatraServ
destination.setExecutable(true)
}
finally stream.close
destination
}
fileType match {
......
......@@ -18,7 +18,7 @@ object Libraries {
lazy val scalaTagsVersion = "0.6.5"
lazy val scalaJSDomVersion = "0.9.3"
lazy val rxVersion = "0.4.0"
lazy val boopickleVersion = "1.2.6"
lazy val boopickleVersion = "1.3.1"
lazy val scalaAutowireVersion = "0.2.6"
lazy val sourcecodeVersion = "0.1.9"
lazy val scaladgetVersion = "1.2.7"
......@@ -29,6 +29,7 @@ object Libraries {
lazy val scalajsVersion = "0.6.31"
lazy val squantsVersion = "1.6.0"
lazy val xstreamVersion = "1.4.11.1"
lazy val scalatraVersion = "2.7.0-RC1"
lazy val scalaURIVersion = "1.1.1"
lazy val scoptVersion = "3.7.1"
lazy val spatialdataVersion = "0.2"
......@@ -51,6 +52,7 @@ object Libraries {
lazy val scalatest = "org.scalatest" %% "scalatest" % "3.0.5" % "test"
/** ------- Bundles -------------- */
def addScalaLang(scalaVersion: String) =
......@@ -59,10 +61,10 @@ object Libraries {
"org.scalameta" %% "scalameta" % "4.1.0"
)
lazy val scalatra = "org.openmole.library" %% "org-scalatra" % "2.6.3"
lazy val scalatra = "org.openmole.library" %% "org-scalatra" % scalatraVersion
lazy val logback = "org.openmole.library" %% "ch-qos-logback" % "1.0.9"
lazy val h2 = "org.openmole.library" %% "org-h2" % "1.4.199"
lazy val bonecp = "org.openmole.library" %% "com-jolbox-bonecp" % "0.8.0-rc1"
lazy val bonecp = "org.openmole.library" %% "com-jolbox-bonecp" % "0.8.0.RELEASE"
lazy val slick = "org.openmole.library" %% "com-typesafe-slick" % "3.3.0"
lazy val slf4j = "org.openmole.library" %% "org-slf4j" % "1.7.10"
lazy val xstream = "org.openmole.library" %% "com-thoughtworks-xstream" % xstreamVersion
......@@ -81,7 +83,7 @@ object Libraries {
lazy val lang3 = "org.openmole.library" %% "org-apache-commons-lang3" % "3.4"
lazy val ant = "org.openmole.library" %% "org-apache-ant" % "1.8.0"
lazy val codec = "org.openmole.library" %% "org-apache-commons-codec" % "1.13"
lazy val async = "org.openmole.library" %% "scala-async" % "0.9.6"
lazy val async = "org.openmole.library" %% "scala-async" % "0.10.0"
lazy val jgit = "org.openmole.library" %% "org-eclipse-jgit" % "4.11"
lazy val cats = "org.openmole.library" %% "cats" % catsVersion
lazy val squants = "org.openmole.library" %% "squants" % squantsVersion
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment