123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- lazy val akkaHttpSlickPostgres =
- project
- .in(file("."))
- .enablePlugins(
- GitBranchPrompt,
- GitVersioning,
- JavaAppPackaging,
- DockerPlugin,
- AshScriptPlugin
- )
- .settings(settings)
- .settings(
- name := "akka-http-slick-postgres",
- mainClass in Compile := Some("net.benchmark.akka.http.Main"),
- libraryDependencies ++= Seq(
- library.akkaHttp,
- library.akkaHttpCirce,
- library.akkaSlf4j,
- library.akkaStream,
- library.logbackClassic,
- library.postgresql,
- library.scalateCore,
- library.slick,
- library.slickHikariCP,
- ),
- parallelExecution in Test := true
- )
- lazy val library =
- new {
- object Version {
- val akka = "2.5.22"
- val akkaHttp = "10.1.8"
- val akkaHttpCirce = "1.23.0"
- val logback = "1.2.3"
- val postgresql = "42.2.5"
- val scalate = "1.9.1"
- val slick = "3.3.0"
- }
- val akkaHttp = "com.typesafe.akka" %% "akka-http" % Version.akkaHttp
- val akkaHttpCirce = "de.heikoseeberger" %% "akka-http-circe" % Version.akkaHttpCirce
- val akkaSlf4j = "com.typesafe.akka" %% "akka-slf4j" % Version.akka
- val akkaStream = "com.typesafe.akka" %% "akka-stream" % Version.akka
- val logbackClassic = "ch.qos.logback" % "logback-classic" % Version.logback
- val postgresql = "org.postgresql" % "postgresql" % Version.postgresql
- val scalateCore = "org.scalatra.scalate" %% "scalate-core" % Version.scalate
- val slick = "com.typesafe.slick" %% "slick" % Version.slick
- val slickHikariCP = "com.typesafe.slick" %% "slick-hikaricp" % Version.slick
- }
- lazy val settings =
- commonSettings ++
- gitSettings ++
- packagingSettings ++
- scalafmtSettings
- lazy val commonSettings =
- Seq(
- organization := "net.benchmark.akka.http",
- organizationName := "Akka",
- scalaVersion := "2.12.8",
- scalacOptions ++= Seq(
- "-deprecation",
- "-encoding",
- "UTF-8",
- "-explaintypes",
- "-feature",
- "-target:jvm-1.8",
- "-unchecked",
- "-Xfatal-warnings",
- "-Xfuture",
- "-Xlint",
- "-Ydelambdafy:method",
- "-Yno-adapted-args",
- "-Ypartial-unification",
- "-Ywarn-numeric-widen",
- "-Ywarn-unused-import",
- "-Ywarn-value-discard"
- ),
- scalacOptions in (Compile, console) --= Seq("-Xfatal-warnings"), // Relax settings for console
- scalacOptions in (Test, console) --= Seq("-Xfatal-warnings"), // Relax settings for console
- javacOptions ++= Seq(
- "-encoding",
- "UTF-8",
- "-source",
- "1.8",
- "-target",
- "1.8"
- ),
- javaOptions ++= Seq(
- "-jvm-debug 5555"
- ),
- transitiveClassifiers := Seq("sources"),
- publishArtifact in (Compile, packageDoc) := false,
- unmanagedSourceDirectories.in(Compile) := Seq(scalaSource.in(Compile).value),
- unmanagedSourceDirectories.in(Test) := Seq(scalaSource.in(Test).value),
- wartremoverWarnings in (Compile, compile) ++= Warts.unsafe
- )
- lazy val gitSettings =
- Seq(
- git.useGitDescribe := true
- )
- lazy val packagingSettings =
- Seq(
- mappings in Universal += {
- // we are using the reference.conf as default application.conf
- // the user can override settings here
- val conf = (resourceDirectory in Compile).value / "reference.conf"
- conf -> "conf/application.conf"
- },
- scriptClasspath := Seq("../conf/") ++ scriptClasspath.value,
- daemonUser.in(Docker) := "root",
- maintainer.in(Docker) := "sourcekick",
- version.in(Docker) := version.value,
- dockerBaseImage := "openjdk:jre-alpine",
- dockerExposedPorts := Seq(8080),
- dockerExposedVolumes in Docker := Seq("/config"),
- mappings in Universal += {
- var appjar = (packageBin in Test).value
- appjar -> s"lib/${appjar.getName}"
- }
- )
- lazy val scalafmtSettings =
- Seq(
- scalafmtOnCompile := true,
- scalafmtOnCompile.in(Sbt) := false,
- scalafmtVersion := "1.5.1"
- )
|