1
- name := " query-monad-code"
2
-
3
- version := " 1.0-SNAPSHOT"
1
+ ThisBuild / organization := " com.zengularity"
4
2
5
3
ThisBuild / scalaVersion := " 2.12.7"
6
4
ThisBuild / crossScalaVersions := Seq (" 2.11.12" , " 2.12.7" )
7
5
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
-
66
6
// Scalafmt
67
7
ThisBuild / scalafmtOnCompile := true
68
8
@@ -73,12 +13,14 @@ wartremoverErrors ++= Warts.unsafe
73
13
// Projects definitions
74
14
//
75
15
16
+ val nameRoot = " query-monad"
17
+
76
18
// Core + Modules
77
19
78
20
lazy val core = (project in file(" core" ))
79
21
.settings(
80
- commonSettings ++ Seq (
81
- name := " query -core" ,
22
+ Settings .commonLibSettings ++ Seq (
23
+ name := s " $nameRoot -core " ,
82
24
libraryDependencies ++= Seq (
83
25
Dependencies .acolyte % Test ,
84
26
Dependencies .anorm % Test ,
@@ -89,9 +31,9 @@ lazy val core = (project in file("core"))
89
31
)
90
32
91
33
lazy val playSqlModule = (project in file(" modules/play-sql" ))
92
- .settings(commonSettings )
34
+ .settings(Settings .commonLibSettings )
93
35
.settings(
94
- name := " query -play-sql" ,
36
+ name := s " $nameRoot -play-sql " ,
95
37
libraryDependencies ++= Seq (
96
38
jdbc,
97
39
evolutions % Test ,
@@ -111,7 +53,8 @@ lazy val playSqlModule = (project in file("modules/play-sql"))
111
53
lazy val sampleAppExample = (project in file(" examples/sample-app" ))
112
54
.enablePlugins(PlayScala )
113
55
.settings(
114
- commonSettings ++ Seq (
56
+ Settings .commonExamplesSettings ++ Seq (
57
+ name := s " $nameRoot-example-sample-app " ,
115
58
name := " sample-app-example" ,
116
59
libraryDependencies ++= Seq (
117
60
Dependencies .anorm,
@@ -123,9 +66,9 @@ lazy val sampleAppExample = (project in file("examples/sample-app"))
123
66
124
67
lazy val todoAppExample = (project in file(" examples/todo-app" ))
125
68
.enablePlugins(PlayScala )
126
- .settings(commonSettings )
69
+ .settings(Settings .commonExamplesSettings )
127
70
.settings(
128
- name := " todo-app-example " ,
71
+ name := s " $nameRoot -example- todo-app" ,
129
72
libraryDependencies ++= Seq (
130
73
evolutions,
131
74
Dependencies .anorm,
@@ -143,3 +86,4 @@ lazy val todoAppExample = (project in file("examples/todo-app"))
143
86
lazy val root : Project = project
144
87
.in(file(" ." ))
145
88
.aggregate(core, playSqlModule, sampleAppExample, todoAppExample)
89
+ .settings(Publish .skipSettings)
0 commit comments