forked from scalalandio/chimney
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sbt
158 lines (145 loc) · 4.67 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}
val versions = new {
val scala212 = "2.12.12"
val scala213 = "2.13.5"
}
val settings = Seq(
version := "0.6.1",
scalaVersion := versions.scala213,
crossScalaVersions := Seq(versions.scala212, versions.scala213),
scalacOptions ++= Seq(
"-target:jvm-1.8",
"-encoding", "UTF-8",
"-unchecked",
"-deprecation",
"-explaintypes",
"-feature",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Xlint:adapted-args",
"-Xlint:delayedinit-select",
"-Xlint:doc-detached",
"-Xlint:inaccessible",
"-Xlint:infer-any",
"-Xlint:nullary-unit",
"-Xlint:option-implicit",
"-Xlint:package-object-classes",
"-Xlint:poly-implicit-overload",
"-Xlint:private-shadow",
"-Xlint:stars-align",
"-Xlint:type-parameter-shadow",
"-Ywarn-unused:locals",
"-Ywarn-macros:after",
"-Xfatal-warnings",
"-language:higherKinds"
),
scalacOptions ++= (
if (scalaVersion.value >= "2.13")
Seq("-Wunused:patvars")
else
Seq(
"-Xfuture",
"-Xexperimental",
"-Yno-adapted-args",
"-Ywarn-inaccessible",
"-Ywarn-infer-any",
"-Ywarn-nullary-override",
"-Ywarn-nullary-unit",
"-Xlint:by-name-right-associative",
"-Xlint:unsound-match",
"-Xlint:nullary-override"
)
),
scalacOptions in (Compile, console) --= Seq("-Ywarn-unused:imports", "-Xfatal-warnings")
)
val dependencies = Seq(
libraryDependencies ++= Seq(
"org.scala-lang.modules" %%% "scala-collection-compat" % "2.4.2",
"org.scala-lang" % "scala-reflect" % scalaVersion.value % "provided",
"com.lihaoyi" %%% "utest" % "0.7.7" % "test"
)
)
lazy val root = project
.in(file("."))
.settings(settings: _*)
.settings(publishSettings: _*)
.settings(noPublishSettings: _*)
.aggregate(chimneyJVM, chimneyJS, chimneyCatsJVM, chimneyCatsJS)
.dependsOn(chimneyJVM, chimneyJS, chimneyCatsJVM, chimneyCatsJS)
.enablePlugins(SphinxPlugin, GhpagesPlugin)
.settings(
Sphinx / version := version.value,
Sphinx / sourceDirectory := file("docs") / "source",
git.remoteRepo := "[email protected]:scalalandio/chimney.git"
)
lazy val chimney = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.dependsOn(protos % "test->test")
.settings(
moduleName := "chimney",
name := "chimney",
description := "Scala library for boilerplate free data rewriting",
testFrameworks += new TestFramework("utest.runner.Framework"),
addCompilerPlugin("org.typelevel" % "kind-projector" % "0.11.3" cross CrossVersion.full)
)
.settings(settings: _*)
.settings(publishSettings: _*)
.settings(dependencies: _*)
lazy val chimneyJVM = chimney.jvm
lazy val chimneyJS = chimney.js
lazy val chimneyCats = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.dependsOn(chimney % "test->test;compile->compile")
.settings(
moduleName := "chimney-cats",
name := "chimney-cats",
description := "Chimney module for validated transformers support",
testFrameworks += new TestFramework("utest.runner.Framework"),
addCompilerPlugin("org.typelevel" % "kind-projector" % "0.11.3" cross CrossVersion.full)
)
.settings(settings: _*)
.settings(publishSettings: _*)
.settings(dependencies: _*)
.settings(libraryDependencies += "org.typelevel" %%% "cats-core" % "2.4.2" % "provided")
lazy val chimneyCatsJVM = chimneyCats.jvm
lazy val chimneyCatsJS = chimneyCats.js
lazy val protos = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.settings(
moduleName := "chimney-protos",
name := "chimney-protos"
)
.settings(settings: _*)
.settings(noPublishSettings: _*)
lazy val protosJVM = protos.jvm
lazy val protosJS = protos.js
lazy val publishSettings = Seq(
organization := "io.scalaland",
homepage := Some(url("https://scalaland.io")),
licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
scmInfo := Some(
ScmInfo(url("https://github.com/scalalandio/chimney"), "scm:git:[email protected]:scalalandio/chimney.git")
),
publishTo := sonatypePublishToBundle.value,
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>
<developer>
<id>MateuszKubuszok</id>
<name>Mateusz Kubuszok</name>
<url>http://github.com/MateuszKubuszok</url>
</developer>
</developers>
)
)
lazy val noPublishSettings =
Seq(skip in publish := true, publishArtifact := false)