-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
78 lines (63 loc) · 2.28 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 com.heroku.sbt.HerokuPlugin.autoImport.{herokuIncludePaths, herokuProcessTypes}
import sbt.Keys._
import sbtassembly.MergeStrategy
import sbtcrossproject.CrossPlugin.autoImport.{CrossType, crossProject}
name := "EmplishList"
version := "0.2"
scalaVersion := "2.12.10"
scalacOptions ++= Seq(
"-deprecation",
"-feature"
)
lazy val `shared` = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.disablePlugins(HerokuPlugin)
.disablePlugins(sbtassembly.AssemblyPlugin)
.settings(
SharedSettings(),
addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.11.0" cross CrossVersion.full)
)
.jvmSettings(
SharedSettings.jvmSettings
)
lazy val sharedJVM = `shared`.jvm
lazy val sharedJS = `shared`.js
/** Backend server uses Play framework */
lazy val `backend` = (project in file("./backend"))
.enablePlugins(PlayScala)
.enablePlugins(SwaggerPlugin)
.settings(
BackendSettings(),
libraryDependencies += guice,
herokuAppName in Compile := "emplish-list",
herokuProcessTypes in Compile := Map(
"web" -> "target/universal/stage/bin/backend -Dhttp.port=$PORT" //,
//"worker" -> "java -jar target/universal/stage/lib/my-worker.jar"
),
herokuIncludePaths in Compile := Seq(
"backend/app",
"backend/conf/routes",
"backend/conf/application.conf",
"backend/public"
),
herokuSkipSubProjects in Compile := false,
swaggerDomainNameSpaces := Seq("models.emplishlist"),
libraryDependencies += "org.webjars" % "swagger-ui" % "2.2.0"
)
.dependsOn(sharedJVM)
/** Frontend will use react with Slinky */
lazy val `frontend` = (project in file("./frontend"))
.disablePlugins(HerokuPlugin)
.enablePlugins(ScalaJSBundlerPlugin)
.disablePlugins(sbtassembly.AssemblyPlugin)
.settings(FrontendSettings())
.dependsOn(sharedJS)
addCommandAlias("dev", ";frontend/fastOptJS::startWebpackDevServer;~frontend/fastOptJS")
addCommandAlias("build", "frontend/fullOptJS::webpack")
stage := {
val webpackValue = (frontend / Compile / fullOptJS / webpack).value
println(s"Webpack value is $webpackValue")
(stage in backend).value
}
//Compile / deployHeroku := (backend / Compile / deployHeroku).value
// sbt clean stage backend/deploy