1- name := " query-monad-code"
2-
3- version := " 1.0-SNAPSHOT"
1+ ThisBuild / organization := " com.zengularity"
42
53ThisBuild / scalaVersion := " 2.12.7"
64ThisBuild / crossScalaVersions := Seq (" 2.11.12" , " 2.12.7" )
75
8- def scalacOptionsVersion (scalaVersion : String ) = {
9- val defaultOptions = Seq (
10- " -deprecation" , // Emit warning and location for usages of deprecated APIs.
11- " -encoding" ,
12- " utf-8" , // Specify character encoding used by source files.
13- " -explaintypes" , // Explain type errors in more detail.
14- " -feature" , // Emit warning and location for usages of features that should be imported explicitly.
15- " -unchecked" , // Enable additional warnings where generated code depends on assumptions.
16- " -Xcheckinit" , // Wrap field accessors to throw an exception on uninitialized access.
17- " -Xfatal-warnings" , // Fail the compilation if there are any warnings.
18- " -Xlint" ,
19- " -Yno-adapted-args" , // Do not adapt an argument list (either by inserting () or creating a tuple) to match the receiver.
20- " -Ypartial-unification" , // Enable partial unification in type constructor inference
21- " -Ywarn-dead-code" , // Warn when dead code is identified.
22- " -Ywarn-inaccessible" , // Warn about inaccessible types in method signatures.
23- " -Ywarn-infer-any" , // Warn when a type argument is inferred to be `Any`.
24- " -Ywarn-nullary-override" , // Warn when non-nullary `def f()' overrides nullary `def f'.
25- " -Ywarn-nullary-unit" , // Warn when nullary methods return Unit.
26- " -Ywarn-numeric-widen" , // Warn when numerics are widened.
27- " -Ywarn-unused" , // Warn if unused.
28- " -Ywarn-value-discard" // Warn when non-Unit expression results are unused.
29- )
30- val v211Options = Seq (
31- " -Xsource:2.12" // See https://github.com/scala/scala/releases/tag/v2.11.11
32- )
33- val v212Options = Seq (
34- " -Ywarn-extra-implicit" // Warn when more than one implicit parameter section is defined.
35- )
36-
37- CrossVersion .partialVersion(scalaVersion) match {
38- case Some ((2L , 11L )) => defaultOptions ++ v211Options
39- case _ => defaultOptions ++ v212Options
40- }
41- }
42-
43- // Common values
44- def commonSettings = Seq (
45- organization := " com.zengularity" ,
46- crossPaths := false ,
47- scalacOptions ++= scalacOptionsVersion(scalaVersion.value),
48- scalacOptions in (Compile , console) ~= (_.filterNot(
49- Set (
50- " -Ywarn-unused:imports" ,
51- " -Xfatal-warnings"
52- )
53- )),
54- scalacOptions in (Test , compile) ~= (_.filterNot(
55- Set (
56- " -Ywarn-unused:imports" ,
57- " -Xfatal-warnings" ,
58- " -Yrangepos"
59- )
60- )),
61- resolvers ++= Seq [Resolver ](
62- Resolver .sonatypeRepo(" releases" )
63- )
64- )
65-
666// Scalafmt
677ThisBuild / scalafmtOnCompile := true
688
@@ -73,12 +13,14 @@ wartremoverErrors ++= Warts.unsafe
7313// Projects definitions
7414//
7515
16+ val nameRoot = " query-monad"
17+
7618// Core + Modules
7719
7820lazy val core = (project in file(" core" ))
7921 .settings(
80- commonSettings ++ Seq (
81- name := " query -core" ,
22+ Settings .commonLibSettings ++ Seq (
23+ name := s " $nameRoot -core " ,
8224 libraryDependencies ++= Seq (
8325 Dependencies .acolyte % Test ,
8426 Dependencies .anorm % Test ,
@@ -89,9 +31,9 @@ lazy val core = (project in file("core"))
8931 )
9032
9133lazy val playSqlModule = (project in file(" modules/play-sql" ))
92- .settings(commonSettings )
34+ .settings(Settings .commonLibSettings )
9335 .settings(
94- name := " query -play-sql" ,
36+ name := s " $nameRoot -play-sql " ,
9537 libraryDependencies ++= Seq (
9638 jdbc,
9739 evolutions % Test ,
@@ -111,7 +53,8 @@ lazy val playSqlModule = (project in file("modules/play-sql"))
11153lazy val sampleAppExample = (project in file(" examples/sample-app" ))
11254 .enablePlugins(PlayScala )
11355 .settings(
114- commonSettings ++ Seq (
56+ Settings .commonExamplesSettings ++ Seq (
57+ name := s " $nameRoot-example-sample-app " ,
11558 name := " sample-app-example" ,
11659 libraryDependencies ++= Seq (
11760 Dependencies .anorm,
@@ -123,9 +66,9 @@ lazy val sampleAppExample = (project in file("examples/sample-app"))
12366
12467lazy val todoAppExample = (project in file(" examples/todo-app" ))
12568 .enablePlugins(PlayScala )
126- .settings(commonSettings )
69+ .settings(Settings .commonExamplesSettings )
12770 .settings(
128- name := " todo-app-example " ,
71+ name := s " $nameRoot -example- todo-app" ,
12972 libraryDependencies ++= Seq (
13073 evolutions,
13174 Dependencies .anorm,
@@ -143,3 +86,4 @@ lazy val todoAppExample = (project in file("examples/todo-app"))
14386lazy val root : Project = project
14487 .in(file(" ." ))
14588 .aggregate(core, playSqlModule, sampleAppExample, todoAppExample)
89+ .settings(Publish .skipSettings)
0 commit comments