Skip to content

Commit 98ccd69

Browse files
[Kaizen] Bump sbt to 1.5.4 (#1041)
* [Kaizen] Bump sbt to 1.5.4 * Fix nix build * [Kaizen] Update depsSha256 to new deps Co-authored-by: Jonathan Ringer <[email protected]>
1 parent 6b69a2a commit 98ccd69

File tree

7 files changed

+43
-44
lines changed

7 files changed

+43
-44
lines changed

build.sbt

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@ updateOptions := updateOptions.value.withGigahorse(false)
3737
// artifact name will include scala version
3838
crossPaths := true
3939

40-
val `scala-2.12` = "2.12.10"
41-
val `scala-2.13` = "2.13.4"
40+
// patch for error on 'early-semver' problems
41+
ThisBuild / evictionErrorLevel := Level.Info
42+
43+
val `scala-2.12` = "2.12.13"
44+
val `scala-2.13` = "2.13.6"
4245
val supportedScalaVersions = List(`scala-2.12`, `scala-2.13`)
4346

4447
def commonSettings(projectName: String): Seq[sbt.Def.Setting[_]] = Seq(
@@ -53,8 +56,8 @@ def commonSettings(projectName: String): Seq[sbt.Def.Setting[_]] = Seq(
5356
"com.github.vovapolu" %% "scaluzzi" % "0.1.16"
5457
),
5558
// Scalanet snapshots are published to Sonatype after each build.
56-
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
57-
testOptions in Test += Tests
59+
resolvers += "Sonatype OSS Snapshots".at("https://oss.sonatype.org/content/repositories/snapshots"),
60+
(Test / testOptions) += Tests
5861
.Argument(TestFrameworks.ScalaTest, "-l", "EthashMinerSpec"), // miner tests disabled by default,
5962
scalacOptions := Seq(
6063
"-unchecked",
@@ -67,18 +70,18 @@ def commonSettings(projectName: String): Seq[sbt.Def.Setting[_]] = Seq(
6770
"utf-8"
6871
),
6972
scalacOptions ++= (if (mantisDev) Seq.empty else compilerOptimizationsForProd),
70-
scalacOptions in (Compile, console) ~= (_.filterNot(
73+
(Compile / console / scalacOptions) ~= (_.filterNot(
7174
Set(
7275
"-Ywarn-unused-import",
7376
"-Xfatal-warnings"
7477
)
7578
)),
7679
scalacOptions ~= (options => if (mantisDev) options.filterNot(_ == "-Xfatal-warnings") else options),
7780
Test / parallelExecution := true,
78-
testOptions in Test += Tests.Argument("-oDG"),
79-
(scalastyleConfig in Test) := file("scalastyle-test-config.xml"),
81+
(Test / testOptions) += Tests.Argument("-oDG"),
82+
(Test / scalastyleConfig) := file("scalastyle-test-config.xml"),
8083
// Only publish selected libraries.
81-
skip in publish := true
84+
(publish / skip) := true
8285
)
8386

8487
val publishSettings = Seq(
@@ -88,7 +91,7 @@ val publishSettings = Seq(
8891

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

9396
lazy val bytes = {
9497
val bytes = project
@@ -143,11 +146,11 @@ lazy val rlp = {
143146
}
144147

145148
lazy val node = {
146-
val Benchmark = config("benchmark") extend Test
149+
val Benchmark = config("benchmark").extend(Test)
147150

148-
val Evm = config("evm") extend Test
151+
val Evm = config("evm").extend(Test)
149152

150-
val Rpc = config("rpcTest") extend Test
153+
val Rpc = config("rpcTest").extend(Test)
151154

152155
val malletDeps = Seq(
153156
Dependencies.scopt
@@ -183,10 +186,10 @@ lazy val node = {
183186
).flatten ++ malletDeps
184187
}
185188

186-
scalastyleSources in Test ++= { (unmanagedSourceDirectories in Integration).value }
189+
(Test / scalastyleSources) ++= (Integration / unmanagedSourceDirectories).value
187190

188-
(test in Evm) := (test in Evm).dependsOn(solidityCompile).value
189-
(sourceDirectory in Evm) := baseDirectory.value / "src" / "evmTest"
191+
(Evm / test) := (Evm / test).dependsOn(solidityCompile).value
192+
(Evm / sourceDirectory) := baseDirectory.value / "src" / "evmTest"
190193

191194
val node = project
192195
.in(file("."))
@@ -204,11 +207,11 @@ lazy val node = {
204207
gitCurrentTags,
205208
gitDescribedVersion,
206209
gitUncommittedChanges,
207-
libraryDependencies in Compile
210+
(Compile / libraryDependencies)
208211
),
209212
buildInfoPackage := "io.iohk.ethereum.utils",
210-
fork in Test := true,
211-
buildInfoOptions in Compile += BuildInfoOption.ToMap
213+
(Test / fork) := true,
214+
(Compile / buildInfoOptions) += BuildInfoOption.ToMap
212215
)
213216
.settings(commonSettings("mantis"): _*)
214217
.settings(inConfig(Integration)(scalafixConfigSettings(Integration)))
@@ -232,19 +235,19 @@ lazy val node = {
232235
.settings(
233236
// protobuf compilation
234237
// Into a subdirectory of src_managed to avoid it deleting other generated files; see https://github.com/sbt/sbt-buildinfo/issues/149
235-
PB.targets in Compile := Seq(
236-
scalapb.gen() -> (sourceManaged in Compile).value / "protobuf"
238+
(Compile / PB.targets) := Seq(
239+
scalapb.gen() -> (Compile / sourceManaged).value / "protobuf"
237240
),
238241
// have the protobuf API version file as a resource
239-
unmanagedResourceDirectories in Compile += baseDirectory.value / "src" / "main" / "protobuf",
242+
(Compile / unmanagedResourceDirectories) += baseDirectory.value / "src" / "main" / "protobuf",
240243
// Packaging
241-
mainClass in Compile := Some("io.iohk.ethereum.App"),
242-
discoveredMainClasses in Compile := Seq(),
244+
(Compile / mainClass) := Some("io.iohk.ethereum.App"),
245+
(Compile / discoveredMainClasses) := Seq(),
243246
// Requires the 'ant-javafx.jar' that comes with Oracle JDK
244247
// Enables creating an executable with the configuration files, has to be run on the OS corresponding to the desired version
245248
ThisBuild / jdkPackagerType := "image",
246-
mappings in Universal ++= directory((resourceDirectory in Compile).value / "conf"),
247-
mappings in Universal += (resourceDirectory in Compile).value / "logback.xml" -> "conf/logback.xml",
249+
(Universal / mappings) ++= directory((Compile / resourceDirectory).value / "conf"),
250+
(Universal / mappings) += (Compile / resourceDirectory).value / "logback.xml" -> "conf/logback.xml",
248251
bashScriptExtraDefines += """addJava "-Dconfig.file=${app_home}/../conf/app.conf"""",
249252
bashScriptExtraDefines += """addJava "-Dlogback.configurationFile=${app_home}/../conf/logback.xml"""",
250253
batScriptExtraDefines += """call :add_java "-Dconfig.file=%APP_HOME%\conf\app.conf"""",
@@ -258,7 +261,7 @@ lazy val node = {
258261
node
259262
else
260263
//node.settings(PB.protocExecutable := file("protoc"))
261-
node.settings(PB.runProtoc in Compile := (args => Process("protoc", args) !))
264+
node.settings((Compile / PB.runProtoc) := (args => Process("protoc", args) !))
262265

263266
}
264267

@@ -345,7 +348,5 @@ addCommandAlias(
345348
|""".stripMargin
346349
)
347350

348-
// Scala 2.12 only has up to 1.4.5, while 2.13 only from 1.4.7
349-
// In theory we should be able to switch on `scalaVersion.value` but it doesn't seem to work.
350-
scapegoatVersion in ThisBuild := (sys.env.getOrElse("SCAPEGOAT_VERSION", "1.4.7"))
351+
(ThisBuild / scapegoatVersion) := "1.4.9"
351352
scapegoatReports := Seq("xml")

nix/mantis.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ let
2020
version =
2121
let
2222
versionSbt = builtins.readFile ../version.sbt;
23-
captures = builtins.match ''.*version in ThisBuild := "([^"]+)".*'' versionSbt;
23+
captures = builtins.match ''.* := "([^"]+)".*'' versionSbt;
2424
in
2525
builtins.elemAt captures 0;
2626

nix/overlay.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ rev: final: prev: {
33

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

99
mantis-hash = final.mantis.override {

nix/protoc.patch

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

project/Dependencies.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ object Dependencies {
44

55
private val akkaVersion = "2.6.9"
66

7-
val akkaUtil: Seq[ModuleID] = {
7+
val akkaUtil: Seq[ModuleID] =
88
Seq(
99
"com.typesafe.akka" %% "akka-actor" % akkaVersion
1010
)
11-
}
1211

13-
val akka: Seq[ModuleID] = {
12+
val akka: Seq[ModuleID] =
1413
Seq(
1514
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
1615
"com.typesafe.akka" %% "akka-actor-typed" % akkaVersion,
@@ -21,7 +20,6 @@ object Dependencies {
2120
"com.typesafe.akka" %% "akka-stream" % akkaVersion,
2221
"com.miguno.akka" %% "akka-mock-scheduler" % "0.5.5" % "it,test"
2322
)
24-
}
2523

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

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version = 1.4.6
1+
sbt.version = 1.5.4

version.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
// based on `git` tags by https://github.com/dwijnand/sbt-dynver,
44
// which is a dependency of `sbt-ci-release`.
55

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

0 commit comments

Comments
 (0)