forked from scalalandio/chimney
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sbt
152 lines (142 loc) · 4.34 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
val versions = new {
val shapelessVersion = "2.3.3"
val scalatestVersion = "3.0.5"
val scalaVersion = "2.12.5"
}
val settings = Seq(
version := "0.1.10",
scalaVersion := versions.scalaVersion,
crossScalaVersions := Seq("2.11.12", "2.12.5"),
scalacOptions ++= Seq(
"-target:jvm-1.8",
"-encoding",
"UTF-8",
"-unchecked",
"-deprecation",
"-explaintypes",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-inaccessible",
"-Ywarn-infer-any",
"-Ywarn-nullary-override",
"-Ywarn-nullary-unit",
"-Ywarn-numeric-widen",
"-Xfatal-warnings",
"-Xfuture",
"-Xlint:adapted-args",
"-Xlint:by-name-right-associative",
"-Xlint:delayedinit-select",
"-Xlint:doc-detached",
"-Xlint:inaccessible",
"-Xlint:infer-any",
"-Xlint:missing-interpolator",
"-Xlint:nullary-override",
"-Xlint:nullary-unit",
"-Xlint:option-implicit",
"-Xlint:package-object-classes",
"-Xlint:poly-implicit-overload",
"-Xlint:private-shadow",
"-Xlint:stars-align",
"-Xlint:type-parameter-shadow",
"-Xlint:unsound-match",
"-Xexperimental"
),
scalacOptions in (Compile, console) --= Seq("-Ywarn-unused:imports", "-Xfatal-warnings")
)
val dependencies = Seq(
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"com.chuusai" %%% "shapeless" % versions.shapelessVersion,
"org.scalatest" %%% "scalatest" % versions.scalatestVersion % "test"
)
)
lazy val root = project
.in(file("."))
.settings(settings: _*)
.settings(publishSettings: _*)
.settings(noPublishSettings: _*)
.aggregate(chimneyJVM, chimneyJS, protosJVM, protosJS)
.dependsOn(chimneyJVM, chimneyJS)
lazy val chimney = crossProject
.crossType(CrossType.Pure)
.settings(
moduleName := "chimney",
name := "chimney",
description := "Scala library for boilerplate free data rewriting"
)
.settings(settings: _*)
.settings(publishSettings: _*)
.settings(dependencies: _*)
.dependsOn(protos % "test->compile")
lazy val chimneyJVM = chimney.jvm
lazy val chimneyJS = chimney.js
lazy val protos = crossProject
.crossType(CrossType.Pure)
.settings(
name := "chimney-protos",
libraryDependencies += "com.thesamet.scalapb" %%% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion,
PB.targets in Compile := Seq(scalapb.gen() -> (sourceManaged in Compile).value),
PB.protoSources in Compile := Seq(file("protos/src/main/protobuf")),
coverageExcludedPackages := "<empty>;(.*)"
)
.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:git@github.com:scalalandio/chimney.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>
<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)
lazy val readme = scalatex
.ScalatexReadme(
projectId = "readme",
wd = file(""),
url = "https://github.com/scalalandio/chimney/tree/master",
source = "Readme"
)
.settings(noPublishSettings : _*)
.settings(
scalaVersion := versions.scalaVersion,
siteSourceDirectory := target.value / "scalatex",
git.remoteRepo := "git@github.com:scalalandio/chimney.git",
includeFilter in (makeSite in Jekyll) := new FileFilter {
def accept(p: File) = true
}
)
.enablePlugins(GhpagesPlugin)