-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sbt
More file actions
54 lines (46 loc) · 1.89 KB
/
build.sbt
File metadata and controls
54 lines (46 loc) · 1.89 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
46
47
48
49
50
51
52
53
54
name := "GarconZIO"
version := "0.1-SNAPSHOT"
scalaVersion := "2.12.8"
lazy val zioTestFramework = new TestFramework("zio.test.sbt.ZTestFramework")
lazy val translator = project in file("translator")
translator / libraryDependencies ++= TranslatorDependencies.all
translator / testFrameworks += zioTestFramework
lazy val telegram = project in file("telegram")
telegram / libraryDependencies ++= TelegramDependencies.all
telegram / testFrameworks += zioTestFramework
lazy val zioLogging = project in file("zio-logging")
zioLogging / libraryDependencies ++= ZioLoggingDependencies.all
lazy val root = (project in file("."))
.dependsOn(translator, telegram, zioLogging)
.aggregate(translator, telegram, zioLogging)
root / libraryDependencies ++= Dependencies.all
root / testFrameworks += zioTestFramework
root / mainClass in Compile := Some("dev.shvimas.garcon.Main")
root / PB.protocVersion := "-v300"
root / PB.targets in Compile := Seq(scalapb.gen() -> (root / sourceManaged in Compile).value)
root / scalacOptions ++= Seq(
"-feature",
"-Xfatal-warnings",
"-Ypartial-unification",
"-deprecation",
)
enablePlugins(DockerPlugin)
dockerfile in (root / docker) := {
val rootJar: File = sbt.Keys.`package`.in(Compile, packageBin).value
val appDir: String = "/app/"
val rootJarDestination = s"$appDir/${rootJar.getName}"
val mainClassName: String =
(root / mainClass)
.in(Compile, packageBin)
.value
.getOrElse(sys.error("Expected exactly one main class"))
val fullClasspath: Seq[File] = (root / fullClasspathAsJars in Compile).value.files
val classpathString: String = fullClasspath.map(appDir + _.getName).mkString(":")
val classpath: String = s"$classpathString:$rootJarDestination"
new Dockerfile {
from("openjdk:jre-alpine")
add(fullClasspath, appDir)
add(rootJar, rootJarDestination)
entryPoint("java", "-cp", classpath, mainClassName)
}
}