-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sbt
More file actions
120 lines (109 loc) · 3.49 KB
/
Copy pathbuild.sbt
File metadata and controls
120 lines (109 loc) · 3.49 KB
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
import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations._
import scoverage._
import xerial.sbt.Sonatype._
def scala213 = Def.setting(scalaVersion.value.startsWith("2.13"))
lazy val crossVersionSourcesSettings =
Seq(Compile, Test).map { sc =>
(sc / unmanagedSourceDirectories) ++= {
(sc / unmanagedSourceDirectories).value.flatMap { dir =>
if (dir.getPath.endsWith("scala"))
Seq(new File(dir.getPath + (if (scala213.value) "_2.13+" else "_2.13-")))
else
Seq.empty
}
}
}
val coverageSettings = Seq(
CoverallsKeys.coverallsTokenFile := Some("./token.txt"),
ScoverageKeys.coverageMinimumStmtTotal := 100,
ScoverageKeys.coverageFailOnMinimum := true,
ScoverageKeys.coverageHighlighting := true
)
val releaseSettings = Seq(
releaseCrossBuild := true,
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("+publishSigned"),
releaseStepCommand("sonatypeBundleRelease"),
setNextVersion,
commitNextVersion,
pushChanges
)
)
val publishSettings = sonatypeSettings ++ Seq(
startYear := Some(2015),
homepage := Some(url("http://github.com/jozic/scalaj")),
developers := List(
Developer("jozic", "Eugene Platonov", "jozic@live.com", url("http://github.com/jozic"))
),
scmInfo := homepage.value.map(ScmInfo(_, "scm:git:git@github.com:jozic/scalaj.git")),
licenses := Seq("BSD-style" -> url("http://www.opensource.org/licenses/BSD-3-Clause")),
publishTo := sonatypePublishToBundle.value
)
val commonSettings = Seq(
organization := "com.daodecode",
scalaVersion := "2.13.11",
crossScalaVersions := Seq(scalaVersion.value, "2.12.18"),
scalafmtConfig := Some(scalaj.base / "scalafmt-config/.scalafmt.conf")
) ++ releaseSettings ++ crossVersionSourcesSettings
val moduleSettings = commonSettings ++ Seq(
scalacOptions :=
(if (scala213.value)
Seq(
"-Xlint",
"-unchecked",
"-deprecation",
"-Xfatal-warnings",
"-Ywarn-dead-code",
"-feature",
"-Ywarn-unused",
"-encoding",
"UTF-8",
"-Wconf:origin=scala.collection.compat.*:s"
)
else
Seq(
"-Xlint",
"-unchecked",
"-deprecation",
"-Xfatal-warnings",
"-Ywarn-inaccessible",
"-Ywarn-dead-code",
"-Ywarn-adapted-args",
"-Ywarn-nullary-unit",
"-feature",
"-Ywarn-unused",
"-Ywarn-unused-import",
"-encoding",
"UTF-8"
)),
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "3.2.16" % "test"
)
) ++ publishSettings ++ coverageSettings
lazy val scalaj: Project =
project
.in(file("."))
.aggregate(`scalaj-collection`, `scalaj-google-optional`)
.settings(
publishArtifact := false,
publishTo := Some(Resolver.file("Unused transient repository", file("target/unusedrepo"))),
commonSettings
)
lazy val `scalaj-collection` = project.settings(
moduleSettings ++ Seq(
libraryDependencies ++= Seq(
"org.scala-lang.modules" %% "scala-collection-compat" % "2.10.0"
)
)
)
lazy val `scalaj-google-optional` =
project.settings(moduleSettings).dependsOn(`scalaj-collection` % "compile->compile;test->test")
addCommandAlias("scoverage", ";clean;coverage;test;coverageReport")
addCommandAlias("checkFormatting", ";scalafmtCheck;test:scalafmtCheck")