forked from erikvanoosten/metrics-scala
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
109 lines (85 loc) · 3.42 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
// Akka versions: 2.1.4, 2.2.3, 2.3.2
akkaVersion := ""
organization := "nl.grons"
name := "metrics-scala"
lazy val baseVersion = "3.1.0"
version <<= (scalaVersion, akkaVersion) { (sv, av) =>
val akkaVersion = if (sv.startsWith("2.1") && av.nonEmpty) "_a" + av.split('.').take(2).mkString(".") else ""
baseVersion + akkaVersion
}
description <<= (scalaVersion, akkaVersion) { (sv, av) =>
val akkaDescription = if (sv.startsWith("2.1") && av.nonEmpty) "Akka " + av +" and " else ""
"metrics-scala for " + akkaDescription + "Scala " + sbt.cross.CrossVersionUtil.binaryScalaVersion(sv)
}
scalaVersion := "2.10.0"
crossScalaVersions := Seq("2.9.1", "2.9.1-1", "2.9.2", "2.9.3", "2.10.0", "2.11.0")
crossVersion := CrossVersion.binary
resolvers ++= Seq(
"Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository"
)
libraryDependencies ++= Seq(
"com.codahale.metrics" % "metrics-core" % "3.0.2",
"com.codahale.metrics" % "metrics-healthchecks" % "3.0.2",
"junit" % "junit" % "4.11" % "test",
"org.mockito" % "mockito-all" % "1.9.5" % "test"
)
libraryDependencies <++= (scalaVersion, akkaVersion) { (sv, av) =>
if (sv.startsWith("2.10") && av.nonEmpty)
Seq(
"com.typesafe.akka" %% "akka-actor" % av,
"com.typesafe.akka" %% "akka-testkit" % av % "test"
)
else if (sv.startsWith("2.11") && av.nonEmpty)
Seq(
"com.typesafe.akka" %% "akka-actor" % av,
"com.typesafe.akka" % "akka-testkit_2.11.0-RC4" % "2.3.0" intransitive()
)
else
Seq()
}
libraryDependencies <+= (scalaVersion) { sv =>
if (sv.startsWith("2.1"))
"org.scalatest" %% "scalatest" % "2.1.3" % "test"
else
"org.scalatest" %% "scalatest" % "1.9.2" % "test"
}
unmanagedSourceDirectories in Compile <<= (unmanagedSourceDirectories in Compile, sourceDirectory in Compile, akkaVersion) { (sds: Seq[java.io.File], sd: java.io.File, av: String) =>
val extra = new java.io.File(sd, "akka")
(if (av.nonEmpty && extra.exists) Seq(extra) else Seq()) ++ sds
}
unmanagedSourceDirectories in Test <<= (unmanagedSourceDirectories in Test, sourceDirectory in Test, akkaVersion) { (sds: Seq[java.io.File], sd: java.io.File, av: String) =>
val extra = new java.io.File(sd, "akka")
(if (av.nonEmpty && extra.exists) Seq(extra) else Seq()) ++ sds
}
javacOptions ++= Seq("-Xmx512m", "-Xms128m", "-Xss10m")
javaOptions ++= Seq("-Xmx512m", "-Djava.awt.headless=true")
scalacOptions ++= Seq("-deprecation", "-unchecked")
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (version.value.trim.endsWith("SNAPSHOT"))
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
credentials += Credentials(Path.userHome / ".sbt" / "sonatype.credentials")
publishMavenStyle := true
publishArtifact in Test := false
pomIncludeRepository := { _ => false }
licenses := Seq("Apache 2" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt"))
pomExtra := (
<url>https://github.com/erikvanoosten/metrics-scala</url>
<scm>
<url>[email protected]:erikvanoosten/metrics-scala.git</url>
<connection>scm:git:[email protected]:erikvanoosten/metrics-scala.git</connection>
</scm>
<developers>
<developer>
<name>Erik van Oosten</name>
<url>http://day-to-day-stuff.blogspot.com/</url>
</developer>
<developer>
<name>Brian Scully</name>
<url>https://github.com/scullxbones/</url>
</developer>
</developers>
)