-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sbt
More file actions
45 lines (31 loc) · 1.38 KB
/
build.sbt
File metadata and controls
45 lines (31 loc) · 1.38 KB
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
import com.typesafe.sbt.packager.MappingsHelper._
mappings in Universal ++= directory(baseDirectory.value / "public")
name := "PackVex"
version := "1.1"
scalaVersion := "2.12.2"
lazy val `play-vue-webpack` = (project in file(".")).enablePlugins(PlayScala)
libraryDependencies ++= Seq(guice, filters, jdbc , cacheApi ,ws , specs2 % Test)
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.5" % "test"
libraryDependencies += "org.scalactic" %% "scalactic" % "3.0.5"
libraryDependencies += "com.github.tototoshi" %% "scala-csv" % "1.3.6"
// Play framework hooks for development
PlayKeys.playRunHooks += WebpackServer(file("./front"))
unmanagedResourceDirectories in Test += baseDirectory ( _ /"target/web/public/test" ).value
resolvers += "scalaz-bintray" at "https://dl.bintray.com/scalaz/releases"
// Production front-end build
lazy val cleanFrontEndBuild = taskKey[Unit]("Remove the old front-end build")
cleanFrontEndBuild := {
val d = file("public/bundle")
if (d.exists()) {
d.listFiles.foreach(f => {
if(f.isFile) f.delete
})
}
}
lazy val frontEndBuild = taskKey[Unit]("Execute the npm build command to build the front-end")
frontEndBuild := {
println(Process("npm install", file("front")).!!)
println(Process("npm run build", file("front")).!!)
}
frontEndBuild := (frontEndBuild dependsOn cleanFrontEndBuild).value
dist := (dist dependsOn frontEndBuild).value