|
1 |
| -val homepageUrl = url("https://github.com/firstbirdtech/akka-persistence-query-view") |
2 |
| -val scmUrl = "https://github.com/firstbirdtech/akka-persistence-query-view.git" |
| 1 | +ThisBuild / scalafixDependencies += "com.github.liancheng" %% "organize-imports" % "0.5.0" |
| 2 | + |
| 3 | +addCommandAlias("codeFmt", ";scalafmtAll;scalafmtSbt;scalafixAll") |
| 4 | +addCommandAlias("codeVerify", ";scalafmtCheckAll;scalafmtSbtCheck;scalafixAll --check") |
| 5 | + |
| 6 | +lazy val commonSettings = Seq( |
| 7 | + organization := "com.firstbird", |
| 8 | + organizationName := "Firstbird GmbH", |
| 9 | + sonatypeProfileName := "com.firstbird", |
| 10 | + homepage := Some(url("https://github.com/firstbirdtech/akka-persistence-query-view")), |
| 11 | + licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0")), |
| 12 | + scmInfo := Some( |
| 13 | + ScmInfo(homepage.value.get, "scm:git:https://github.com/firstbirdtech/akka-persistence-query-view.git") |
| 14 | + ), |
| 15 | + developers += Developer( |
| 16 | + "contributors", |
| 17 | + "Contributors", |
| 18 | + |
| 19 | + url("https://github.com/firstbirdtech/backbone/graphs/contributors") |
| 20 | + ), |
| 21 | + startYear := Some(2016), |
| 22 | + scalaVersion := "2.13.3", |
| 23 | + crossScalaVersions := Seq("2.12.11", scalaVersion.value), |
| 24 | + scalacOptions ++= Seq( |
| 25 | + "-deprecation", |
| 26 | + "-encoding", |
| 27 | + "utf-8", |
| 28 | + "-explaintypes", |
| 29 | + "-feature", |
| 30 | + "-language:higherKinds", |
| 31 | + "-unchecked", |
| 32 | + "-Xcheckinit", |
| 33 | + "-Xfatal-warnings" |
| 34 | + ), |
| 35 | + scalacOptions ++= ( |
| 36 | + CrossVersion.partialVersion(scalaVersion.value) match { |
| 37 | + case Some((2, 13)) => Seq("-Wdead-code", "-Wunused:imports") |
| 38 | + case _ => Seq("-Xfuture", "-Ywarn-dead-code", "-Ywarn-unused:imports", "-Yno-adapted-args") |
| 39 | + } |
| 40 | + ), |
| 41 | + javacOptions ++= Seq( |
| 42 | + "-Xlint:unchecked", |
| 43 | + "-Xlint:deprecation" |
| 44 | + ), |
| 45 | + // show full stack traces and test case durations |
| 46 | + testOptions in Test += Tests.Argument("-oDF"), |
| 47 | + semanticdbEnabled := true, |
| 48 | + semanticdbVersion := scalafixSemanticdb.revision |
| 49 | +) |
3 | 50 |
|
4 | 51 | lazy val root = project
|
5 | 52 | .in(file("."))
|
| 53 | + .settings(commonSettings) |
6 | 54 | .settings(
|
7 |
| - organization := "com.firstbird", |
8 |
| - organizationName := "Firstbird GmbH", |
9 |
| - organizationHomepage := Some(url("https://www.firstbird.com")), |
10 | 55 | name := "akka-persistence-query-view",
|
11 |
| - description := "An Akka PersistentView replacement", |
12 |
| - homepage := Some(homepageUrl), |
13 |
| - scmInfo := Some( |
14 |
| - ScmInfo(homepageUrl, scmUrl) |
15 |
| - ), |
16 |
| - startYear := Some(2016), |
17 |
| - licenses := Seq(("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0"))), |
18 |
| - developers += Developer( |
19 |
| - "contributors", |
20 |
| - "Contributors", |
21 |
| - |
22 |
| - homepageUrl |
23 |
| - ), |
24 |
| - scalacOptions ++= Seq( |
25 |
| - "-deprecation", // Emit warning and location for usages of deprecated APIs. |
26 |
| - "-explaintypes", // Explain type errors in more detail. |
27 |
| - "-feature", // Emit warning and location for usages of features that should be imported explicitly. |
28 |
| - "-unchecked", // Enable additional warnings where generated code depends on assumptions. |
29 |
| - "-Xcheckinit", // Wrap field accessors to throw an exception on uninitialized access. |
30 |
| - "-Xfatal-warnings", // Fail the compilation if there are any warnings. |
31 |
| - "-Xlint:adapted-args", // Warn if an argument list is modified to match the receiver. |
32 |
| - "-Xlint:constant", // Evaluation of a constant arithmetic expression results in an error. |
33 |
| - "-Xlint:delayedinit-select", // Selecting member of DelayedInit. |
34 |
| - "-Xlint:doc-detached", // A Scaladoc comment appears to be detached from its element. |
35 |
| - "-Xlint:inaccessible", // Warn about inaccessible types in method signatures. |
36 |
| - "-Xlint:infer-any", // Warn when a type argument is inferred to be `Any`. |
37 |
| - "-Xlint:missing-interpolator", // A string literal appears to be missing an interpolator id. |
38 |
| - "-Xlint:nullary-override", // Warn when non-nullary `def f()' overrides nullary `def f'. |
39 |
| - "-Xlint:nullary-unit", // Warn when nullary methods return Unit. |
40 |
| - "-Xlint:option-implicit", // Option.apply used implicit view. |
41 |
| - "-Xlint:package-object-classes", // Class or object defined in package object. |
42 |
| - "-Xlint:poly-implicit-overload", // Parameterized overloaded implicit methods are not visible as view bounds. |
43 |
| - "-Xlint:private-shadow", // A private field (or class parameter) shadows a superclass field. |
44 |
| - "-Xlint:stars-align", // Pattern sequence wildcard must align with sequence component. |
45 |
| - "-Xlint:type-parameter-shadow", // A local type parameter shadows a type already in scope. |
46 |
| - "-Ywarn-dead-code", // Warn when dead code is identified. |
47 |
| - "-Ywarn-extra-implicit", // Warn when more than one implicit parameter section is defined. |
48 |
| - "-Ywarn-numeric-widen", // Warn when numerics are widened. |
49 |
| - "-Ywarn-unused:implicits", // Warn if an implicit parameter is unused. |
50 |
| - "-Ywarn-unused:imports", // Warn if an import selector is not referenced. |
51 |
| - "-Ywarn-unused:locals", // Warn if a local definition is unused. |
52 |
| - "-Ywarn-unused:params", // Warn if a value parameter is unused. |
53 |
| - "-Ywarn-unused:patvars", // Warn if a variable bound in a pattern is unused. |
54 |
| - "-Ywarn-unused:privates", // Warn if a private member is unused. |
55 |
| - "-Ywarn-value-discard" // Warn when non-Unit expression results are unused. |
56 |
| - ), |
57 |
| - javacOptions ++= Seq( |
58 |
| - "-Xlint:unchecked", |
59 |
| - "-Xlint:deprecation" |
60 |
| - ), |
61 | 56 | libraryDependencies ++= Dependencies.core,
|
62 | 57 | // Needed because the API doc for Akka-Persistence can't be found and the warning would abort publishing
|
63 | 58 | Compile / doc / scalacOptions := Seq()
|
64 | 59 | )
|
65 |
| - |
66 |
| -lazy val docs = project |
67 |
| - .in(file("mdocs")) |
68 |
| - .settings( |
69 |
| - mdocOut := new File("."), |
70 |
| - mdocVariables := Map( |
71 |
| - "VERSION" -> version.value |
72 |
| - ) |
73 |
| - ) |
74 |
| - .dependsOn(root) |
75 |
| - .enablePlugins(MdocPlugin) |
0 commit comments