forked from scalalandio/chimney
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
155 lines (143 loc) · 4.36 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
import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}
val versions = new {
val scalaVersion = "2.13.0"
}
val settings = Seq(
version := "0.3.2",
scalaVersion := versions.scalaVersion,
crossScalaVersions := Seq("2.11.12", "2.12.8", "2.13.0"),
scalacOptions ++= Seq(
"-target:jvm-1.8",
"-encoding", "UTF-8",
"-unchecked",
"-deprecation",
"-explaintypes",
"-feature",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
// "-Xfatal-warnings",
"-Xlint:adapted-args",
"-Xlint:delayedinit-select",
"-Xlint:doc-detached",
"-Xlint:inaccessible",
"-Xlint:infer-any",
"-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"
) ++ (
if (scalaVersion.value >= "2.13")
Nil
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"
)
),
scalacOptions in (Compile, console) --= Seq("-Ywarn-unused:imports", "-Xfatal-warnings")
)
val dependencies = Seq(
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value % "provided",
"org.scala-lang" % "scala-compiler" % scalaVersion.value % "provided",
"com.lihaoyi" %%% "utest" % (if (scalaVersion.value >= "2.12") "0.6.9" else "0.6.8") % "test"
)
)
lazy val root = project
.in(file("."))
.settings(settings: _*)
.settings(publishSettings: _*)
.settings(noPublishSettings: _*)
.aggregate(chimneyJVM, chimneyJS)
.dependsOn(chimneyJVM, chimneyJS)
lazy val chimney = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.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")
)
.settings(settings: _*)
.settings(publishSettings: _*)
.settings(dependencies: _*)
.nativeSettings(nativeLinkStubs := true)
lazy val chimneyJVM = chimney.jvm
lazy val chimneyJS = chimney.js
lazy val chimneyNative = chimney.native
lazy val protos = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.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 protosNative = protos.native
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)