-
Notifications
You must be signed in to change notification settings - Fork 18
/
build.sbt
138 lines (128 loc) · 4.55 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name := "dependency"
organization := "io.flow"
ThisBuild / scalaVersion := "2.13.15"
ThisBuild / libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always
ThisBuild / libraryDependencySchemes += "org.scoverage" %% "sbt-scoverage" % VersionScheme.Always
lazy val allScalacOptions = Seq(
"-feature",
"-Xfatal-warnings",
"-unchecked",
"-Xcheckinit",
"-Xlint:adapted-args",
"-Ypatmat-exhaust-depth",
"100", // Fixes: Exhaustivity analysis reached max recursion depth, not all missing cases are reported.
"-Wconf:src=generated/.*:silent",
"-Wconf:src=target/.*:silent", // silence the unused imports errors generated by the Play Routes
)
lazy val generated = project
.in(file("generated"))
.enablePlugins(PlayScala)
.settings(
libraryDependencies ++= Seq(
ws,
),
scalacOptions ++= allScalacOptions,
)
lazy val lib = project
.in(file("lib"))
.dependsOn(generated)
.aggregate(generated)
.settings(commonSettings: _*)
.settings(
libraryDependencies ++= Seq(
playTest,
"org.scalatestplus.play" %% "scalatestplus-play" % "5.1.0",
),
)
lazy val api = project
.in(file("api"))
.dependsOn(generated, lib)
.aggregate(generated, lib)
.enablePlugins(PlayScala)
.enablePlugins(JavaAppPackaging, JavaAgent)
.settings(commonSettings: _*)
.settings(
javaAgents += "com.datadoghq" % "dd-java-agent" % "1.43.0",
routesImport += "io.flow.dependency.v0.Bindables.Core._",
routesImport += "io.flow.dependency.v0.Bindables.Models._",
routesGenerator := InjectedRoutesGenerator,
Test / testOptions += Tests.Argument("-oDF"),
libraryDependencies ++= Seq(
jdbc,
ws,
"com.google.inject" % "guice" % "5.1.0",
"com.google.inject.extensions" % "guice-assistedinject" % "5.1.0",
"org.projectlombok" % "lombok" % "1.18.36" % "provided",
"com.sendgrid" % "sendgrid-java" % "4.7.1",
"io.flow" %% "lib-event-sync-play28" % "0.6.76",
"io.flow" %% "lib-metrics-play28" % "1.1.3",
"io.flow" %% "lib-log" % "0.2.28",
"io.flow" %% "lib-usage-play28" % "0.2.63",
"io.flow" %% "lib-test-utils-play28" % "0.2.42" % Test,
"net.sourceforge.htmlcleaner" % "htmlcleaner" % "2.29",
"org.postgresql" % "postgresql" % "42.7.4",
"org.apache.commons" % "commons-text" % "1.12.0",
),
scalacOptions ++= allScalacOptions,
)
lazy val www = project
.in(file("www"))
.dependsOn(generated, lib)
.aggregate(generated, lib)
.enablePlugins(PlayScala)
.enablePlugins(SbtTwirl)
.enablePlugins(JavaAgent)
.enablePlugins(SbtWeb)
.settings(commonSettings: _*)
.settings(
javaAgents += "com.datadoghq" % "dd-java-agent" % "1.43.0",
routesImport += "io.flow.dependency.v0.Bindables.Core._",
routesImport += "io.flow.dependency.v0.Bindables.Models._",
routesGenerator := InjectedRoutesGenerator,
Test / testOptions += Tests.Argument("-oD"),
libraryDependencies ++= Seq(
ws,
"com.google.inject" % "guice" % "5.1.0",
"com.google.inject.extensions" % "guice-assistedinject" % "5.1.0",
"org.projectlombok" % "lombok" % "1.18.36" % "provided",
"org.webjars" %% "webjars-play" % "2.8.18",
"org.webjars" % "bootstrap" % "3.4.1",
"org.webjars" % "font-awesome" % "6.6.0",
"org.webjars" % "jquery" % "3.7.1",
"org.webjars.bower" % "bootstrap-social" % "5.1.1",
"io.flow" %% "lib-test-utils-play28" % "0.2.42" % Test,
),
scalacOptions ++= allScalacOptions,
)
val credsToUse = Option(System.getenv("ARTIFACTORY_USERNAME")) match {
case None => Credentials(Path.userHome / ".ivy2" / ".artifactory")
case _ =>
Credentials(
"Artifactory Realm",
"flow.jfrog.io",
System.getenv("ARTIFACTORY_USERNAME"),
System.getenv("ARTIFACTORY_PASSWORD"),
)
}
lazy val commonSettings: Seq[Setting[_]] = Seq(
scalafmtOnCompile := true,
name ~= ("dependency-" + _),
libraryDependencies ++= Seq(
"io.flow" %% "lib-play-play28" % "0.8.8",
"com.typesafe.play" %% "play-json-joda" % "2.9.4",
),
Test / javaOptions ++= Seq(
"--add-exports=java.base/sun.security.x509=ALL-UNNAMED",
"--add-opens=java.base/sun.security.ssl=ALL-UNNAMED",
),
scalacOptions ++= allScalacOptions,
credentials += credsToUse,
resolvers += "Artifactory" at "https://flow.jfrog.io/flow/libs-release/",
coverageExcludedFiles := ".*\\/*generated*\\/.*",
coverageDataDir := file("target/scala-2.13"),
coverageHighlighting := true,
coverageFailOnMinimum := true,
coverageMinimumStmtTotal := 36,
coverageMinimumBranchTotal := 36,
)
version := "0.8.43"