-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
62 lines (56 loc) · 2.43 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
name := "event-rest-service"
organization := "com.arisanet"
version := "0.1.0"
scalaVersion := "2.11.8"
libraryDependencies ++= {
val akkaV = "2.4.11"
val scalaTestV = "3.0.0"
val slickVersion = "3.1.1"
val circeV = "0.6.1"
Seq(
"com.typesafe.akka" %% "akka-http-core" % akkaV,
"com.typesafe.akka" %% "akka-http-experimental" % akkaV,
"de.heikoseeberger" %% "akka-http-circe" % "1.11.0",
"com.typesafe.slick" %% "slick" % slickVersion,
"com.typesafe.slick" %% "slick-codegen" % slickVersion % "compile",
"com.github.tminglei" %% "slick-pg" % "0.14.4",
"com.typesafe.slick" %% "slick" % "3.1.1",
"com.github.tminglei" %% "slick-pg" % "0.15.0-M3",
"com.github.tminglei" %% "slick-pg_joda-time" % "0.15.0-M3",
"com.github.tminglei" %% "slick-pg_circe-json" % "0.15.0-M3",
"com.github.tminglei" %% "slick-pg_jts" % "0.15.0-M3",
"com.github.tminglei" %% "slick-pg_json4s" % "0.15.0-M3",
"com.github.tminglei" %% "slick-pg_play-json" % "0.15.0-M3",
"com.github.tminglei" %% "slick-pg_spray-json" % "0.15.0-M3",
"com.github.tminglei" %% "slick-pg_argonaut" % "0.15.0-M3",
"org.postgresql" % "postgresql" % "9.4-1201-jdbc41",
"org.flywaydb" % "flyway-core" % "3.2.1",
"com.zaxxer" % "HikariCP" % "2.4.5",
"org.slf4j" % "slf4j-nop" % "1.6.4",
"io.circe" %% "circe-core" % circeV,
"io.circe" %% "circe-generic" % circeV,
"io.circe" %% "circe-parser" % circeV,
"org.scalatest" %% "scalatest" % scalaTestV % "test",
"com.typesafe.akka" %% "akka-http-testkit" % akkaV % "test",
"ru.yandex.qatools.embed" % "postgresql-embedded" % "1.15" % "test"
)
}
Revolver.settings
enablePlugins(JavaAppPackaging)
enablePlugins(DockerPlugin)
dockerExposedPorts := Seq(9004)
dockerEntrypoint := Seq("bin/%s" format executableScriptName.value, "-Dconfig.resource=docker.conf")
fork in run := true
slick <<= slickCodeGenTask; // register manual sbt command
// code generation task that calls the customized code generator
lazy val slick = taskKey[Seq[File]]("gen-tables")
lazy val slickCodeGenTask = Def.task {
val dir = sourceManaged.value
val cp = (dependencyClasspath in Compile).value
val r = (runner in Compile).value
val s = streams.value
val outputDir = (dir / "slick").getPath // place generated files in sbt's managed sources folder
toError(r.run("demo.CustomizedCodeGenerator", cp.files, Array(outputDir), s.log))
val fname = outputDir + "/demo/Tables.scala"
Seq(file(fname))
}