forked from pathikrit/better-files
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
131 lines (121 loc) · 4.06 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
val username = "pathikrit"
val repo = "better-files"
lazy val commonSettings = Seq(
organization := s"com.github.$username",
scalaVersion := "2.11.8",
crossScalaVersions := Seq("2.10.6", "2.11.8"),
crossVersion := CrossVersion.binary,
javacOptions ++= Seq("-source", "1.8", "-target", "1.8", "-Xlint"),
scalacOptions ++= Seq(
"-deprecation",
"-encoding", "UTF-8",
"-feature",
"-language:implicitConversions",
"-language:reflectiveCalls",
"-unchecked",
"-Xfatal-warnings",
"-Xlint",
"-Yinline-warnings",
"-Yno-adapted-args",
"-Ywarn-dead-code",
//"-Ywarn-numeric-widen", // bugs in 2.10
//"-Ywarn-value-discard",
//"-Ywarn-unused-import", // 2.11 only
//"-Xexperimental", // 2.11 only
"-Xfuture"
),
libraryDependencies += "org.scalatest" %% "scalatest" % "2.2.6" % Test,
updateImpactOpenBrowser := false
)
lazy val core = (project in file("core"))
.settings(commonSettings: _*)
.settings(publishSettings: _*)
.settings(
name := repo,
description := "Simple, safe and intuitive I/O in Scala"
)
lazy val akka = (project in file("akka"))
.settings(commonSettings: _*)
.settings(publishSettings: _*)
.settings(
name := s"$repo-akka",
description := "Reactive file watcher using Akka actors",
libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.3.15"
)
.dependsOn(core)
lazy val shapelessScanner = (project in file("shapeless"))
.settings(commonSettings: _*)
.settings(noPublishSettings: _*)
.settings(
name := s"shapeless-scanner",
description := "Shapeless Scanner",
libraryDependencies += "com.chuusai" %% "shapeless" % "2.3.1"
)
.dependsOn(core)
lazy val benchmarks = (project in file("benchmarks"))
.settings(commonSettings: _*)
.settings(noPublishSettings: _*)
.settings(
name := s"$repo-benchmarks",
libraryDependencies += "com.storm-enroute" %% "scalameter-core" % "0.7" % Test
)
.dependsOn(core)
lazy val root = (project in file("."))
.settings(commonSettings: _*)
.settings(docSettings: _*)
.settings(noPublishSettings: _*)
.settings(releaseSettings: _*)
.aggregate(core, akka, shapelessScanner)
import UnidocKeys._
lazy val docSettings = unidocSettings ++ site.settings ++ ghpages.settings ++ Seq(
autoAPIMappings := true,
unidocProjectFilter in (ScalaUnidoc, unidoc) := inProjects(core, akka),
SiteKeys.siteSourceDirectory := file("site"),
site.addMappingsToSiteDir(mappings in (ScalaUnidoc, packageDoc), "latest/api"),
git.remoteRepo := s"[email protected]:$username/$repo.git"
)
import ReleaseTransformations._
lazy val releaseSettings = Seq(
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
//runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
publishArtifacts,
setNextVersion,
commitNextVersion,
releaseStepCommand("sonatypeReleaseAll"),
pushChanges
)
)
lazy val noPublishSettings = Seq(
publish := (),
publishLocal := (),
publishArtifact := false
)
lazy val publishSettings = Seq(
homepage := Some(url(s"https://github.com/$username/$repo")),
licenses += "MIT" -> url(s"https://github.com/$username/$repo/blob/master/LICENSE"),
scmInfo := Some(ScmInfo(url(s"https://github.com/$username/$repo"), s"[email protected]:$username/$repo.git")),
apiURL := Some(url(s"https://$username.github.io/$repo/latest/api/")),
releaseCrossBuild := true,
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
publishMavenStyle := true,
publishArtifact in Test := false,
publishTo := Some(if (isSnapshot.value) Opts.resolver.sonatypeSnapshots else Opts.resolver.sonatypeStaging),
credentials ++= (for {
username <- sys.env.get("SONATYPE_USERNAME")
password <- sys.env.get("SONATYPE_PASSWORD")
} yield Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", username, password)).toSeq,
pomExtra :=
<developers>
<developer>
<id>pathikrit</id>
<name>Pathikrit Bhowmick</name>
<url>http://github.com/pathikrit</url>
</developer>
</developers>
)