This repository has been archived by the owner on May 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sbt
74 lines (67 loc) · 2.08 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
import sbtrelease._
import ReleaseStateTransformations._
import ReleasePlugin._
import ReleaseKeys._
organization := "com.github.mpilquist"
name := "local-implicits"
scalaVersion := "2.11.5"
crossScalaVersions := Seq("2.10.5", "2.11.5")
crossBuild := true
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-compiler" % scalaVersion.value,
"org.scalatest" %% "scalatest" % "2.2.3" % "test"
)
scalacOptions in console in Compile <+= (packageBin in Compile) map {
pluginJar => "-Xplugin:" + pluginJar
}
scalacOptions in Test <+= (packageBin in Compile) map {
pluginJar => "-Xplugin:" + pluginJar
}
licenses += ("Three-clause BSD-style", url("https://github.com/mpilquist/local-implicits/blob/master/LICENSE"))
publishTo <<= version { v: String =>
val nexus = "https://oss.sonatype.org/"
if (v.trim.endsWith("SNAPSHOT"))
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
publishMavenStyle := true
publishArtifact in Test := false
pomIncludeRepository := { x => false }
pomExtra := (
<url>http://github.com/mpilquist/local-implicits</url>
<scm>
<url>git@github.com:mpilquist/local-implicits.git</url>
<connection>scm:git:git@github.com:mpilquist/local-implicits.git</connection>
</scm>
<developers>
<developer>
<id>mpilquist</id>
<name>Michael Pilquist</name>
<url>http://github.com/mpilquist</url>
</developer>
</developers>
)
pomPostProcess := { (node) =>
import scala.xml._
import scala.xml.transform._
def stripIf(f: Node => Boolean) = new RewriteRule {
override def transform(n: Node) =
if (f(n)) NodeSeq.Empty else n
}
val stripTestScope = stripIf { n => n.label == "dependency" && (n \ "scope").text == "test" }
new RuleTransformer(stripTestScope).transform(node)(0)
}
releaseSettings
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
publishArtifacts.copy(action = publishSignedAction),
setNextVersion,
commitNextVersion,
pushChanges
)