forked from mmx900/scalajs-angular-material-start
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
78 lines (68 loc) · 2.87 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
import PlayKeys._
import com.typesafe.sbt.packager.universal.Keys.dist
import com.typesafe.sbt.packager.Keys.stage
name := "scalajs-angular-material-start"
scalaVersion in ThisBuild := "2.11.6"
val scalajsOutputDir = Def.settingKey[File]("directory for javascript files output by scalajs")
val crossTargetSettings =
Seq(
packageJSDependencies,
fastOptJS,
fullOptJS)
.map {
task => crossTarget in (client, Compile, task) := scalajsOutputDir.value
}
resolvers in ThisBuild += Resolver.sonatypeRepo("snapshots")
lazy val server = (project in file("scalajvm"))
.enablePlugins(PlayScala)
.enablePlugins(SbtWeb)
.settings(
name := "example-server",
scalajsOutputDir := (crossTarget in Compile).value / "classes" / "public" / "js",
compile in Compile <<= (compile in Compile) dependsOn (fastOptJS in (client, Compile)),
stage <<= stage dependsOn (fullOptJS in (client, Compile)),
dist <<= dist dependsOn (fullOptJS in (client, Compile)),
libraryDependencies ++= Seq(
"org.webjars" % "angular-material" % "0.7.1"
))
.settings(crossTargetSettings: _*)
.dependsOn(common)
.aggregate(client)
lazy val client = (project in file("scalajs"))
.enablePlugins(ScalaJSPlugin)
.settings(
name := "example-client",
unmanagedSourceDirectories in Compile := (scalaSource in Compile).value ::(scalaSource in Test).value :: Nil,
unmanagedSourceDirectories in Test := (scalaSource in Test).value :: Nil,
libraryDependencies ++= Seq(
"com.greencatsoft" %%% "scalajs-angular" % "0.6"),
jsDependencies ++= Seq(
"org.webjars" % "angularjs" % "1.3.15" / "angular.js",
"org.webjars" % "angularjs" % "1.3.15" / "angular-route.js" dependsOn "angular.js",
"org.webjars" % "angularjs" % "1.3.15" / "angular-animate.js" dependsOn "angular.js",
"org.webjars" % "angularjs" % "1.3.15" / "angular-aria.js" dependsOn "angular.js",
"org.webjars" % "angularjs" % "1.3.15" / "angular-locale_ko.js" dependsOn "angular.js",
"org.webjars" % "angular-material" % "0.7.1" / "angular-material.js" dependsOn "angular.js",
RuntimeDOM),
skip in packageJSDependencies := false,
relativeSourceMaps := true
)
.dependsOn(common)
lazy val common = (project in file("scala"))
.enablePlugins(ScalaJSPlugin)
.settings(
name := "example-common",
unmanagedSourceDirectories in Compile := (scalaSource in Compile).value :: Nil,
unmanagedSourceDirectories in Test := (scalaSource in Test).value :: Nil,
libraryDependencies ++= Seq(
"org.scala-js" %% "scalajs-stubs" % scalaJSVersion),
relativeSourceMaps := true
)
commands += Command.command("playme")((state: State) => {
var newState = state
//newState = Command.process("clean", newState)
newState = Command.process("compile", newState)
newState = Command.process("project server", newState)
newState = Command.process("run", newState)
newState
})