forked from rklaehn/radixtree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
103 lines (94 loc) · 3.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
import ReleaseTransformations._
lazy val commonSettings = Seq(
organization := "com.rklaehn",
scalaVersion := "2.11.7",
crossScalaVersions := Seq("2.10.5", "2.11.7"),
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value % "provided",
"com.rklaehn" %%% "sonicreducer" % "0.2.0",
"org.spire-math" %%% "cats" % "0.3.0",
"org.spire-math" %%% "algebra" % "0.3.1",
"org.scalatest" %%% "scalatest" % "3.0.0-M7" % "test",
"org.spire-math" %%% "algebra-laws" % "0.3.1" % "test",
"org.spire-math" %%% "algebra-std" % "0.3.1" % "test",
// thyme
"ichi.bench" % "thyme" % "0.1.1" % "test" from "https://github.com/Ichoran/thyme/raw/9ff531411e10c698855ade2e5bde77791dd0869a/Thyme.jar"
),
scalacOptions ++= Seq(
"-deprecation",
"-unchecked",
"-feature"
),
licenses += ("Apache License, Version 2.0", url("http://www.apache.org/licenses/LICENSE-2.0.txt")),
homepage := Some(url("http://github.com/rklaehn/radixtree")),
// release stuff
credentials += Credentials(Path.userHome / ".ivy2" / ".credentials"),
releaseCrossBuild := true,
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := Function.const(false),
publishTo <<= version { v =>
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")
},
pomExtra :=
<scm>
<url>[email protected]:rklaehn/radixtree.git</url>
<connection>scm:git:[email protected]:rklaehn/radixtree.git</connection>
</scm>
<developers>
<developer>
<id>r_k</id>
<name>Rüdiger Klaehn</name>
<url>http://github.com/rklaehn/</url>
</developer>
</developers>
,
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
ReleaseStep(action = Command.process("package", _)),
setReleaseVersion,
commitReleaseVersion,
tagRelease,
ReleaseStep(action = Command.process("publishSigned", _)),
setNextVersion,
commitNextVersion,
ReleaseStep(action = Command.process("sonatypeReleaseAll", _)),
pushChanges))
lazy val noPublish = Seq(
publish := {},
publishLocal := {},
publishArtifact := false)
lazy val root = project.in(file("."))
.aggregate(coreJVM, coreJS, instrumentedTest)
.settings(name := "root")
.settings(commonSettings: _*)
.settings(noPublish: _*)
lazy val core = crossProject.crossType(CrossType.Pure).in(file("."))
.settings(name := "radixtree")
.settings(commonSettings: _*)
lazy val instrumentedTest = project.in(file("instrumentedTest"))
.settings(name := "instrumentedTest")
.settings(commonSettings: _*)
.settings(instrumentedTestSettings: _*)
.settings(noPublish: _*)
.dependsOn(coreJVM)
lazy val instrumentedTestSettings = {
def makeAgentOptions(classpath:Classpath) : String = {
val jammJar = classpath.map(_.data).filter(_.toString.contains("jamm")).head
s"-javaagent:$jammJar"
}
Seq(
javaOptions in Test <+= (dependencyClasspath in Test).map(makeAgentOptions),
libraryDependencies += "com.github.jbellis" % "jamm" % "0.3.0" % "test",
fork := true
)
}
lazy val coreJVM = core.jvm
lazy val coreJS = core.js