forked from rchain/rchain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
239 lines (223 loc) · 7.75 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
import Dependencies._
import BNFC._
lazy val projectSettings = Seq(
organization := "coop.rchain",
scalaVersion := "2.12.4",
version := "0.1.0-SNAPSHOT",
resolvers += Resolver.sonatypeRepo("releases"),
scalafmtOnCompile := true
)
lazy val coverageSettings = Seq(
coverageMinimum := 90,
coverageFailOnMinimum := false,
coverageExcludedFiles := Seq(
(javaSource in Compile).value,
(sourceManaged in Compile).value.getPath ++ "/.*"
).mkString(";")
)
lazy val compilerSettings = CompilerSettings.options ++ Seq(
crossScalaVersions := Seq("2.11.12", scalaVersion.value)
)
lazy val commonSettings = projectSettings ++ coverageSettings ++ compilerSettings
lazy val comm = (project in file("comm"))
.settings(commonSettings: _*)
.settings(
version := "0.1",
libraryDependencies ++= commonDependencies ++ kamonDependencies ++ protobufDependencies ++ Seq(
scalaUri,
weupnp,
hasher,
catsCore,
monix,
guava
),
PB.targets in Compile := Seq(
PB.gens.java -> (sourceManaged in Compile).value,
scalapb.gen(javaConversions = true) -> (sourceManaged in Compile).value
)
)
lazy val crypto = (project in file("crypto"))
.settings(commonSettings: _*)
.settings(
name := "crypto",
libraryDependencies ++= commonDependencies ++ protobufDependencies ++ Seq(
guava,
bouncyCastle,
kalium,
jaxb
),
fork := true,
unmanagedSourceDirectories in Compile += baseDirectory.value / "secp256k1/src/java",
javaOptions += "-Djava.library.path=secp256k1/.libs",
doctestTestFramework := DoctestTestFramework.ScalaTest
)
lazy val models = (project in file("models"))
.settings(commonSettings: _*)
.settings(
libraryDependencies ++= commonDependencies ++ protobufDependencies ++ Seq(
catsCore,
scalacheck,
scalacheckShapeless
),
PB.targets in Compile := Seq(
scalapb.gen(flatPackage = true) -> (sourceManaged in Compile).value
)
)
.dependsOn(rspace)
lazy val node = (project in file("node"))
.settings(commonSettings: _*)
.enablePlugins(sbtdocker.DockerPlugin, RpmPlugin, DebianPlugin, JavaAppPackaging, BuildInfoPlugin)
.settings(
version := "0.2.1",
name := "rnode",
libraryDependencies ++=
apiServerDependencies ++ commonDependencies ++ kamonDependencies ++ protobufDependencies ++ Seq(
catsCore,
scallop,
scalaUri
),
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion),
buildInfoPackage := "coop.rchain.node",
mainClass in assembly := Some("coop.rchain.node.Main"),
/* Dockerization */
dockerfile in docker := {
val artifact: File = assembly.value
val artifactTargetPath = s"/${artifact.name}"
val entry: File = baseDirectory(_ / "main.sh").value
val entryTargetPath = "/bin"
new Dockerfile {
from("openjdk:8u151-jre-alpine")
add(artifact, artifactTargetPath)
env("RCHAIN_TARGET_JAR", artifactTargetPath)
add(entry, entryTargetPath)
run("apk", "update")
run("apk", "add", "libsodium")
entryPoint("/bin/main.sh")
}
},
/* Packaging */
maintainer in Linux := "Pyrofex, Inc. <[email protected]>",
packageSummary in Linux := "RChain Node",
packageDescription in Linux := "RChain Node - the RChain blockchain node server software.",
/* Debian */
debianPackageDependencies in Debian ++= Seq("openjdk-8-jre-headless", "bash (>= 2.05a-11)", "libsodium18 (>= 1.0.8-5)"),
/* Redhat */
rpmVendor := "rchain.coop",
rpmUrl := Some("https://rchain.coop"),
rpmLicense := Some("Apache 2.0"),
rpmPrerequisites := Seq("libsodium >= 1.0.14-1")
)
.dependsOn(comm, crypto, rholang)
lazy val regex = (project in file("regex"))
.settings(commonSettings: _*)
.settings(libraryDependencies ++= commonDependencies)
lazy val rholang = (project in file("rholang"))
.settings(commonSettings: _*)
.settings(bnfcSettings: _*)
.settings(
scalacOptions ++= Seq(
"-language:existentials",
"-language:higherKinds",
"-Yno-adapted-args"
),
libraryDependencies ++= commonDependencies ++ Seq(monix, scallop),
mainClass in assembly := Some("coop.rchain.rho2rose.Rholang2RosetteCompiler"),
coverageExcludedFiles := Seq(
(javaSource in Compile).value,
(bnfcGrammarDir in BNFCConfig).value,
(bnfcOutputDir in BNFCConfig).value,
baseDirectory.value / "src" / "main" / "k",
baseDirectory.value / "src" / "main" / "rbl"
).map(_.getPath ++ "/.*").mkString(";"),
fork in Test := true
)
.dependsOn(models, rspace)
lazy val rholangCLI = (project in file("rholang-cli"))
.settings(commonSettings: _*)
.settings(
mainClass in assembly := Some("coop.rchain.rholang.interpreter.RholangCLI")
)
.dependsOn(rholang)
lazy val roscala_macros = (project in file("roscala/macros"))
.settings(commonSettings: _*)
.settings(
libraryDependencies ++= commonDependencies ++ Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value
)
)
lazy val roscala = (project in file("roscala"))
.settings(commonSettings: _*)
.settings(
name := "Rosette",
mainClass in assembly := Some("coop.rchain.rosette.Main"),
assemblyJarName in assembly := "rosette.jar",
inThisBuild(
List(addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full))),
libraryDependencies ++= commonDependencies ++ Seq(catsCore, shapeless, scalacheck)
)
.dependsOn(roscala_macros)
lazy val rspace = (project in file("rspace"))
.enablePlugins(SiteScaladocPlugin, GhpagesPlugin, TutPlugin)
.settings(commonSettings: _*)
.settings(
name := "rspace",
version := "0.1.1",
libraryDependencies ++= commonDependencies ++ protobufDependencies ++ Seq(
lmdbjava,
catsCore
),
PB.targets in Compile := Seq(
scalapb.gen(flatPackage = true) -> (sourceManaged in Compile).value
),
/* Tutorial */
tutTargetDirectory := (baseDirectory in Compile).value / "docs",
/* Publishing Settings */
scmInfo := Some(ScmInfo(url("https://github.com/rchain/rchain"), "[email protected]:rchain/rchain.git")),
git.remoteRepo := scmInfo.value.get.connection,
useGpg := true,
pomIncludeRepository := { _ => false },
publishMavenStyle := true,
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
publishArtifact in Test := false,
licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0")),
homepage := Some(url("https://www.rchain.coop")),
developers := List(
Developer(
id = "guardbotmk3",
name = "Kyle Butt",
email = "[email protected]",
url = url("https://www.pyrofex.net")
),
Developer(
id = "ys-pyrofex",
name = "Yaraslau Levashkevich",
email = "[email protected]",
url = url("https://www.pyrofex.net")
),
Developer(
id = "KentShikama",
name = "Kent Shikama",
email = "[email protected]",
url = url("https://www.rchain.coop")
),
Developer(
id = "henrytill",
name = "Henry Till",
email = "[email protected]",
url = url("https://www.pyrofex.net")
)
)
)
lazy val rspaceBench = (project in file("rspace-bench"))
.settings(commonSettings, libraryDependencies ++= commonDependencies)
.enablePlugins(JmhPlugin)
.dependsOn(rspace)
lazy val rchain = (project in file("."))
.settings(commonSettings: _*)
.aggregate(crypto, comm, models, regex, rspace, node, rholang, rholangCLI, roscala)