-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
106 lines (84 loc) · 2.71 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
name := "cardano"
organization := "org.jrj-d"
scalaVersion := "2.12.0"
resolvers ++= Seq(
"Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/",
"Sonatype Releases" at "https://oss.sonatype.org/content/repositories/releases/"
)
libraryDependencies ++= Seq (
"org.scalanlp" %% "breeze" % "0.13",
"org.scalanlp" %% "breeze-natives" % "0.13",
"org.scalatest" %% "scalatest" % "3.0.1" % "test"
)
initialCommands in console :=
"""
|def time[R](block: => R): R = {
| val t0 = System.nanoTime()
| val result = block // call-by-name
| val t1 = System.nanoTime()
| println("Elapsed time: " + (t1 - t0)/1e9 + "s")
| result
|}
|
|import cardano._
""".stripMargin
// scalastyle for main code
lazy val compileScalaStyle = taskKey[Unit]("compileScalaStyle")
compileScalaStyle := {
org.scalastyle.sbt.ScalastylePlugin.scalastyle.in(Compile).toTask("").value
}
(compile in Compile) <<= (compile in Compile) dependsOn compileScalaStyle
// scalastyle for tests
(scalastyleConfig in Test) := baseDirectory.value / "scalastyle-test-config.xml"
lazy val testScalaStyle = taskKey[Unit]("testScalaStyle")
testScalaStyle := {
org.scalastyle.sbt.ScalastylePlugin.scalastyle.in(Test).toTask("").value
}
(test in Test) <<= (test in Test) dependsOn testScalaStyle
// publishing
publishMavenStyle := true
publishArtifact in Test := false
pomIncludeRepository := { _ => false }
credentials += Credentials(Path.userHome / ".sbt" / ".oss-credentials")
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("Sonatype Snapshots Nexus" at nexus + "content/repositories/snapshots")
else
Some("Sonatype Releases Nexus" at nexus + "service/local/staging/deploy/maven2")
}
pomExtra := (
<url>https://github.com/jrj-d/cardano</url>
<licenses>
<license>
<name>Apache License 2.0</name>
<url>https://opensource.org/licenses/Apache-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>[email protected]:jrj-d/cardano.git</url>
<connection>scm:[email protected]:jrj-d/cardano.git</connection>
</scm>
<developers>
<developer>
<id>jrj-d</id>
<name>Julien Dumazert</name>
<url>https://github.com/jrj-d</url>
</developer>
</developers>)
import ReleaseTransformations._
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
ReleaseStep(action = Command.process("publishSigned", _)),
setNextVersion,
commitNextVersion,
ReleaseStep(action = Command.process("sonatypeReleaseAll", _)),
pushChanges
)