-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
executable file
·102 lines (87 loc) · 3.75 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
val Organization = "simpark"
val Name = "simparc-UI"
val Version = "0.1.0-SNAPSHOT"
val ScalaVersion = "2.12.8"
val scalatraVersion = "2.5.1"
val jettyVersion = "9.4.6.v20170531"
val json4sVersion = "3.5.2"
val scalatagsVersion = "0.6.7"
val autowireVersion = "0.2.6"
val boopickleVersion = "1.2.6"
val rxVersion = "0.4.0"
val scaladgetVersion = "1.2.1"
val scalajsDomVersion = "0.9.3"
val betterFilesVersion = "3.2.0"
val Resolvers = Seq(Resolver.sonatypeRepo("snapshots"),
Resolver.sonatypeRepo("releases"),
Resolver.bintrayRepo("definitelyscala", "maven"),
"Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
)
def viabilitreeVersion = "2.0"
lazy val shared = project.in(file("shared")).settings(
scalaVersion := ScalaVersion
) enablePlugins (ScalaJSPlugin)
lazy val client = project.in(file("client")) settings(
version := Version,
scalaVersion := ScalaVersion,
resolvers in ThisBuild ++= Resolvers,
libraryDependencies ++= Seq(
"com.lihaoyi" %%% "autowire" % autowireVersion,
"io.suzaku" %%% "boopickle" % boopickleVersion,
"com.lihaoyi" %%% "scalatags" % scalatagsVersion,
"com.lihaoyi" %% "scalarx" % rxVersion,
"fr.iscpif" %% "scaladget" % scaladgetVersion,
"org.scala-js" %%% "scalajs-dom" % scalajsDomVersion,
"org.json4s" %% "json4s-jackson" % json4sVersion,
"fr.iscpif.scaladget" %%% "bootstrapnative" % scaladgetVersion,
"fr.iscpif.scaladget" %%% "tools" % scaladgetVersion,
"fr.iscpif.scaladget" %%% "bootstrapslider" % scaladgetVersion,
"com.definitelyscala" %%% "scala-js-plotlyjs" % "1.1.8",
"com.lihaoyi" %%% "sourcecode" % "0.1.2"
)
) 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,
"io.suzaku" %% "boopickle" % boopickleVersion,
"com.lihaoyi" %% "scalatags" % scalatagsVersion,
"org.scalatra" %% "scalatra" % scalatraVersion,
//"se.scalablesolutions.akka" %% "akka-util" % "0.8.1",
"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,
"com.github.pathikrit" %% "better-files" % betterFilesVersion
)
) dependsOn (shared, model) enablePlugins (ScalatraPlugin)
lazy val model = project.in(file("model")) enablePlugins(SbtOsgi) settings (
organization := Organization,
libraryDependencies += "fr.iscpif.viabilitree" %% "export" % viabilitreeVersion,
libraryDependencies += "fr.iscpif.viabilitree" %% "viability" % viabilitreeVersion,
OsgiKeys.exportPackage := Seq("simpark.*"),
OsgiKeys.importPackage := Seq("*;resolution:=optional"),
OsgiKeys.privatePackage := Seq("!scala.*,*"),
OsgiKeys.requireCapability := """osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"""",
osgiSettings
)
lazy val go = taskKey[Unit]("go")
lazy val bootstrap = project.in(file("target/bootstrap")) settings(
version := Version,
scalaVersion := ScalaVersion,
go := {
val demoTarget = (target in server in Compile).value
val demoResource = (resourceDirectory in client in Compile).value
val webappTarget = demoTarget / "webapp"
val demoJS = (fullOptJS in client in Compile).value
IO.copyFile(demoJS.data, webappTarget / "js/viaduc.js")
IO.copyFile(dependencyFile.value, webappTarget / "js/deps.js")
IO.copyDirectory(cssFile.value, webappTarget / "css/")
IO.copyDirectory(demoResource, demoTarget)
}
) dependsOn(client, server) enablePlugins (ExecNpmPlugin)