mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-01-18 13:24:25 +01:00
Fix build warnings that came with sbt 1.5.0 (#2857)
* Fix build warnings that came with sbt 1.5.0 * Fix more deprecation warnings * Fix more warnings
This commit is contained in:
parent
a2628cacd1
commit
c738f23e58
@ -9,4 +9,4 @@ enablePlugins(JavaAppPackaging)
|
|||||||
publish / skip := true
|
publish / skip := true
|
||||||
|
|
||||||
// Fork a new JVM for 'run' and 'test:run' to avoid JavaFX double initialization problems
|
// Fork a new JVM for 'run' and 'test:run' to avoid JavaFX double initialization problems
|
||||||
fork in run := true
|
fork / run := true
|
||||||
|
@ -37,4 +37,4 @@ Test / bloopGenerate := None
|
|||||||
Compile / bloopGenerate := None
|
Compile / bloopGenerate := None
|
||||||
|
|
||||||
//https://stackoverflow.com/questions/26940253/in-sbt-how-do-you-override-scalacoptions-for-console-in-all-configurations
|
//https://stackoverflow.com/questions/26940253/in-sbt-how-do-you-override-scalacoptions-for-console-in-all-configurations
|
||||||
scalacOptions in Compile ~= (_.filterNot(s => s == "-Xfatal-warnings"))
|
Compile / scalacOptions ~= (_.filterNot(s => s == "-Xfatal-warnings"))
|
||||||
|
30
build.sbt
30
build.sbt
@ -2,7 +2,7 @@ import com.typesafe.sbt.SbtGit.GitKeys._
|
|||||||
|
|
||||||
import scala.util.Properties
|
import scala.util.Properties
|
||||||
|
|
||||||
cancelable in Global := true
|
Global / cancelable := true
|
||||||
|
|
||||||
//don't allow us to wipe all of our prod databases
|
//don't allow us to wipe all of our prod databases
|
||||||
flywayClean / aggregate := false
|
flywayClean / aggregate := false
|
||||||
@ -19,12 +19,12 @@ lazy val benchSettings: Seq[Def.SettingsDefinition] = {
|
|||||||
// .settings(benchSettings: _*)
|
// .settings(benchSettings: _*)
|
||||||
// .configs(Benchmark)
|
// .configs(Benchmark)
|
||||||
List(
|
List(
|
||||||
unmanagedSourceDirectories in Test += baseDirectory.value / "src" / "bench" / "scala",
|
Test / unmanagedSourceDirectories += baseDirectory.value / "src" / "bench" / "scala",
|
||||||
testFrameworks += new TestFramework("org.scalameter.ScalaMeterFramework"),
|
testFrameworks += new TestFramework("org.scalameter.ScalaMeterFramework"),
|
||||||
parallelExecution in Benchmark := false,
|
Benchmark / parallelExecution := false,
|
||||||
outputStrategy in Benchmark := Some(StdoutOutput),
|
Benchmark / outputStrategy := Some(StdoutOutput),
|
||||||
fork in Benchmark := true,
|
Benchmark / fork := true,
|
||||||
connectInput in Benchmark := true,
|
Benchmark / connectInput := true,
|
||||||
inConfig(Benchmark)(Defaults.testSettings)
|
inConfig(Benchmark)(Defaults.testSettings)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -48,7 +48,7 @@ lazy val crypto = crossProject(JVMPlatform, JSPlatform)
|
|||||||
libraryDependencies ++= Deps.cryptoJVM
|
libraryDependencies ++= Deps.cryptoJVM
|
||||||
)
|
)
|
||||||
.jsSettings(
|
.jsSettings(
|
||||||
npmDependencies in Compile ++= Seq(
|
Compile / npmDependencies ++= Seq(
|
||||||
"bcrypto" -> "5.4.0"
|
"bcrypto" -> "5.4.0"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -57,7 +57,7 @@ lazy val crypto = crossProject(JVMPlatform, JSPlatform)
|
|||||||
.in(file("crypto"))
|
.in(file("crypto"))
|
||||||
|
|
||||||
lazy val cryptoJS = crypto.js
|
lazy val cryptoJS = crypto.js
|
||||||
.settings(scalacOptions in Compile += {
|
.settings(Compile / scalacOptions += {
|
||||||
//Added to supress all of the dead code and unused variable warnings
|
//Added to supress all of the dead code and unused variable warnings
|
||||||
//inside of org.bitcoins.crypto.facade which is used with scalajs
|
//inside of org.bitcoins.crypto.facade which is used with scalajs
|
||||||
//see: https://www.scala-lang.org/2021/01/12/configuring-and-suppressing-warnings.html
|
//see: https://www.scala-lang.org/2021/01/12/configuring-and-suppressing-warnings.html
|
||||||
@ -272,7 +272,7 @@ lazy val secp256k1jni = project
|
|||||||
.settings(
|
.settings(
|
||||||
libraryDependencies ++= Deps.secp256k1jni,
|
libraryDependencies ++= Deps.secp256k1jni,
|
||||||
// we place lib files in this directory
|
// we place lib files in this directory
|
||||||
unmanagedResourceDirectories in Compile += baseDirectory.value / "natives",
|
Compile / unmanagedResourceDirectories += baseDirectory.value / "natives",
|
||||||
//since this is not a scala module, we have no code coverage
|
//since this is not a scala module, we have no code coverage
|
||||||
//this also doesn't place nice with scoverage, see
|
//this also doesn't place nice with scoverage, see
|
||||||
//https://github.com/scoverage/sbt-scoverage/issues/275
|
//https://github.com/scoverage/sbt-scoverage/issues/275
|
||||||
@ -500,7 +500,7 @@ lazy val bench = project
|
|||||||
.settings(
|
.settings(
|
||||||
libraryDependencies ++= Deps.bench,
|
libraryDependencies ++= Deps.bench,
|
||||||
name := "bitcoin-s-bench",
|
name := "bitcoin-s-bench",
|
||||||
skip in publish := true
|
publish / skip := true
|
||||||
)
|
)
|
||||||
.dependsOn(coreJVM % testAndCompile, testkit)
|
.dependsOn(coreJVM % testAndCompile, testkit)
|
||||||
|
|
||||||
@ -598,16 +598,16 @@ lazy val docs = project
|
|||||||
moduleName := name.value,
|
moduleName := name.value,
|
||||||
//removes scalajs projects from unidoc, see
|
//removes scalajs projects from unidoc, see
|
||||||
//https://github.com/bitcoin-s/bitcoin-s/issues/2740
|
//https://github.com/bitcoin-s/bitcoin-s/issues/2740
|
||||||
unidocProjectFilter in (ScalaUnidoc, unidoc) := {
|
ScalaUnidoc / unidoc / unidocProjectFilter := {
|
||||||
inAnyProject -- inProjects(jsProjects: _*)
|
inAnyProject -- inProjects(jsProjects: _*)
|
||||||
},
|
},
|
||||||
target in (ScalaUnidoc, unidoc) := (baseDirectory in LocalRootProject).value / "website" / "static" / "api",
|
ScalaUnidoc / unidoc / target := (LocalRootProject / baseDirectory).value / "website" / "static" / "api",
|
||||||
cleanFiles += (target in (ScalaUnidoc, unidoc)).value,
|
cleanFiles += (ScalaUnidoc / unidoc / target).value,
|
||||||
docusaurusCreateSite := docusaurusCreateSite
|
docusaurusCreateSite := docusaurusCreateSite
|
||||||
.dependsOn(unidoc in Compile)
|
.dependsOn(Compile / unidoc)
|
||||||
.value,
|
.value,
|
||||||
docusaurusPublishGhpages := docusaurusPublishGhpages
|
docusaurusPublishGhpages := docusaurusPublishGhpages
|
||||||
.dependsOn(unidoc in Compile)
|
.dependsOn(Compile / unidoc)
|
||||||
.value
|
.value
|
||||||
)
|
)
|
||||||
.enablePlugins(MdocPlugin,
|
.enablePlugins(MdocPlugin,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
publishArtifact := false
|
publishArtifact := false
|
||||||
|
|
||||||
testOptions in Test += Tests.Argument(TestFrameworks.ScalaCheck,
|
Test / testOptions += Tests.Argument(TestFrameworks.ScalaCheck,
|
||||||
"-verbosity",
|
"-verbosity",
|
||||||
"2")
|
"2")
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
publishArtifact := false
|
publishArtifact := false
|
||||||
|
|
||||||
testOptions in Test += Tests.Argument(TestFrameworks.ScalaCheck,
|
Test / testOptions += Tests.Argument(TestFrameworks.ScalaCheck,
|
||||||
"-verbosity",
|
"-verbosity",
|
||||||
"2")
|
"2")
|
||||||
|
|
||||||
|
@ -5,15 +5,15 @@ import scala.util.Properties
|
|||||||
val scala2_12 = "2.12.12"
|
val scala2_12 = "2.12.12"
|
||||||
val scala2_13 = "2.13.5"
|
val scala2_13 = "2.13.5"
|
||||||
|
|
||||||
scalafmtOnCompile in ThisBuild := !Properties.envOrNone("CI").contains("true")
|
ThisBuild / scalafmtOnCompile := !Properties.envOrNone("CI").contains("true")
|
||||||
|
|
||||||
scalaVersion in ThisBuild := scala2_13
|
ThisBuild / scalaVersion := scala2_13
|
||||||
|
|
||||||
crossScalaVersions in ThisBuild := List(scala2_13, scala2_12)
|
ThisBuild / crossScalaVersions := List(scala2_13, scala2_12)
|
||||||
|
|
||||||
//https://github.com/sbt/sbt/pull/5153
|
//https://github.com/sbt/sbt/pull/5153
|
||||||
//https://github.com/bitcoin-s/bitcoin-s/pull/2194
|
//https://github.com/bitcoin-s/bitcoin-s/pull/2194
|
||||||
excludeLintKeys in Global ++= Set(
|
Global / excludeLintKeys ++= Set(
|
||||||
com.typesafe.sbt.packager.Keys.maintainer,
|
com.typesafe.sbt.packager.Keys.maintainer,
|
||||||
Keys.mainClass,
|
Keys.mainClass,
|
||||||
com.typesafe.sbt.SbtGit.GitKeys.gitRemoteRepo
|
com.typesafe.sbt.SbtGit.GitKeys.gitRemoteRepo
|
||||||
@ -22,4 +22,4 @@ excludeLintKeys in Global ++= Set(
|
|||||||
//needed so that we can use our versions with docker
|
//needed so that we can use our versions with docker
|
||||||
//see: https://github.com/dwijnand/sbt-dynver#portable-version-strings
|
//see: https://github.com/dwijnand/sbt-dynver#portable-version-strings
|
||||||
//https://github.com/bitcoin-s/bitcoin-s/issues/2672
|
//https://github.com/bitcoin-s/bitcoin-s/issues/2672
|
||||||
dynverSeparator in ThisBuild := "-"
|
ThisBuild / dynverSeparator := "-"
|
||||||
|
@ -38,23 +38,22 @@ object CommonSettings {
|
|||||||
url("https://twitter.com/Chris_Stewart_5")
|
url("https://twitter.com/Chris_Stewart_5")
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
scalacOptions in Compile ++= compilerOpts(scalaVersion =
|
Compile / scalacOptions ++= compilerOpts(scalaVersion = scalaVersion.value),
|
||||||
scalaVersion.value),
|
|
||||||
Test / scalacOptions ++= testCompilerOpts(scalaVersion =
|
Test / scalacOptions ++= testCompilerOpts(scalaVersion =
|
||||||
scalaVersion.value),
|
scalaVersion.value),
|
||||||
//remove annoying import unused things in the scala console
|
//remove annoying import unused things in the scala console
|
||||||
//https://stackoverflow.com/questions/26940253/in-sbt-how-do-you-override-scalacoptions-for-console-in-all-configurations
|
//https://stackoverflow.com/questions/26940253/in-sbt-how-do-you-override-scalacoptions-for-console-in-all-configurations
|
||||||
scalacOptions in (Compile, console) ~= (_ filterNot (s =>
|
Compile / console / scalacOptions ~= (_ filterNot (s =>
|
||||||
s == "-Ywarn-unused-import"
|
s == "-Ywarn-unused-import"
|
||||||
|| s == "-Ywarn-unused"
|
|| s == "-Ywarn-unused"
|
||||||
|| s == "-Xfatal-warnings"
|
|| s == "-Xfatal-warnings"
|
||||||
//for 2.13 -- they use different compiler opts
|
//for 2.13 -- they use different compiler opts
|
||||||
|| s == "-Xlint:unused")),
|
|| s == "-Xlint:unused")),
|
||||||
//we don't want -Xfatal-warnings for publishing with publish/publishLocal either
|
//we don't want -Xfatal-warnings for publishing with publish/publishLocal either
|
||||||
scalacOptions in (Compile, doc) ~= (_ filterNot (s =>
|
Compile / doc / scalacOptions ~= (_ filterNot (s =>
|
||||||
s == "-Xfatal-warnings")),
|
s == "-Xfatal-warnings")),
|
||||||
scalacOptions in (Test, console) ++= (scalacOptions in (Compile, console)).value,
|
Test / console / scalacOptions ++= (Compile / console / scalacOptions).value,
|
||||||
scalacOptions in Test ++= testCompilerOpts(scalaVersion.value),
|
Test / scalacOptions ++= testCompilerOpts(scalaVersion.value),
|
||||||
licenses += ("MIT", url("http://opensource.org/licenses/MIT"))
|
licenses += ("MIT", url("http://opensource.org/licenses/MIT"))
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -148,9 +147,9 @@ object CommonSettings {
|
|||||||
|
|
||||||
lazy val testSettings: Seq[Setting[_]] = Seq(
|
lazy val testSettings: Seq[Setting[_]] = Seq(
|
||||||
//show full stack trace (-oF) of failed tests and duration of tests (-oD)
|
//show full stack trace (-oF) of failed tests and duration of tests (-oD)
|
||||||
testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-oDF"),
|
Test / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-oDF"),
|
||||||
logBuffered in Test := false,
|
Test / logBuffered := false,
|
||||||
skip.in(publish) := true
|
skip / publish := true
|
||||||
) ++ settings
|
) ++ settings
|
||||||
|
|
||||||
lazy val prodSettings: Seq[Setting[_]] = settings
|
lazy val prodSettings: Seq[Setting[_]] = settings
|
||||||
@ -168,9 +167,9 @@ object CommonSettings {
|
|||||||
//set the user to be 'bitcoin-s' rather than
|
//set the user to be 'bitcoin-s' rather than
|
||||||
//the default provided by sbt native packager
|
//the default provided by sbt native packager
|
||||||
//which is 'demiourgos728'
|
//which is 'demiourgos728'
|
||||||
daemonUser in Docker := "bitcoin-s",
|
Docker / daemonUser := "bitcoin-s",
|
||||||
packageName in Docker := packageName.value,
|
Docker / packageName := packageName.value,
|
||||||
version in Docker := version.value,
|
Docker / version := version.value,
|
||||||
dockerUpdateLatest := isSnapshot.value
|
dockerUpdateLatest := isSnapshot.value
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user