-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
91 lines (77 loc) · 2.68 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
79
80
81
82
83
84
85
86
87
88
89
90
import sbt.{ThisBuild, _}
import sbt.Keys.{watchSources, _}
ThisBuild / version := "0.0.2"
//ThisBuild / evictionErrorLevel := Level.Info
val credentialFile = new File("lightbend.sbt")
def doesCredentialExist : Boolean = {
import java.nio.file.Files
val exists = Files.exists(credentialFile.toPath)
println(s"doesCredentialExist: ($credentialFile) " + exists)
exists
}
def commercialDependencies : Seq[ModuleID] = {
import com.lightbend.cinnamon.sbt.Cinnamon.CinnamonKeys.cinnamon
Seq(
// BEGIN: this requires a commercial Lightbend Subscription
Cinnamon.library.cinnamonAgent,
Cinnamon.library.cinnamonAkka,
Cinnamon.library.cinnamonAkkaStream,
Cinnamon.library.cinnamonAkkaHttp,
Cinnamon.library.cinnamonPrometheus,
Cinnamon.library.cinnamonPrometheusHttpServer,
Cinnamon.library.cinnamonJvmMetricsProducer,
/*
Cinnamon.library.cinnamonOpenTracing,
Cinnamon.library.cinnamonOpenTracingJaeger
*/
// END: this requires a commercial Lightbend Subscription
)
}
def ossDependencies : Seq[ModuleID] = {
Seq(
"com.lightbend.akka" %% "akka-stream-alpakka-file" % "1.1.2",
"com.thesamet.scalapb" %% "scalapb-json4s" % "0.11.0",
"ch.qos.logback" % "logback-classic" % "1.2.3",
"com.typesafe.akka" %% "akka-http-testkit" % "10.1.12" % "test",
"org.scalatest" %% "scalatest" % "3.0.8" % "test"
)
}
lazy val sensorData = (project in file("."))
.enablePlugins(CloudflowApplicationPlugin, CloudflowAkkaPlugin)
.enablePlugins(CloudflowLibraryPlugin)
.enablePlugins(Cinnamon)
.settings(
scalaVersion := "2.12.12",
schemaCodeGenerator := SchemaCodeGenerator.Java,
runLocalConfigFile := Some("src/main/resources/local.conf"),
runLocalLog4jConfigFile := Some("src/main/resources/log4j.xml"),
name := "sensor-data-java-proto-grpc",
// Add the Cinnamon Agent settings for run and test
cinnamonSuppressRepoWarnings := true,
test / cinnamon := false,
run / cinnamon := true,
cinnamonLogLevel := "INFO",
libraryDependencies ++= {
if (doesCredentialExist) {
commercialDependencies ++ ossDependencies
}
else {
ossDependencies
}
},
javacOptions += "-Xlint:deprecation",
scalacOptions ++= Seq(
"-encoding", "UTF-8",
"-target:jvm-1.8",
"-Xlog-reflective-calls",
"-Xlint",
"-Ywarn-unused",
"-Ywarn-unused-import",
"-deprecation",
"-feature",
"-language:_",
"-unchecked"
),
organization := "com.lightbend.cloudflow",
headerLicense := Some(HeaderLicense.ALv2("(C) 2016-2021", "Lightbend Inc. <https://www.lightbend.com>")),
)