Skip to content
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
59 changes: 30 additions & 29 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ updateOptions := updateOptions.value.withGigahorse(false)
// artifact name will include scala version
crossPaths := true

val `scala-2.12` = "2.12.10"
val `scala-2.13` = "2.13.4"
// patch for error on 'early-semver' problems
ThisBuild / evictionErrorLevel := Level.Info

val `scala-2.12` = "2.12.13"
val `scala-2.13` = "2.13.6"
val supportedScalaVersions = List(`scala-2.12`, `scala-2.13`)

def commonSettings(projectName: String): Seq[sbt.Def.Setting[_]] = Seq(
Expand All @@ -53,8 +56,8 @@ def commonSettings(projectName: String): Seq[sbt.Def.Setting[_]] = Seq(
"com.github.vovapolu" %% "scaluzzi" % "0.1.16"
),
// Scalanet snapshots are published to Sonatype after each build.
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
testOptions in Test += Tests
resolvers += "Sonatype OSS Snapshots".at("https://oss.sonatype.org/content/repositories/snapshots"),
(Test / testOptions) += Tests
.Argument(TestFrameworks.ScalaTest, "-l", "EthashMinerSpec"), // miner tests disabled by default,
scalacOptions := Seq(
"-unchecked",
Expand All @@ -67,18 +70,18 @@ def commonSettings(projectName: String): Seq[sbt.Def.Setting[_]] = Seq(
"utf-8"
),
scalacOptions ++= (if (mantisDev) Seq.empty else compilerOptimizationsForProd),
scalacOptions in (Compile, console) ~= (_.filterNot(
(Compile / console / scalacOptions) ~= (_.filterNot(
Set(
"-Ywarn-unused-import",
"-Xfatal-warnings"
)
)),
scalacOptions ~= (options => if (mantisDev) options.filterNot(_ == "-Xfatal-warnings") else options),
Test / parallelExecution := true,
testOptions in Test += Tests.Argument("-oDG"),
(scalastyleConfig in Test) := file("scalastyle-test-config.xml"),
(Test / testOptions) += Tests.Argument("-oDG"),
(Test / scalastyleConfig) := file("scalastyle-test-config.xml"),
// Only publish selected libraries.
skip in publish := true
(publish / skip) := true
)

val publishSettings = Seq(
Expand All @@ -88,7 +91,7 @@ val publishSettings = Seq(

// Adding an "it" config because in `Dependencies.scala` some are declared with `% "it,test"`
// which would fail if the project didn't have configuration to add to.
val Integration = config("it") extend Test
val Integration = config("it").extend(Test)

lazy val bytes = {
val bytes = project
Expand Down Expand Up @@ -143,11 +146,11 @@ lazy val rlp = {
}

lazy val node = {
val Benchmark = config("benchmark") extend Test
val Benchmark = config("benchmark").extend(Test)

val Evm = config("evm") extend Test
val Evm = config("evm").extend(Test)

val Rpc = config("rpcTest") extend Test
val Rpc = config("rpcTest").extend(Test)

val malletDeps = Seq(
Dependencies.scopt
Expand Down Expand Up @@ -183,10 +186,10 @@ lazy val node = {
).flatten ++ malletDeps
}

scalastyleSources in Test ++= { (unmanagedSourceDirectories in Integration).value }
(Test / scalastyleSources) ++= (Integration / unmanagedSourceDirectories).value

(test in Evm) := (test in Evm).dependsOn(solidityCompile).value
(sourceDirectory in Evm) := baseDirectory.value / "src" / "evmTest"
(Evm / test) := (Evm / test).dependsOn(solidityCompile).value
(Evm / sourceDirectory) := baseDirectory.value / "src" / "evmTest"

val node = project
.in(file("."))
Expand All @@ -204,11 +207,11 @@ lazy val node = {
gitCurrentTags,
gitDescribedVersion,
gitUncommittedChanges,
libraryDependencies in Compile
(Compile / libraryDependencies)
),
buildInfoPackage := "io.iohk.ethereum.utils",
fork in Test := true,
buildInfoOptions in Compile += BuildInfoOption.ToMap
(Test / fork) := true,
(Compile / buildInfoOptions) += BuildInfoOption.ToMap
)
.settings(commonSettings("mantis"): _*)
.settings(inConfig(Integration)(scalafixConfigSettings(Integration)))
Expand All @@ -232,19 +235,19 @@ lazy val node = {
.settings(
// protobuf compilation
// Into a subdirectory of src_managed to avoid it deleting other generated files; see https://github.com/sbt/sbt-buildinfo/issues/149
PB.targets in Compile := Seq(
scalapb.gen() -> (sourceManaged in Compile).value / "protobuf"
(Compile / PB.targets) := Seq(
scalapb.gen() -> (Compile / sourceManaged).value / "protobuf"
),
// have the protobuf API version file as a resource
unmanagedResourceDirectories in Compile += baseDirectory.value / "src" / "main" / "protobuf",
(Compile / unmanagedResourceDirectories) += baseDirectory.value / "src" / "main" / "protobuf",
// Packaging
mainClass in Compile := Some("io.iohk.ethereum.App"),
discoveredMainClasses in Compile := Seq(),
(Compile / mainClass) := Some("io.iohk.ethereum.App"),
(Compile / discoveredMainClasses) := Seq(),
// Requires the 'ant-javafx.jar' that comes with Oracle JDK
// Enables creating an executable with the configuration files, has to be run on the OS corresponding to the desired version
ThisBuild / jdkPackagerType := "image",
mappings in Universal ++= directory((resourceDirectory in Compile).value / "conf"),
mappings in Universal += (resourceDirectory in Compile).value / "logback.xml" -> "conf/logback.xml",
(Universal / mappings) ++= directory((Compile / resourceDirectory).value / "conf"),
(Universal / mappings) += (Compile / resourceDirectory).value / "logback.xml" -> "conf/logback.xml",
bashScriptExtraDefines += """addJava "-Dconfig.file=${app_home}/../conf/app.conf"""",
bashScriptExtraDefines += """addJava "-Dlogback.configurationFile=${app_home}/../conf/logback.xml"""",
batScriptExtraDefines += """call :add_java "-Dconfig.file=%APP_HOME%\conf\app.conf"""",
Expand All @@ -258,7 +261,7 @@ lazy val node = {
node
else
//node.settings(PB.protocExecutable := file("protoc"))
node.settings(PB.runProtoc in Compile := (args => Process("protoc", args) !))
node.settings((Compile / PB.runProtoc) := (args => Process("protoc", args) !))

}

Expand Down Expand Up @@ -345,7 +348,5 @@ addCommandAlias(
|""".stripMargin
)

// Scala 2.12 only has up to 1.4.5, while 2.13 only from 1.4.7
// In theory we should be able to switch on `scalaVersion.value` but it doesn't seem to work.
scapegoatVersion in ThisBuild := (sys.env.getOrElse("SCAPEGOAT_VERSION", "1.4.7"))
(ThisBuild / scapegoatVersion) := "1.4.9"
scapegoatReports := Seq("xml")
2 changes: 1 addition & 1 deletion nix/mantis.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let
version =
let
versionSbt = builtins.readFile ../version.sbt;
captures = builtins.match ''.*version in ThisBuild := "([^"]+)".*'' versionSbt;
captures = builtins.match ''.* := "([^"]+)".*'' versionSbt;
in
builtins.elemAt captures 0;

Expand Down
2 changes: 1 addition & 1 deletion nix/overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ rev: final: prev: {

mantis = final.callPackage ./mantis.nix {
src = ../.;
depsSha256 = "sha256-9XlUBMUe1jQyqguhQgk5DAZ9UtcG6JyCWaBZsIbzBDY=";
depsSha256 = "sha256-4DTSCv7491nG4+jF2VptULubFkVTW0IXRpGqNzuXU90=";
};

mantis-hash = final.mantis.override {
Expand Down
14 changes: 7 additions & 7 deletions nix/protoc.patch
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
diff --git a/build.sbt b/build.sbt
index 4ac21ff40..ccd34412e 100644
index 59551123e..88eb70276 100644
--- a/build.sbt
+++ b/build.sbt
@@ -43,6 +43,7 @@ def commonSettings(projectName: String): Seq[sbt.Def.Setting[_]] = Seq(
@@ -50,6 +50,7 @@ def commonSettings(projectName: String): Seq[sbt.Def.Setting[_]] = Seq(
scalaVersion := `scala-2.13`,
// Scalanet snapshots are published to Sonatype after each build.
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
semanticdbEnabled := true, // enable SemanticDB
semanticdbVersion := scalafixSemanticdb.revision, // use Scalafix compatible version
+ PB.runProtoc in Compile := (args => Process("@protobuf@/bin/protoc", args)!),
testOptions in Test += Tests
.Argument(TestFrameworks.ScalaTest, "-l", "EthashMinerSpec"), // miner tests disabled by default,
scalacOptions := Seq(
ThisBuild / scalafixScalaBinaryVersion := CrossVersion.binaryScalaVersion(scalaVersion.value),
ThisBuild / scalafixDependencies ++= List(
"com.github.liancheng" %% "organize-imports" % "0.5.0",
6 changes: 2 additions & 4 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ object Dependencies {

private val akkaVersion = "2.6.9"

val akkaUtil: Seq[ModuleID] = {
val akkaUtil: Seq[ModuleID] =
Seq(
"com.typesafe.akka" %% "akka-actor" % akkaVersion
)
}

val akka: Seq[ModuleID] = {
val akka: Seq[ModuleID] =
Seq(
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
"com.typesafe.akka" %% "akka-actor-typed" % akkaVersion,
Expand All @@ -21,7 +20,6 @@ object Dependencies {
"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"
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 1.4.6
sbt.version = 1.5.4
2 changes: 1 addition & 1 deletion version.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
// based on `git` tags by https://github.com/dwijnand/sbt-dynver,
// which is a dependency of `sbt-ci-release`.

version in ThisBuild := "3.2.4-SNAPSHOT"
(ThisBuild / version) := "3.2.4-SNAPSHOT"