Skip to content

[CHORE] Refactor dependencies, update scalacheck #676

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Sep 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version = "2.3.0"
version = "2.7.1"
align = none
maxColumn = 120
94 changes: 33 additions & 61 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,58 +13,34 @@ val commonSettings = Seq(
.Argument(TestFrameworks.ScalaTest, "-l", "EthashMinerSpec") // miner tests disabled by default
)

val dep = {
val akkaVersion = "2.6.9"
val akkaHttpVersion = "10.2.0"
val circeVersion = "0.9.3"
val rocksDb = "6.11.4"
val malletDeps = Seq(
Dependencies.scopt
).flatten ++ Seq(
"org.jline" % "jline" % "3.1.2",
"net.java.dev.jna" % "jna" % "4.5.1"
)

val dep = {
Seq(
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
"com.typesafe.akka" %% "akka-slf4j" % akkaVersion,
"com.typesafe.akka" %% "akka-testkit" % akkaVersion,
"com.typesafe.akka" %% "akka-stream" % akkaVersion,
"com.typesafe.akka" %% "akka-http" % akkaHttpVersion,
"ch.megard" %% "akka-http-cors" % "1.1.0",
"org.json4s" %% "json4s-native" % "3.5.4",
"de.heikoseeberger" %% "akka-http-json4s" % "1.34.0",
"io.suzaku" %% "boopickle" % "1.3.0",
"org.rocksdb" % "rocksdbjni" % rocksDb,
"io.circe" %% "circe-core" % circeVersion,
"io.circe" %% "circe-generic" % circeVersion,
"io.circe" %% "circe-parser" % circeVersion,
"io.circe" %% "circe-generic-extras" % circeVersion,
"commons-io" % "commons-io" % "2.6",
"org.scala-sbt.ipcsocket" % "ipcsocket" % "1.0.0",
"org.bouncycastle" % "bcprov-jdk15on" % "1.59",
"org.typelevel" %% "mouse" % "0.23",
"org.typelevel" %% "cats-core" % "2.0.0",
"org.typelevel" %% "cats-effect" % "2.0.0",
"com.twitter" %% "util-collection" % "18.5.0",
"com.google.guava" % "guava" % "28.0-jre",
"io.monix" %% "monix" % "3.1.0",
"com.beachape" %% "enumeratum" % "1.5.13",
"com.beachape" %% "enumeratum-cats" % "1.5.15",
"com.beachape" %% "enumeratum-scalacheck" % "1.5.16" % Test,
// mallet deps
"org.jline" % "jline" % "3.1.2",
"net.java.dev.jna" % "jna" % "4.5.1",
"org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.0",
"com.github.scopt" %% "scopt" % "3.7.0",
"org.xerial.snappy" % "snappy-java" % "1.1.7.2",
// Logging
"ch.qos.logback" % "logback-classic" % "1.2.3",
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.0",
"net.logstash.logback" % "logstash-logback-encoder" % "6.4",
"org.codehaus.janino" % "janino" % "3.0.6",
// Test utils
"org.web3j" % "core" % "3.4.0" % "test",
"org.scalatest" %% "scalatest" % "3.0.5" % "it,test",
"com.miguno.akka" %% "akka-mock-scheduler" % "0.5.5" % "it,test",
"com.typesafe.akka" %% "akka-http-testkit" % akkaHttpVersion % "it,test",
"org.scalamock" %% "scalamock-scalatest-support" % "3.6.0" % "test",
"org.scalacheck" %% "scalacheck" % "1.14.0" % "it,test"
)
Dependencies.akka,
Dependencies.akkaHttp,
Dependencies.json4s,
Dependencies.circe,
Dependencies.boopickle,
Dependencies.rocksDb,
Dependencies.enumeratum,
Dependencies.testing,
Dependencies.cats,
Dependencies.monix,
Dependencies.twitterUtilCollection,
Dependencies.crypto,
Dependencies.scopt,
Dependencies.logging,
Dependencies.apacheCommons,
Dependencies.micrometer,
Dependencies.prometheus,
Dependencies.dependencies
).flatten ++ malletDeps
}

val Integration = config("it") extend Test
Expand All @@ -85,19 +61,15 @@ val root = {
.configs(Integration, Benchmark, Evm, Ets, Snappy, Rpc)
.settings(commonSettings: _*)
.settings(
libraryDependencies ++= Seq(
dep,
Dependencies.micrometer,
Dependencies.prometheus
).flatten
libraryDependencies ++= dep
)
.settings(executableScriptName := name.value)
.settings(inConfig(Integration)(Defaults.testSettings) : _*)
.settings(inConfig(Benchmark)(Defaults.testSettings) : _*)
.settings(inConfig(Evm)(Defaults.testSettings) : _*)
.settings(inConfig(Ets)(Defaults.testSettings) : _*)
.settings(inConfig(Snappy)(Defaults.testSettings) : _*)
.settings(inConfig(Rpc)(Defaults.testSettings) : _*)
.settings(inConfig(Integration)(Defaults.testSettings): _*)
.settings(inConfig(Benchmark)(Defaults.testSettings): _*)
.settings(inConfig(Evm)(Defaults.testSettings): _*)
.settings(inConfig(Ets)(Defaults.testSettings): _*)
.settings(inConfig(Snappy)(Defaults.testSettings): _*)
.settings(inConfig(Rpc)(Defaults.testSettings): _*)

if (!nixBuild)
root
Expand Down
93 changes: 93 additions & 0 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,99 @@ import sbt._

object Dependencies {

val akka: Seq[ModuleID] = {
val akkaVersion = "2.6.9"

Seq(
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
"com.typesafe.akka" %% "akka-slf4j" % akkaVersion,
"com.typesafe.akka" %% "akka-testkit" % akkaVersion,
"com.typesafe.akka" %% "akka-stream" % akkaVersion,
"com.miguno.akka" %% "akka-mock-scheduler" % "0.5.5" % "it,test"
)
}

val akkaHttp: Seq[ModuleID] = {
val akkaHttpVersion = "10.2.0"

Seq(
"com.typesafe.akka" %% "akka-http" % akkaHttpVersion,
"ch.megard" %% "akka-http-cors" % "1.1.0",
"de.heikoseeberger" %% "akka-http-json4s" % "1.34.0",
"com.typesafe.akka" %% "akka-http-testkit" % akkaHttpVersion % "it,test"
)
}

val json4s = Seq("org.json4s" %% "json4s-native" % "3.5.4")

val circe: Seq[ModuleID] = {
val circeVersion = "0.12.1" //0.9.3

Seq(
"io.circe" %% "circe-core" % circeVersion,
"io.circe" %% "circe-generic" % circeVersion,
"io.circe" %% "circe-parser" % circeVersion,
"io.circe" %% "circe-generic-extras" % circeVersion
)
}

val boopickle = Seq("io.suzaku" %% "boopickle" % "1.3.0")

val rocksDb = Seq(
"org.rocksdb" % "rocksdbjni" % "6.11.4"
)

val enumeratum: Seq[ModuleID] = Seq(
"com.beachape" %% "enumeratum" % "1.5.13",
"com.beachape" %% "enumeratum-cats" % "1.5.15",
"com.beachape" %% "enumeratum-scalacheck" % "1.5.16" % Test
)

val testing: Seq[ModuleID] = Seq(
"org.scalatest" %% "scalatest" % "3.0.8" % "it,test",
"org.scalamock" %% "scalamock-scalatest-support" % "3.6.0" % "test",
"org.scalacheck" %% "scalacheck" % "1.14.1" % "it,test"
)

val cats: Seq[ModuleID] = {
val catsVersion = "2.0.0"
Seq(
"org.typelevel" %% "mouse" % "0.23",
"org.typelevel" %% "cats-core" % catsVersion,
"org.typelevel" %% "cats-effect" % catsVersion
)
}

val monix = Seq(
"io.monix" %% "monix" % "3.1.0"
)

val logging = Seq(
"ch.qos.logback" % "logback-classic" % "1.2.3",
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.0",
"net.logstash.logback" % "logstash-logback-encoder" % "6.4",
"org.codehaus.janino" % "janino" % "3.0.6"
)

val twitterUtilCollection = Seq("com.twitter" %% "util-collection" % "18.5.0")

val crypto = Seq("org.bouncycastle" % "bcprov-jdk15on" % "1.59")

val scopt = Seq("com.github.scopt" % "scopt_2.12" % "3.7.0")

val apacheCommons = Seq(
"commons-io" % "commons-io" % "2.6"
)

val dependencies = Seq(
"org.jline" % "jline" % "3.1.2",
"org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.0",
"org.scala-sbt.ipcsocket" % "ipcsocket" % "1.0.0",
"com.google.guava" % "guava" % "28.0-jre",
"org.xerial.snappy" % "snappy-java" % "1.1.7.2",
"org.web3j" % "core" % "3.4.0" % "test"
)

val prometheus: Seq[ModuleID] = {
val provider = "io.prometheus"
val version = "0.8.0"
Expand Down
Loading