5
5
lazy val `reactive-kinesis` =
6
6
project
7
7
.in(file(" ." ))
8
- .enablePlugins(AutomateHeaderPlugin , GitVersioning )
8
+ .enablePlugins(AutomateHeaderPlugin , GitVersioning , ScalafmtCorePlugin )
9
9
.settings(settings)
10
10
.configs(IntegrationTest )
11
11
.settings(Defaults .itSettings: _* )
12
12
.settings(
13
13
libraryDependencies ++=
14
14
library.jackson ++ library.amazon ++ library.lightbend ++
15
- library.logback ++ library.testing
15
+ library.logback ++ library.testing
16
16
)
17
17
18
18
// *****************************************************************************
@@ -24,47 +24,48 @@ lazy val library =
24
24
25
25
object Version {
26
26
val scalaCheck = " 1.13.5"
27
- val scalaTest = " 3.0.3 "
28
- val jackson = " 2.8.7 "
29
- val akka = " 2.5.7 "
27
+ val scalaTest = " 3.0.5 "
28
+ val jackson = " 2.9.4 "
29
+ val akka = " 2.5.11 "
30
30
}
31
31
32
32
val jackson = Seq (
33
33
// We need jackson versions to be consistent, KCL&KPL pull in slightly older versions which often get evicted
34
34
// See: https://github.com/aws/aws-sdk-java/issues/999
35
- " com.fasterxml.jackson.dataformat" % " jackson-dataformat-cbor" % Version .jackson % Compile ,
36
- " com.fasterxml.jackson.core" % " jackson-databind" % Version .jackson % Compile ,
37
- " com.fasterxml.jackson.core" % " jackson-core" % Version .jackson % Compile ,
38
- " com.fasterxml.jackson.core" % " jackson-annotations" % " 2.8.0" % Compile ,
39
- " com.fasterxml.uuid" % " java-uuid-generator" % " 3.1.4" % Compile )
35
+ " com.fasterxml.jackson.dataformat" % " jackson-dataformat-cbor" % Version .jackson % Compile ,
36
+ " com.fasterxml.jackson.core" % " jackson-databind" % Version .jackson % Compile ,
37
+ " com.fasterxml.jackson.core" % " jackson-core" % Version .jackson % Compile ,
38
+ " com.fasterxml.jackson.core" % " jackson-annotations" % Version .jackson % Compile ,
39
+ " com.fasterxml.uuid" % " java-uuid-generator" % " 3.1.5" % Compile
40
+ )
40
41
41
42
val amazon = Seq (
42
- " com.amazonaws " % " amazon-kinesis-client " % " 1.8.8 " % Compile
43
- excludeAll(
44
- ExclusionRule (organization = " com.fasterxml.jackson.core " ),
45
- ExclusionRule (organization = " com.fasterxml.jackson.dataformat " ) ),
46
- " com.amazonaws " % " amazon-kinesis-producer " % " 0.12.8 " % Compile
47
- excludeAll(
48
- ExclusionRule (organization = " com.fasterxml.jackson.core" ),
49
- ExclusionRule (organization = " com.fasterxml.jackson.dataformat" ))
43
+ // TODO: Upgrade this to 1.9.x when this issue is resolved and exposed in localstack:
44
+ // https://github.com/mhart/kinesalite/issues/59
45
+ " com.amazonaws " % " amazon-kinesis-client " % " 1.8.10 " % Compile
46
+ excludeAll ( ExclusionRule (organization = " com.fasterxml.jackson.core " ),
47
+ ExclusionRule (organization = " com.fasterxml.jackson.dataformat " )),
48
+ " com.amazonaws " % " amazon-kinesis-producer " % " 0.12.8 " % Compile
49
+ excludeAll ( ExclusionRule (organization = " com.fasterxml.jackson.core" ),
50
+ ExclusionRule (organization = " com.fasterxml.jackson.dataformat" ))
50
51
)
51
52
52
53
val lightbend = Seq (
53
- " com.typesafe" % " config" % " 1.3.1 " % Compile ,
54
- " com.typesafe.akka" %% " akka-actor" % Version .akka % Compile ,
55
- " com.typesafe.akka" %% " akka-stream" % Version .akka % Compile ,
56
- " com.typesafe.scala-logging" %% " scala-logging" % " 3.5 .0" % Compile
57
- )
54
+ " com.typesafe" % " config" % " 1.3.3 " % Compile ,
55
+ " com.typesafe.akka" %% " akka-actor" % Version .akka % Compile ,
56
+ " com.typesafe.akka" %% " akka-stream" % Version .akka % Compile ,
57
+ " com.typesafe.scala-logging" %% " scala-logging" % " 3.8 .0" % Compile
58
+ )
58
59
59
60
val logback = Seq (
60
- " ch.qos.logback" % " logback-classic" % " 1.1.11 " % Compile
61
+ " ch.qos.logback" % " logback-classic" % " 1.2.3 " % Compile
61
62
)
62
63
63
64
val testing = Seq (
64
- " org.scalatest" %% " scalatest" % Version .scalaTest % " it,test" ,
65
- " org.scalacheck" %% " scalacheck" % Version .scalaCheck % " it,test" ,
66
- " com.typesafe.akka" %% " akka-testkit" % Version .akka % " it,test" ,
67
- " org.mockito" % " mockito-core" % " 2.7.15 " % " it,test"
65
+ " org.scalatest" %% " scalatest" % Version .scalaTest % " it,test" ,
66
+ " org.scalacheck" %% " scalacheck" % Version .scalaCheck % " it,test" ,
67
+ " com.typesafe.akka" %% " akka-testkit" % Version .akka % " it,test" ,
68
+ " org.mockito" % " mockito-core" % " 2.16.0 " % " it,test"
68
69
)
69
70
}
70
71
@@ -73,9 +74,9 @@ lazy val library =
73
74
// *****************************************************************************
74
75
75
76
lazy val settings =
76
- commonSettings ++
77
- headerSettings ++
78
- versioningSettings
77
+ commonSettings ++
78
+ headerSettings ++
79
+ versioningSettings
79
80
80
81
lazy val commonSettings =
81
82
Seq (
@@ -84,50 +85,53 @@ lazy val commonSettings =
84
85
organization := " com.weightwatchers" ,
85
86
mappings.in(Compile , packageBin) += baseDirectory.in(ThisBuild ).value / " LICENSE" -> " LICENSE" ,
86
87
scalacOptions ++= Seq ( // http://tpolecat.github.io/2017/04/25/scalac-flags.html
87
- " -deprecation" , // Emit warning and location for usages of deprecated APIs.
88
- " -encoding" , " utf-8" , // Specify character encoding used by source files.
89
- " -explaintypes" , // Explain type errors in more detail.
90
- " -feature" , // Emit warning and location for usages of features that should be imported explicitly.
91
- " -language:existentials" , // Existential types (besides wildcard types) can be written and inferred
92
- " -language:experimental.macros" , // Allow macro definition (besides implementation and application)
93
- " -language:higherKinds" , // Allow higher-kinded types
94
- " -language:implicitConversions" , // Allow definition of implicit functions called views
95
- " -unchecked" , // Enable additional warnings where generated code depends on assumptions.
96
- " -Xcheckinit" , // Wrap field accessors to throw an exception on uninitialized access.
97
- " -Xfatal-warnings" , // Fail the compilation if there are any warnings.
98
- " -Xfuture" , // Turn on future language features.
99
- " -Xlint:adapted-args" , // Warn if an argument list is modified to match the receiver.
100
- " -Xlint:by-name-right-associative" , // By-name parameter of right associative operator.
101
- " -Xlint:delayedinit-select" , // Selecting member of DelayedInit.
102
- " -Xlint:doc-detached" , // A Scaladoc comment appears to be detached from its element.
103
- " -Xlint:inaccessible" , // Warn about inaccessible types in method signatures.
104
- " -Xlint:infer-any" , // Warn when a type argument is inferred to be `Any`.
105
- " -Xlint:missing-interpolator" , // A string literal appears to be missing an interpolator id.
106
- " -Xlint:nullary-override" , // Warn when non-nullary `def f()' overrides nullary `def f'.
107
- " -Xlint:nullary-unit" , // Warn when nullary methods return Unit.
108
- " -Xlint:option-implicit" , // Option.apply used implicit view.
109
- " -Xlint:package-object-classes" , // Class or object defined in package object.
110
- " -Xlint:poly-implicit-overload" , // Parameterized overloaded implicit methods are not visible as view bounds.
111
- " -Xlint:private-shadow" , // A private field (or class parameter) shadows a superclass field.
112
- " -Xlint:stars-align" , // Pattern sequence wildcard must align with sequence component.
113
- " -Xlint:type-parameter-shadow" , // A local type parameter shadows a type already in scope.
114
- " -Xlint:unsound-match" , // Pattern match may not be typesafe.
115
- " -Yno-adapted-args" , // Do not adapt an argument list (either by inserting () or creating a tuple) to match the receiver.
116
- " -Ypartial-unification" , // Enable partial unification in type constructor inference
117
- " -Ywarn-dead-code" , // Warn when dead code is identified.
118
- " -Ywarn-inaccessible" , // Warn about inaccessible types in method signatures.
119
- " -Ywarn-infer-any" , // Warn when a type argument is inferred to be `Any`.
120
- " -Ywarn-nullary-override" , // Warn when non-nullary `def f()' overrides nullary `def f'.
121
- " -Ywarn-nullary-unit" , // Warn when nullary methods return Unit.
122
- " -Ywarn-numeric-widen" // Warn when numerics are widened.
88
+ " -deprecation" , // Emit warning and location for usages of deprecated APIs.
89
+ " -encoding" ,
90
+ " utf-8" , // Specify character encoding used by source files.
91
+ " -explaintypes" , // Explain type errors in more detail.
92
+ " -feature" , // Emit warning and location for usages of features that should be imported explicitly.
93
+ " -language:existentials" , // Existential types (besides wildcard types) can be written and inferred
94
+ " -language:experimental.macros" , // Allow macro definition (besides implementation and application)
95
+ " -language:higherKinds" , // Allow higher-kinded types
96
+ " -language:implicitConversions" , // Allow definition of implicit functions called views
97
+ " -unchecked" , // Enable additional warnings where generated code depends on assumptions.
98
+ " -Xcheckinit" , // Wrap field accessors to throw an exception on uninitialized access.
99
+ " -Xfatal-warnings" , // Fail the compilation if there are any warnings.
100
+ " -Xfuture" , // Turn on future language features.
101
+ " -Xlint:adapted-args" , // Warn if an argument list is modified to match the receiver.
102
+ " -Xlint:by-name-right-associative" , // By-name parameter of right associative operator.
103
+ " -Xlint:delayedinit-select" , // Selecting member of DelayedInit.
104
+ " -Xlint:doc-detached" , // A Scaladoc comment appears to be detached from its element.
105
+ " -Xlint:inaccessible" , // Warn about inaccessible types in method signatures.
106
+ " -Xlint:infer-any" , // Warn when a type argument is inferred to be `Any`.
107
+ " -Xlint:missing-interpolator" , // A string literal appears to be missing an interpolator id.
108
+ " -Xlint:nullary-override" , // Warn when non-nullary `def f()' overrides nullary `def f'.
109
+ " -Xlint:nullary-unit" , // Warn when nullary methods return Unit.
110
+ " -Xlint:option-implicit" , // Option.apply used implicit view.
111
+ " -Xlint:package-object-classes" , // Class or object defined in package object.
112
+ " -Xlint:poly-implicit-overload" , // Parameterized overloaded implicit methods are not visible as view bounds.
113
+ " -Xlint:private-shadow" , // A private field (or class parameter) shadows a superclass field.
114
+ " -Xlint:stars-align" , // Pattern sequence wildcard must align with sequence component.
115
+ " -Xlint:type-parameter-shadow" , // A local type parameter shadows a type already in scope.
116
+ " -Xlint:unsound-match" , // Pattern match may not be typesafe.
117
+ " -Yno-adapted-args" , // Do not adapt an argument list (either by inserting () or creating a tuple) to match the receiver.
118
+ " -Ypartial-unification" , // Enable partial unification in type constructor inference
119
+ " -Ywarn-dead-code" , // Warn when dead code is identified.
120
+ " -Ywarn-inaccessible" , // Warn about inaccessible types in method signatures.
121
+ " -Ywarn-infer-any" , // Warn when a type argument is inferred to be `Any`.
122
+ " -Ywarn-nullary-override" , // Warn when non-nullary `def f()' overrides nullary `def f'.
123
+ " -Ywarn-nullary-unit" , // Warn when nullary methods return Unit.
124
+ " -Ywarn-numeric-widen" // Warn when numerics are widened.
123
125
),
124
126
scalacOptions in (Compile , doc) ++= Seq (
125
127
" -no-link-warnings" // Suppresses problems with Scaladoc @throws links
126
128
),
127
- scalacOptions in (Compile , console) ~= (_.filterNot(Set (
128
- " -Ywarn-unused:imports" ,
129
- " -Xfatal-warnings"
130
- ))),
129
+ scalacOptions in (Compile , console) ~= (_.filterNot(
130
+ Set (
131
+ " -Ywarn-unused:imports" ,
132
+ " -Xfatal-warnings"
133
+ )
134
+ )),
131
135
unmanagedSourceDirectories.in(Compile ) := Seq (scalaSource.in(Compile ).value),
132
136
unmanagedSourceDirectories.in(Test ) := Seq (scalaSource.in(Test ).value),
133
137
shellPrompt in ThisBuild := { state =>
@@ -138,7 +142,10 @@ lazy val commonSettings =
138
142
parallelExecution in IntegrationTest := false ,
139
143
fork in IntegrationTest := true ,
140
144
javaOptions in IntegrationTest += " -Dcom.amazonaws.sdk.disableCertChecking=true" ,
141
- envVars in IntegrationTest += (" AWS_CBOR_DISABLE" -> " true" )
145
+ envVars in IntegrationTest += (" AWS_CBOR_DISABLE" -> " true" ),
146
+ scalafmtOnCompile := true ,
147
+ scalafmtTestOnCompile := true ,
148
+ scalafmtVersion := " 1.3.0"
142
149
)
143
150
144
151
/* This allows to derive an sbt version string from the git information.
@@ -149,29 +156,28 @@ lazy val commonSettings =
149
156
* ELSE IF the latest found tag is "vX.Y.Z", the version is "X.Y.Z-commitsSinceVersion-gCommitHash-SNAPSHOT"
150
157
* ELSE the version is "0.0.0-commitHash-SNAPSHOT"
151
158
*/
152
- val VersionRegex = " v([0-9]+.[0-9]+.[0-9]+)-?(.*)?" .r
159
+ val VersionRegex = " v([0-9]+.[0-9]+.[0-9]+)-?(.*)?" .r
153
160
val MilestoneRegex = " ^M[0-9]$" .r
154
161
lazy val versioningSettings =
155
162
Seq (
156
163
git.baseVersion := " 0.0.0" ,
157
164
git.useGitDescribe := true ,
158
165
git.uncommittedSignifier := None ,
159
166
git.gitTagToVersionNumber := {
160
- case VersionRegex (v, " " ) => Some (v) // e.g. 1.0.0
161
- case VersionRegex (v, s)
162
- if MilestoneRegex .findFirstIn(s).isDefined => Some (s " $v- $s" ) // e.g. 1.0.0-M1
163
- case VersionRegex (v, " SNAPSHOT" ) => Some (s " $v-SNAPSHOT " ) // e.g. 1.0.0-SNAPSHOT
164
- case VersionRegex (v, s) => Some (s " $v- $s-SNAPSHOT " ) // e.g. 1.0.0-2-commithash-SNAPSHOT
165
- case _ => None
167
+ case VersionRegex (v, " " ) => Some (v) // e.g. 1.0.0
168
+ case VersionRegex (v, s) if MilestoneRegex .findFirstIn(s).isDefined =>
169
+ Some (s " $v- $s" ) // e.g. 1.0.0-M1
170
+ case VersionRegex (v, " SNAPSHOT" ) => Some (s " $v-SNAPSHOT " ) // e.g. 1.0.0-SNAPSHOT
171
+ case VersionRegex (v, s) => Some (s " $v- $s-SNAPSHOT " ) // e.g. 1.0.0-2-commithash-SNAPSHOT
172
+ case _ => None
166
173
}
167
174
)
168
175
169
- import de .heikoseeberger .sbtheader .license ._
170
176
import sbt .Keys .parallelExecution
171
177
172
178
lazy val headerSettings =
173
179
Seq (
174
- headers := Map ( " scala " -> Apache2_0 (" 2017" , " WeightWatchers" ))
180
+ headerLicense := Some ( HeaderLicense . ALv2 (" 2017" , " WeightWatchers" ))
175
181
)
176
182
177
183
coverageExcludedPackages := " reference.conf"
0 commit comments