-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sbt
97 lines (83 loc) · 2.8 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
import CompileFlags._
import DependenciesScopesHandler._
import Dependencies._
import PublishSettings.localCacheSettings
import org.typelevel.scalacoptions.ScalacOptions
lazy val scala213 = "2.13.12"
Global / onChangedBuildSource := ReloadOnSourceChanges
inThisBuild {
List(
organization := "com.colisweb",
scalaVersion := scala213,
scalafmtOnCompile := true,
scalafmtCheck := true,
scalafmtSbtCheck := true,
Test / fork := true,
scalacOptions ++= crossScalacOptions(scalaVersion.value),
localCacheSettings
)
}
//// Main projects
lazy val root = Project(id = "scala-distances", base = file("."))
.settings(moduleName := "root")
.settings(noPublishSettings)
.aggregate(core, `google-provider`, `here-provider`, `memory-guava`, `redis-cache`, tests)
lazy val core = project
.settings(moduleName := "scala-distances-core")
.settings(Test / tpolecatExcludeOptions += ScalacOptions.warnNonUnitStatement)
.settings(libraryDependencies ++= compileDependencies(squants, simplecacheWrapperCats))
.settings(
libraryDependencies ++= testDependencies(
mockitoScalaScalatest,
scalacheck,
scalatest,
scalatestPlus,
simplecacheMemory
)
)
//// Providers
lazy val `google-provider` = project
.in(file("providers/google"))
.settings(moduleName := "scala-distances-provider-google")
.settings(
libraryDependencies ++= compileDependencies(enumeratum, googleMaps, loggingInterceptor, refined)
)
.dependsOn(core)
lazy val `here-provider` = project
.in(file("providers/here"))
.settings(moduleName := "scala-distances-provider-here")
.settings(
libraryDependencies ++= compileDependencies(
circe,
circeGeneric,
circeGenericExtras,
circeJawn,
logstashLogbackEncode,
refined,
requests
)
)
.dependsOn(core)
//// Caches
lazy val `redis-cache` = project
.in(file("caches/redis"))
.settings(moduleName := "scala-distances-cache-redis")
.settings(libraryDependencies ++= compileDependencies(simplecacheRedisCirce))
.dependsOn(core)
lazy val `memory-guava` = project
.in(file("caches/memory-guava"))
.settings(moduleName := "scala-distances-memory-guava")
.settings(libraryDependencies ++= compileDependencies(simplecacheMemoryGuava))
.dependsOn(core)
//// Meta projects
lazy val tests = project
.settings(noPublishSettings)
.settings(Test / tpolecatExcludeOptions += ScalacOptions.warnNonUnitStatement)
.dependsOn(core % "test->test;compile->compile", `google-provider`, `here-provider`, `redis-cache`, `memory-guava`)
.settings(libraryDependencies ++= testDependencies(pureconfig, refinedPureconfig, simplecacheRedisCirce, approvals))
/** Copied from Cats */
lazy val noPublishSettings = Seq(
publish := {},
publishLocal := {},
publishArtifact := false
)