@@ -15,7 +15,13 @@ import scala.sys.process.Process
1515// ////////////////////////////////////
1616
1717// when true enables run cancellation w/o exiting sbt
18- cancelable in Global := true
18+ // use Ctrl-c to stop current task but not quit SBT
19+ Global / cancelable := true
20+
21+ Global / scalaVersion := Dependencies .ScalaVersion
22+ Global / semanticdbEnabled := true
23+ Global / semanticdbVersion := scalafixSemanticdb.revision
24+ Global / scalafixDependencies += " com.github.liancheng" %% " organize-imports" % " 0.6.0"
1925
2026lazy val aggregatedProjects : Seq [ProjectReference ] = Seq (webapi, sipi)
2127
@@ -51,18 +57,25 @@ lazy val root: Project = Project(id = "root", file("."))
5157 ThisBuild / scmInfo := Some (
5258 ScmInfo (url(" https://github.com/dasch-swiss/dsp-api" ), " scm:git:git@github.com:dasch-swiss/dsp-api.git" )
5359 ),
54- Global / scalaVersion := Dependencies .scalaVersion ,
60+ Global / scalaVersion := Dependencies .ScalaVersion ,
5561 // use 'git describe' for deriving the version
5662 git.useGitDescribe := true ,
5763 // override generated version string because docker hub rejects '+' in tags
5864 ThisBuild / version ~= (_.replace('+' , '-' )),
59- // use Ctrl-c to stop current task but not quit SBT
60- Global / cancelable := true ,
61- publish / skip := true
65+ publish / skip := true
6266 )
6367
64- addCommandAlias(" fmt" , " all root/scalafmtSbt root/scalafmtAll" )
65- addCommandAlias(" check" , " all root/scalafmtSbtCheck root/scalafmtCheckAll" )
68+ addCommandAlias(" fmt" , " ; all root/scalafmtSbt root/scalafmtAll; root/scalafixAll" )
69+ addCommandAlias(" check" , " ; all root/scalafmtSbtCheck root/scalafmtCheckAll; root/scalafixAll --check" )
70+
71+ lazy val customScalacOptions = Seq (
72+ " -feature" ,
73+ " -unchecked" ,
74+ " -deprecation" ,
75+ " -Yresolve-term-conflict:package" ,
76+ " -Ymacro-annotations" ,
77+ " -Wunused"
78+ )
6679
6780// ////////////////////////////////////
6881// DSP's custom SIPI
@@ -151,7 +164,10 @@ lazy val webapi: Project = Project(id = "webapi", base = file("webapi"))
151164 " -unchecked" ,
152165 " -deprecation" ,
153166 " -Yresolve-term-conflict:package" ,
154- " -Ymacro-annotations"
167+ " -Ymacro-annotations" ,
168+ // silence twirl templates unused imports warnings
169+ " -Wconf:src=target/.*:s" ,
170+ " -Wunused:imports"
155171 ),
156172 logLevel := Level .Info ,
157173 run / javaOptions := webapiJavaRunOptions,
@@ -208,7 +224,7 @@ lazy val webapi: Project = Project(id = "webapi", base = file("webapi"))
208224 buildInfoKeys ++= Seq [BuildInfoKey ](
209225 name,
210226 version,
211- " akkaHttp" -> Dependencies .akkaHttpVersion ,
227+ " akkaHttp" -> Dependencies .AkkaHttpVersion ,
212228 " sipi" -> Dependencies .sipiImage,
213229 " fuseki" -> Dependencies .fusekiImage
214230 ),
@@ -249,13 +265,7 @@ lazy val webapiJavaTestOptions = Seq(
249265lazy val roleInterface = project
250266 .in(file(" dsp-role/interface" ))
251267 .settings(
252- scalacOptions ++= Seq (
253- " -feature" ,
254- " -unchecked" ,
255- " -deprecation" ,
256- " -Yresolve-term-conflict:package" ,
257- " -Ymacro-annotations"
258- ),
268+ scalacOptions ++= customScalacOptions,
259269 name := " roleInterface" ,
260270 libraryDependencies ++= Dependencies .roleInterfaceLibraryDependencies,
261271 testFrameworks := Seq (new TestFramework (" zio.test.sbt.ZTestFramework" ))
@@ -265,13 +275,7 @@ lazy val roleInterface = project
265275lazy val roleHandler = project
266276 .in(file(" dsp-role/handler" ))
267277 .settings(
268- scalacOptions ++= Seq (
269- " -feature" ,
270- " -unchecked" ,
271- " -deprecation" ,
272- " -Yresolve-term-conflict:package" ,
273- " -Ymacro-annotations"
274- ),
278+ scalacOptions ++= customScalacOptions,
275279 name := " roleHandler" ,
276280 libraryDependencies ++= Dependencies .roleHandlerLibraryDependencies,
277281 testFrameworks := Seq (new TestFramework (" zio.test.sbt.ZTestFramework" ))
@@ -285,13 +289,7 @@ lazy val roleHandler = project
285289lazy val roleRepo = project
286290 .in(file(" dsp-role/repo" ))
287291 .settings(
288- scalacOptions ++= Seq (
289- " -feature" ,
290- " -unchecked" ,
291- " -deprecation" ,
292- " -Yresolve-term-conflict:package" ,
293- " -Ymacro-annotations"
294- ),
292+ scalacOptions ++= customScalacOptions,
295293 name := " roleRepo" ,
296294 libraryDependencies ++= Dependencies .roleRepoLibraryDependencies,
297295 testFrameworks := Seq (new TestFramework (" zio.test.sbt.ZTestFramework" ))
@@ -301,13 +299,7 @@ lazy val roleRepo = project
301299lazy val roleCore = project
302300 .in(file(" dsp-role/core" ))
303301 .settings(
304- scalacOptions ++= Seq (
305- " -feature" ,
306- " -unchecked" ,
307- " -deprecation" ,
308- " -Yresolve-term-conflict:package" ,
309- " -Ymacro-annotations"
310- ),
302+ scalacOptions ++= customScalacOptions,
311303 name := " roleCore" ,
312304 libraryDependencies ++= Dependencies .roleCoreLibraryDependencies,
313305 testFrameworks := Seq (new TestFramework (" zio.test.sbt.ZTestFramework" ))
@@ -319,13 +311,7 @@ lazy val roleCore = project
319311lazy val userInterface = project
320312 .in(file(" dsp-user/interface" ))
321313 .settings(
322- scalacOptions ++= Seq (
323- " -feature" ,
324- " -unchecked" ,
325- " -deprecation" ,
326- " -Yresolve-term-conflict:package" ,
327- " -Ymacro-annotations"
328- ),
314+ scalacOptions ++= customScalacOptions,
329315 name := " userInterface" ,
330316 libraryDependencies ++= Dependencies .userInterfaceLibraryDependencies,
331317 testFrameworks := Seq (new TestFramework (" zio.test.sbt.ZTestFramework" ))
@@ -335,13 +321,7 @@ lazy val userInterface = project
335321lazy val userHandler = project
336322 .in(file(" dsp-user/handler" ))
337323 .settings(
338- scalacOptions ++= Seq (
339- " -feature" ,
340- " -unchecked" ,
341- " -deprecation" ,
342- " -Yresolve-term-conflict:package" ,
343- " -Ymacro-annotations"
344- ),
324+ scalacOptions ++= customScalacOptions,
345325 name := " userHandler" ,
346326 libraryDependencies ++= Dependencies .userHandlerLibraryDependencies,
347327 testFrameworks := Seq (new TestFramework (" zio.test.sbt.ZTestFramework" ))
@@ -355,13 +335,7 @@ lazy val userHandler = project
355335lazy val userRepo = project
356336 .in(file(" dsp-user/repo" ))
357337 .settings(
358- scalacOptions ++= Seq (
359- " -feature" ,
360- " -unchecked" ,
361- " -deprecation" ,
362- " -Yresolve-term-conflict:package" ,
363- " -Ymacro-annotations"
364- ),
338+ scalacOptions ++= customScalacOptions,
365339 name := " userRepo" ,
366340 libraryDependencies ++= Dependencies .userRepoLibraryDependencies,
367341 testFrameworks := Seq (new TestFramework (" zio.test.sbt.ZTestFramework" ))
@@ -371,13 +345,7 @@ lazy val userRepo = project
371345lazy val userCore = project
372346 .in(file(" dsp-user/core" ))
373347 .settings(
374- scalacOptions ++= Seq (
375- " -feature" ,
376- " -unchecked" ,
377- " -deprecation" ,
378- " -Yresolve-term-conflict:package" ,
379- " -Ymacro-annotations"
380- ),
348+ scalacOptions ++= customScalacOptions,
381349 name := " userCore" ,
382350 libraryDependencies ++= Dependencies .userCoreLibraryDependencies,
383351 testFrameworks := Seq (new TestFramework (" zio.test.sbt.ZTestFramework" ))
@@ -389,13 +357,7 @@ lazy val userCore = project
389357lazy val schemaCore = project
390358 .in(file(" dsp-schema/core" ))
391359 .settings(
392- scalacOptions ++= Seq (
393- " -feature" ,
394- " -unchecked" ,
395- " -deprecation" ,
396- " -Yresolve-term-conflict:package" ,
397- " -Ymacro-annotations"
398- ),
360+ scalacOptions ++= customScalacOptions,
399361 name := " schemaCore" ,
400362 libraryDependencies ++= Dependencies .schemaCoreLibraryDependencies,
401363 testFrameworks := Seq (new TestFramework (" zio.test.sbt.ZTestFramework" ))
@@ -407,6 +369,7 @@ lazy val schemaCore = project
407369lazy val shared = project
408370 .in(file(" dsp-shared" ))
409371 .settings(
372+ scalacOptions ++= customScalacOptions,
410373 name := " shared" ,
411374 libraryDependencies ++= Dependencies .sharedLibraryDependencies,
412375 testFrameworks := Seq (new TestFramework (" zio.test.sbt.ZTestFramework" ))
0 commit comments