-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
build.sbt
141 lines (123 loc) · 4.35 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
import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}
lazy val root = project.in(file("."))
.settings(coreSettings: _*)
.settings(noPublishSettings: _*)
.aggregate(octopusJVM, octopusJS, octopusCatsJVM, octopusCatsJS, octopusScalazJVM, octopusScalazJS)
.dependsOn(octopusJVM, octopusJS, octopusCatsJVM, octopusCatsJS, octopusScalazJVM, octopusScalazJS)
lazy val versions = new {
val scala213 = "2.13.1"
val scala212 = "2.12.11"
val shapeless = "2.3.3"
val scalatest = "3.2.2"
val cats = "2.2.0"
val catsEffect = "2.2.0"
val monix = "3.2.2"
val scalaz = "7.2.30"
}
lazy val dependencies = Seq(
libraryDependencies += "com.chuusai" %%% "shapeless" % versions.shapeless,
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value,
libraryDependencies += "org.scalatest" %%% "scalatest" % versions.scalatest % "test"
)
lazy val octopus = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.settings(
moduleName := "octopus",
name := "octopus",
description := "Boilerplate-free validation library for Scala"
)
.settings(commonSettings: _*)
.settings(publishSettings: _*)
.settings(dependencies: _*)
lazy val octopusJVM = octopus.jvm
lazy val octopusJS = octopus.js
lazy val octopusCats = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.settings(
moduleName := "octopus-cats", name := "octopus-cats",
description := "Cats integration for Octopus validation library"
)
.settings(commonSettings: _*)
.settings(publishSettings: _*)
.settings(dependencies: _*)
.settings(
libraryDependencies += "org.typelevel" %%% "cats-core" % versions.cats % "test,provided",
libraryDependencies += "org.typelevel" %%% "cats-effect" % versions.catsEffect % "test",
libraryDependencies += "io.monix" %%% "monix" % versions.monix % "test"
)
.dependsOn(octopus % "compile->compile;test->test")
lazy val octopusCatsJVM = octopusCats.jvm
lazy val octopusCatsJS = octopusCats.js
lazy val octopusScalaz = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.settings(
moduleName := "octopus-scalaz", name := "octopus-scalaz",
description := "Scalaz integration for Octopus validation library"
)
.settings(commonSettings: _*)
.settings(publishSettings: _*)
.settings(dependencies: _*)
.settings(
libraryDependencies += "org.scalaz" %%% "scalaz-core" % versions.scalaz % "test,provided",
libraryDependencies += "org.scalaz" %% "scalaz-concurrent" % versions.scalaz % "test"
)
.dependsOn(octopus % "compile->compile;test->test")
lazy val octopusScalazJVM = octopusScalaz.jvm
lazy val octopusScalazJS = octopusScalaz.js
lazy val coreSettings = commonSettings ++ publishSettings
lazy val commonSettings = Seq(
scalaVersion := versions.scala213,
crossScalaVersions := Seq(versions.scala212, versions.scala213),
scalacOptions := commonScalacOptions
) ++ lintUnused ++ experimental
lazy val commonScalacOptions = Seq(
"-deprecation",
"-encoding", "UTF-8",
"-feature",
"-language:higherKinds",
"-unchecked",
"-Xfatal-warnings",
"-Xlint",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Ywarn-value-discard"
)
lazy val lintUnused = Seq(
scalacOptions ++= {
if (scalaVersion.value <= "2.12.1") Seq() else Seq("-Xlint:-unused")
}
)
lazy val experimental = Seq(
scalacOptions ++= {
if (scalaVersion.value < "2.12.0") Seq("-Xexperimental") else Seq()
}
)
lazy val publishSettings = Seq(
organization := "com.github.krzemin",
homepage := Some(url("https://github.com/krzemin/octopus")),
licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
scmInfo := Some(ScmInfo(url("https://github.com/krzemin/octopus"), "scm:git:[email protected]:krzemin/octopus.git")),
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := { _ => false },
pomExtra := (
<developers>
<developer>
<id>krzemin</id>
<name>Piotr Krzemiński</name>
<url>http://github.com/krzemin</url>
</developer>
</developers>
)
)
lazy val noPublishSettings = Seq(
skip in publish := true,
publishArtifact := false
)