forked from jmcardon/tsec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
256 lines (228 loc) · 6.97 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
import Dependencies._
name := "tsec"
scalaVersion := "2.12.4"
lazy val scalacOpts = scalacOptions := Seq(
"-unchecked",
"-feature",
"-deprecation",
"-encoding",
"utf8",
"-Ywarn-adapted-args", // Warn if an argument list is modified to match the receiver.
"-Ywarn-inaccessible", // Warn about inaccessible types in method signatures.
"-Ywarn-unused:imports",
"-Ywarn-nullary-override", // Warn when non-nullary overrides nullary, e.g. def foo() over def foo.
"-Ypartial-unification",
"-language:higherKinds",
"-language:implicitConversions"
)
lazy val micrositeSettings = Seq(
libraryDependencies += Libraries.gitHub4s,
micrositeName := "TSec",
micrositeBaseUrl := "/tsec",
micrositeDescription := "A Type-Safe General Cryptography Library on the JVM",
micrositeAuthor := "Jose Cardona",
micrositeHomepage := "https://jmcardon.github.io/tsec/",
micrositeGithubOwner := "jmcardon",
micrositeGithubRepo := "tsec",
micrositeDocumentationUrl := "/tsec/docs/symmetric.html",
micrositeGitterChannel := false,
micrositePushSiteWith := GitHub4s,
micrositeGithubToken := sys.env.get("GITHUB_TOKEN")
)
lazy val commonSettings = Seq(
libraryDependencies ++= Seq(
Libraries.cats,
Libraries.catsEffect,
Libraries.scalaTest,
Libraries.scalaCheck,
Libraries.commonsCodec
),
organization in ThisBuild := "io.github.jmcardon",
scalaVersion in ThisBuild := "2.12.4",
fork in test := true,
parallelExecution in test := false,
addCompilerPlugin("org.spire-math" %% "kind-projector" % "0.9.5"),
version in ThisBuild := "0.0.1-M7",
scalacOpts
)
lazy val benchSettings = Seq(
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
libraryDependencies += Libraries.thyme
)
lazy val passwordHasherLibs = libraryDependencies ++= Seq(
Libraries.sCrypt
)
lazy val signatureLibs = libraryDependencies += Libraries.BC
lazy val jwtCommonLibs = libraryDependencies ++= Seq(
Libraries.circeCore,
Libraries.circeGeneric,
Libraries.circeGenericExtras,
Libraries.circeParser
)
lazy val http4sDeps = libraryDependencies ++= Seq(
Libraries.http4sdsl,
Libraries.http4sServer,
Libraries.http4sCirce
)
lazy val loggingLibs = libraryDependencies ++= Seq(
Libraries.log4s
)
lazy val root = project
.aggregate(
common,
messageDigests,
cipherCore,
jwtCore,
symmetricCipher,
mac,
signatures,
jwtMac,
jwtSig,
passwordHashers,
http4s
)
lazy val common = Project(id = "tsec-common", base = file("common"))
.settings(commonSettings)
.settings(publishSettings)
lazy val passwordHashers = Project(id = "tsec-password", base = file("password-hashers"))
.settings(commonSettings)
.settings(passwordHasherLibs)
.settings(publishSettings)
.dependsOn(common % "compile->compile;test->test")
lazy val cipherCore = Project(id = "tsec-cipher-core", base = file("cipher-core"))
.settings(commonSettings)
.settings(publishSettings)
.dependsOn(common % "compile->compile;test->test")
lazy val symmetricCipher = Project(id = "tsec-symmetric-cipher", base = file("cipher-symmetric"))
.settings(commonSettings)
.settings(publishSettings)
.dependsOn(common % "compile->compile;test->test")
.dependsOn(cipherCore)
lazy val mac = Project(id = "tsec-mac", base = file("mac"))
.settings(commonSettings)
.settings(publishSettings)
.dependsOn(common % "compile->compile;test->test")
lazy val messageDigests = Project(id = "tsec-md", base = file("message-digests"))
.settings(commonSettings)
.settings(publishSettings)
.dependsOn(common % "compile->compile;test->test")
lazy val signatures = Project(id = "tsec-signatures", base = file("signatures"))
.settings(commonSettings)
.settings(signatureLibs)
.settings(publishSettings)
.dependsOn(common % "compile->compile;test->test")
lazy val jwtCore = Project(id = "tsec-jwt-core", base = file("jwt-core"))
.settings(commonSettings)
.settings(jwtCommonLibs)
.settings(publishSettings)
.dependsOn(common % "compile->compile;test->test")
.dependsOn(mac)
.dependsOn(signatures)
lazy val jwtMac = Project(id = "tsec-jwt-mac", base = file("jwt-mac"))
.settings(commonSettings)
.settings(jwtCommonLibs)
.settings(publishSettings)
.dependsOn(common % "compile->compile;test->test")
.dependsOn(mac)
.dependsOn(jwtCore)
lazy val jwtSig = Project(id = "tsec-jwt-sig", base = file("jwt-sig"))
.settings(commonSettings)
.settings(jwtCommonLibs)
.settings(signatureLibs)
.settings(publishSettings)
.dependsOn(common % "compile->compile;test->test")
.dependsOn(jwtCore)
.dependsOn(signatures)
.dependsOn(messageDigests)
lazy val bench = Project(id = "tsec-bench", base = file("bench"))
.settings(commonSettings)
.settings(benchSettings)
.dependsOn(common % "compile->compile;test->test")
.dependsOn(cipherCore)
.dependsOn(symmetricCipher)
.dependsOn(libsodium)
.dependsOn(mac)
.settings(publish := {})
.enablePlugins(JmhPlugin)
lazy val examples = Project(id = "tsec-examples", base = file("examples"))
.settings(commonSettings)
.settings(jwtCommonLibs)
.settings(signatureLibs)
.settings(passwordHasherLibs)
.settings(http4sDeps)
.dependsOn(
symmetricCipher,
mac,
messageDigests,
signatures,
jwtMac,
jwtSig,
passwordHashers,
http4s
)
.settings(publish := {})
lazy val http4s = Project(id = "tsec-http4s", base = file("tsec-http4s"))
.settings(commonSettings)
.settings(jwtCommonLibs)
.settings(passwordHasherLibs)
.settings(http4sDeps)
.settings(publishSettings)
.settings(loggingLibs)
.dependsOn(common % "compile->compile;test->test")
.dependsOn(
symmetricCipher,
mac,
messageDigests,
passwordHashers,
jwtMac
)
lazy val libsodium = Project(id = "tsec-libsodium", base = file("tsec-libsodium"))
.settings(commonSettings)
.settings(
libraryDependencies ++= Seq(
Libraries.fs2,
Libraries.fs2IO
)
)
.settings(loggingLibs)
.dependsOn(common % "compile->compile;test->test")
lazy val microsite = Project(id = "microsite", base = file("docs"))
.settings(commonSettings)
.settings(micrositeSettings)
.enablePlugins(MicrositesPlugin)
.enablePlugins(TutPlugin)
.dependsOn(
common,
messageDigests,
cipherCore,
jwtCore,
symmetricCipher,
mac,
signatures,
jwtMac,
jwtSig,
passwordHashers,
http4s,
examples
)
lazy val publishSettings = Seq(
homepage := Some(url("https://github.com/jmcardon/tsec")),
licenses := Seq("MIT" -> url("https://opensource.org/licenses/MIT")),
scmInfo := Some(ScmInfo(url("https://github.com/jmcardon/tsec"), "scm:git:git@github.com:jmcardon/tsec.git")),
autoAPIMappings := true,
apiURL := None,
bintrayRepository := "tsec",
pomExtra :=
<developers>
<developer>
<id>jmcardon</id>
<name>Jose Cardona</name>
<url>https://github.com/jmcardon/</url>
</developer>
<developer>
<id>rsoeldner</id>
<name>Robert Soeldner</name>
<url>https://github.com/rsoeldner/</url>
</developer>
</developers>
)