forked from hyperledger-labs/Scorex
-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.sbt
139 lines (114 loc) · 4.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
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
132
133
134
135
136
137
138
139
import scala.util.Try
name := "sparkz-core"
lazy val scala212 = "2.12.13"
lazy val scala213 = "2.13.8"
lazy val commonSettings = Seq(
scalaVersion := scala213,
crossScalaVersions := Seq(scala212, scala213),
resolvers ++= Resolver.sonatypeOssRepos("public"),
resolvers += "Maven Central Server" at "https://repo1.maven.org/maven2",
resolvers += "Typesafe Server" at "https://repo.typesafe.com/typesafe/releases",
wartremoverErrors ++= Seq(
Wart.Recursion,
Wart.TraversableOps,
Wart.Null,
Wart.Product,
Wart.PublicInference,
Wart.FinalVal,
Wart.IsInstanceOf,
Wart.JavaConversions,
Wart.JavaSerializable,
Wart.Serializable,
Wart.OptionPartial),
organization := "io.horizen",
organizationName := "Zen Blockchain Foundation",
version := "2.4.0",
licenses := Seq("CC0" -> url("https://creativecommons.org/publicdomain/zero/1.0/legalcode")),
homepage := Some(url("https://github.com/HorizenOfficial/Sparkz")),
pomExtra :=
<scm>
<url>https://github.com/HorizenOfficial/Sparkz</url>
<connection>scm:git:[email protected]:HorizenOfficial/Sparkz.git</connection>
</scm>
<developers>
<developer>
<id>HorizenOfficial</id>
<name>Zen Blockchain Foundation</name>
<url>https://github.com/HorizenOfficial</url>
</developer>
</developers>,
publishMavenStyle := true,
Test / publishArtifact := false,
publishTo := sonatypePublishToBundle.value,
fork := true // otherwise, "java.net.SocketException: maximum number of DatagramSockets reached"
)
val circeVersion = "0.14.5"
val akkaVersion = "2.8.5"
val akkaHttpVersion = "10.5.3"
val networkDependencies = Seq(
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
"com.typesafe.akka" %% "akka-http-core" % akkaHttpVersion,
"com.typesafe.akka" %% "akka-http" % akkaHttpVersion,
"com.typesafe.akka" %% "akka-parsing" % akkaHttpVersion,
"com.typesafe.akka" %% "akka-stream" % akkaVersion,
"commons-net" % "commons-net" % "3.10.0"
)
val apiDependencies = Seq(
"io.circe" %% "circe-core" % circeVersion,
"io.circe" %% "circe-generic" % circeVersion,
"io.circe" %% "circe-parser" % circeVersion,
"de.heikoseeberger" %% "akka-http-circe" % "1.39.2"
)
val loggingDependencies = Seq(
"ch.qos.logback" % "logback-classic" % "1.4.14"
)
val testingDependencies = Seq(
"com.typesafe.akka" %% "akka-testkit" % akkaVersion % "test",
"com.typesafe.akka" %% "akka-http-testkit" % akkaHttpVersion % "test",
"org.scalactic" %% "scalactic" % "3.2.15" % "test",
"org.scalatest" %% "scalatest" % "3.2.15" % "test",
"org.scalacheck" %% "scalacheck" % "1.17.0",
"org.scalatestplus" %% "scalatestplus-scalacheck" % "3.1.0.0-RC2" % Test,
"org.mockito" %% "mockito-scala" % "1.17.12" % Test
)
libraryDependencies ++= Seq(
"com.iheart" %% "ficus" % "1.5.2",
"org.scala-lang.modules" %% "scala-collection-compat" % "2.8.1",
"at.favre.lib" % "bcrypt" % "0.10.2"
) ++ networkDependencies ++ apiDependencies ++ loggingDependencies ++ testingDependencies
scalacOptions ++= Seq("-Wconf:cat=unused-nowarn:s")
javaOptions ++= Seq(
"-server"
)
Test / testOptions += Tests.Argument("-oD", "-u", "target/test-reports")
pomIncludeRepository := { _ => false }
val credentialFile = Path.userHome / ".ivy2" / ".credentials"
credentials ++= (for {
file <- if (credentialFile.exists) Some(credentialFile) else None
} yield Credentials(file)).toSeq
lazy val testkit = Project(id = "testkit", base = file(s"testkit"))
.dependsOn(basics)
.settings(commonSettings: _*)
lazy val examples = Project(id = "examples", base = file(s"examples"))
.dependsOn(basics, testkit)
.settings(commonSettings: _*)
lazy val basics = Project(id = "sparkz", base = file("."))
.dependsOn(scrypto, util)
.aggregate(scrypto, util)
.settings(commonSettings: _*)
lazy val scrypto = Project(id = "scrypto", base = file(s"scrypto"))
.dependsOn(util)
.settings(commonSettings: _*)
lazy val util = Project(id = "sparkz-util", base = file(s"sparkz-util"))
.settings(commonSettings: _*)
credentials ++= (for {
username <- Option(System.getenv().get("CONTAINER_OSSRH_JIRA_USERNAME"))
password <- Option(System.getenv().get("CONTAINER_OSSRH_JIRA_PASSWORD"))
} yield Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", username, password)).toSeq
// PGP key for signing a release build published to sonatype
// signing is done by sbt-pgp plugin
// how to generate a key - https://central.sonatype.org/pages/working-with-pgp-signatures.html
// how to export a key and use it with Travis - https://docs.scala-lang.org/overviews/contributors/index.html#export-your-pgp-key-pair
pgpPassphrase := sys.env.get("CONTAINER_GPG_PASSPHRASE").map(_.toArray)
//FindBugs settings
findbugsReportType := Some(FindbugsReport.PlainHtml)