Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gate
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openmole
gate
Commits
95f615d9
Commit
95f615d9
authored
Mar 28, 2017
by
Mathieu leclaire
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
To build.sbt, upgrade scalatra/jetty versions
parent
6c9b442e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
111 additions
and
129 deletions
+111
-129
build.sbt
build.sbt
+103
-0
ScalaWUIBuild.scala
project/ScalaWUIBuild.scala
+0
-120
build.properties
project/build.properties
+1
-1
build.sbt
project/build.sbt
+4
-3
ScalatraBootstrap.scala
server/src/main/scala/ScalatraBootstrap.scala
+3
-5
No files found.
build.sbt
0 → 100644
View file @
95f615d9
import
java.io.File
import
org.scalatra.sbt.ScalatraPlugin
import
org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
val
Organization
=
"fr.iscpif"
val
Name
=
"ScalaWUI"
val
Version
=
"0.1.0-SNAPSHOT"
val
ScalaVersion
=
"2.11.8"
val
scalatraVersion
=
"2.5.0"
val
jettyVersion
=
"9.2.19.v20160908"
val
json4sVersion
=
"3.3.0"
val
scalatagsVersion
=
"0.6.2"
val
autowireVersion
=
"0.2.6"
val
upickleVersion
=
"0.4.1"
val
rxVersion
=
"0.3.1"
val
scaladgetVersion
=
"0.8.1"
val
scalajsDomVersion
=
"0.9.1"
val
jqueryVersion
=
"2.2.1"
val
Resolvers
=
Seq
(
Resolver
.
sonatypeRepo
(
"snapshots"
),
"Typesafe repository"
at
"http://repo.typesafe.com/typesafe/releases/"
)
lazy
val
shared
=
project
.
in
(
file
(
"./shared"
)).
settings
(
scalaVersion
:=
ScalaVersion
)
val
jqueryPath
=
s
"META-INF/resources/webjars/jquery/$jqueryVersion/jquery.js"
lazy
val
client
=
project
.
in
(
file
(
"client"
))
settings
(
version
:=
Version
,
scalaVersion
:=
ScalaVersion
,
resolvers
in
ThisBuild
++=
Resolvers
,
skip
in
packageJSDependencies
:=
false
,
jsDependencies
+=
"org.webjars"
%
"d3js"
%
"3.5.12"
/
"d3.min.js"
,
//jsDependencies += "org.webjars" % "jquery" % "2.2.1" / "jquery.js",
jsDependencies
+=
"org.webjars"
%
"jquery"
%
jqueryVersion
/
jqueryPath
minified
jqueryPath
.
replace
(
".js"
,
".min.js"
),
jsDependencies
+=
"org.webjars"
%
"bootstrap"
%
"3.3.6"
/
"js/bootstrap.js"
dependsOn
jqueryPath
minified
"js/bootstrap.min.js"
,
// jsDependencies += "org.webjars" % "bootstrap" % "3.3.6" / "js/bootstrap.min.js",
libraryDependencies
++=
Seq
(
"com.lihaoyi"
%%%
"autowire"
%
autowireVersion
,
"com.lihaoyi"
%%%
"upickle"
%
upickleVersion
,
"com.lihaoyi"
%%%
"scalatags"
%
scalatagsVersion
,
"com.lihaoyi"
%%%
"scalarx"
%
rxVersion
,
"fr.iscpif"
%%%
"scaladget"
%
scaladgetVersion
,
"org.scala-js"
%%%
"scalajs-dom"
%
scalajsDomVersion
,
"org.json4s"
%%
"json4s-jackson"
%
json4sVersion
)
)
dependsOn
(
shared
)
enablePlugins
(
ScalaJSPlugin
)
lazy
val
server
=
project
.
in
(
file
(
"server"
))
settings
(
organization
:=
Organization
,
name
:=
Name
,
version
:=
Version
,
scalaVersion
:=
ScalaVersion
,
resolvers
++=
Resolvers
,
libraryDependencies
++=
Seq
(
"com.lihaoyi"
%%
"autowire"
%
autowireVersion
,
"com.lihaoyi"
%%
"upickle"
%
upickleVersion
,
"com.lihaoyi"
%%
"scalatags"
%
scalatagsVersion
,
"org.scalatra"
%%
"scalatra"
%
scalatraVersion
,
"ch.qos.logback"
%
"logback-classic"
%
"1.1.3"
%
"runtime"
,
"javax.servlet"
%
"javax.servlet-api"
%
"3.1.0"
%
"provided"
,
"org.eclipse.jetty"
%
"jetty-webapp"
%
jettyVersion
,
"org.eclipse.jetty"
%
"jetty-server"
%
jettyVersion
)
)
dependsOn
(
shared
)
enablePlugins
(
JettyPlugin
)
lazy
val
go
=
taskKey
[
Unit
](
"go"
)
lazy
val
bootstrap
=
project
.
in
(
file
(
"target/bootstrap"
))
settings
(
version
:=
Version
,
scalaVersion
:=
ScalaVersion
,
go
:=
{
val
clientTarget
=
(
fullOptJS
in
client
in
Compile
).
value
val
clientResource
=
(
resourceDirectory
in
client
in
Compile
).
value
val
serverTarget
=
(
target
in
server
in
Compile
).
value
copy
(
clientTarget
,
clientResource
,
new
File
(
serverTarget
,
"webapp"
))
}
)
dependsOn
(
client
,
server
)
def
copy
(
clientTarget
:
Attributed
[
File
],
resources
:
File
,
webappServerTarget
:
File
)
=
{
clientTarget
.
map
{
ct
=>
val
depName
=
ct
.
getName
.
replace
(
"opt.js"
,
"jsdeps.min.js"
)
recursiveCopy
(
new
File
(
resources
,
"webapp"
),
webappServerTarget
)
recursiveCopy
(
ct
,
new
File
(
webappServerTarget
,
"js/"
+
ct
.
getName
))
recursiveCopy
(
new
File
(
ct
.
getParent
,
depName
),
new
File
(
webappServerTarget
,
"js/"
+
depName
))
}
}
def
recursiveCopy
(
from
:
File
,
to
:
File
)
:
Unit
=
{
if
(
from
.
isDirectory
)
{
to
.
mkdirs
()
for
{
f
←
from
.
listFiles
()
}
recursiveCopy
(
f
,
new
File
(
to
,
f
.
getName
))
}
else
if
(!
to
.
exists
()
||
from
.
lastModified
()
>
to
.
lastModified
)
{
println
(
s
"Copy file $from to $to "
)
from
.
getParentFile
.
mkdirs
IO
.
copyFile
(
from
,
to
,
preserveLastModified
=
true
)
}
}
project/ScalaWUIBuild.scala
deleted
100644 → 0
View file @
6c9b442e
import
sbt._
import
Keys._
import
org.scalatra.sbt._
import
org.scalajs.sbtplugin.ScalaJSPlugin
import
org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
import
com.earldouglas.xwp._
import
java.io.File
object
ScalaWUIBuild
extends
Build
{
val
Organization
=
"fr.iscpif"
val
Name
=
"ScalaWUI"
val
Version
=
"0.1.0-SNAPSHOT"
val
ScalaVersion
=
"2.11.7"
val
scalatraVersion
=
"2.4.0"
val
jettyVersion
=
"9.3.7.v20160115"
val
json4sVersion
=
"3.3.0"
val
scalatagsVersion
=
"0.5.4"
val
autowireVersion
=
"0.2.5"
val
upickleVersion
=
"0.4.1"
val
rxVersion
=
"0.3.1"
val
scaladgetVersion
=
"0.8.1"
val
scalajsDomVersion
=
"0.9.0"
val
jqueryVersion
=
"2.2.1"
val
Resolvers
=
Seq
(
Resolver
.
sonatypeRepo
(
"snapshots"
),
"Typesafe repository"
at
"http://repo.typesafe.com/typesafe/releases/"
)
lazy
val
shared
=
project
.
in
(
file
(
"./shared"
)).
settings
(
scalaVersion
:=
ScalaVersion
)
val
jqueryPath
=
s
"META-INF/resources/webjars/jquery/$jqueryVersion/jquery.js"
lazy
val
client
=
Project
(
"client"
,
file
(
"client"
),
settings
=
Seq
(
version
:=
Version
,
scalaVersion
:=
ScalaVersion
,
resolvers
in
ThisBuild
++=
Resolvers
,
skip
in
packageJSDependencies
:=
false
,
jsDependencies
+=
"org.webjars"
%
"d3js"
%
"3.5.12"
/
"d3.min.js"
,
//jsDependencies += "org.webjars" % "jquery" % "2.2.1" / "jquery.js",
jsDependencies
+=
"org.webjars"
%
"jquery"
%
jqueryVersion
/
jqueryPath
minified
jqueryPath
.
replace
(
".js"
,
".min.js"
),
jsDependencies
+=
"org.webjars"
%
"bootstrap"
%
"3.3.6"
/
"js/bootstrap.js"
dependsOn
jqueryPath
minified
"js/bootstrap.min.js"
,
// jsDependencies += "org.webjars" % "bootstrap" % "3.3.6" / "js/bootstrap.min.js",
libraryDependencies
++=
Seq
(
"com.lihaoyi"
%%%
"autowire"
%
autowireVersion
,
"com.lihaoyi"
%%%
"upickle"
%
upickleVersion
,
"com.lihaoyi"
%%%
"scalatags"
%
scalatagsVersion
,
"com.lihaoyi"
%%%
"scalarx"
%
rxVersion
,
"fr.iscpif"
%%%
"scaladget"
%
scaladgetVersion
,
"org.scala-js"
%%%
"scalajs-dom"
%
scalajsDomVersion
,
"org.json4s"
%%
"json4s-jackson"
%
json4sVersion
)
)
).
dependsOn
(
shared
)
enablePlugins
(
ScalaJSPlugin
)
lazy
val
server
=
Project
(
"server"
,
file
(
"server"
),
settings
=
ScalatraPlugin
.
scalatraWithJRebel
++
Seq
(
organization
:=
Organization
,
name
:=
Name
,
version
:=
Version
,
scalaVersion
:=
ScalaVersion
,
resolvers
++=
Resolvers
,
libraryDependencies
++=
Seq
(
"com.lihaoyi"
%%
"autowire"
%
autowireVersion
,
"com.lihaoyi"
%%
"upickle"
%
upickleVersion
,
"com.lihaoyi"
%%
"scalatags"
%
scalatagsVersion
,
"org.scalatra"
%%
"scalatra"
%
scalatraVersion
,
"ch.qos.logback"
%
"logback-classic"
%
"1.1.3"
%
"runtime"
,
"javax.servlet"
%
"javax.servlet-api"
%
"3.1.0"
%
"provided"
,
"org.eclipse.jetty"
%
"jetty-webapp"
%
jettyVersion
%
"container"
)
)
).
dependsOn
(
shared
)
enablePlugins
(
JettyPlugin
)
lazy
val
go
=
taskKey
[
Unit
](
"go"
)
lazy
val
bootstrap
=
Project
(
"bootstrap"
,
file
(
"target/bootstrap"
),
settings
=
Seq
(
version
:=
Version
,
scalaVersion
:=
ScalaVersion
,
(
go
<<=
(
fullOptJS
in
client
in
Compile
,
resourceDirectory
in
client
in
Compile
,
target
in
server
in
Compile
)
map
{
(
ct
,
r
,
st
)
=>
copy
(
ct
,
r
,
new
File
(
st
,
"webapp"
))
}
)
)
)
dependsOn
(
client
,
server
)
private
def
copy
(
clientTarget
:
Attributed
[
File
],
resources
:
File
,
webappServerTarget
:
File
)
=
{
clientTarget
.
map
{
ct
=>
val
depName
=
ct
.
getName
.
replace
(
"opt.js"
,
"jsdeps.min.js"
)
recursiveCopy
(
new
File
(
resources
,
"webapp"
),
webappServerTarget
)
recursiveCopy
(
ct
,
new
File
(
webappServerTarget
,
"js/"
+
ct
.
getName
))
recursiveCopy
(
new
File
(
ct
.
getParent
,
depName
),
new
File
(
webappServerTarget
,
"js/"
+
depName
))
}
}
private
def
recursiveCopy
(
from
:
File
,
to
:
File
)
:
Unit
=
{
if
(
from
.
isDirectory
)
{
to
.
mkdirs
()
for
{
f
←
from
.
listFiles
()
}
recursiveCopy
(
f
,
new
File
(
to
,
f
.
getName
))
}
else
if
(!
to
.
exists
()
||
from
.
lastModified
()
>
to
.
lastModified
)
{
println
(
s
"Copy file $from to $to "
)
from
.
getParentFile
.
mkdirs
IO
.
copyFile
(
from
,
to
,
preserveLastModified
=
true
)
}
}
}
project/build.properties
View file @
95f615d9
sbt.version
=
0.13.
8
sbt.version
=
0.13.
13
project/build.sbt
View file @
95f615d9
resolvers
+=
"Typesafe repository"
at
resolvers
+=
"Typesafe repository"
at
"http://repo.typesafe.com/typesafe/releases/"
"http://repo.typesafe.com/typesafe/releases/"
addSbtPlugin
(
"
org.scala-js"
%
"sbt-scalajs"
%
"0.6.8
"
)
addSbtPlugin
(
"
com.github.mpeltonen"
%
"sbt-idea"
%
"1.5.1
"
)
addSbtPlugin
(
"org.scalatra.sbt"
%
"scalatra-sbt"
%
"0.5.1"
)
addSbtPlugin
(
"org.scalatra.sbt"
%
"scalatra-sbt"
%
"0.5.1"
)
addSbtPlugin
(
"org.scala-js"
%
"sbt-scalajs"
%
"0.6.14"
)
server/src/main/scala/ScalatraBootstrap.scala
View file @
95f615d9
import
fr.iscpif.app._
import
fr.iscpif.app._
import
org.scalatra._
import
org.scalatra._
import
javax.servlet.ServletContext
import
javax.servlet.ServletContext
import
scala.concurrent.ExecutionContext.Implicits.global
//
class
ScalatraBootstrap
extends
LifeCycle
{
class
ScalatraBootstrap
extends
LifeCycle
{
override
def
init
(
context
:
ServletContext
)
{
override
def
init
(
context
:
ServletContext
)
{
//val serv = new MyScalatraServlet
// pluginROutes.foreach{serv.addRoute}
context
.
mount
(
new
Servlet
,
"/*"
)
context
.
mount
(
new
Servlet
,
"/*"
)
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment