Skip to content

Commit db0d567

Browse files
committed
[ETCM-52] Adjust packaging and SecureRandom to run on Windows
1 parent d974866 commit db0d567

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ project/boot/
44
project/plugins/project/
55
.ensime
66
.ensime_cache/
7+
.bloop
78

89
# IDE folders
910
.idea/
1011
.metals/
12+
metals.sbt
1113
.vscode/
1214

1315
# intellij scala worksheet

build.sbt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ scalacOptions in (Compile, console) ~= (_.filterNot(
124124
)
125125
))
126126

127-
parallelExecution in Test := false
127+
Test / parallelExecution := false
128+
129+
ThisBuild / turbo := true
128130

129131
testOptions in Test += Tests.Argument("-oDG")
130132

@@ -142,11 +144,13 @@ unmanagedResourceDirectories in Compile += baseDirectory.value / "src" / "main"
142144
(scalastyleConfig in Test) := baseDirectory.value / "scalastyle-test-config.xml"
143145
scalastyleSources in Test ++= { (unmanagedSourceDirectories in Integration).value }
144146

147+
// Packaging
148+
enablePlugins(JavaAppPackaging)
145149
mainClass in Compile := Some("io.iohk.ethereum.App")
146-
150+
discoveredMainClasses in Compile := Seq("io.iohk.ethereum.mallet.main.Mallet")
147151
// Requires the 'ant-javafx.jar' that comes with Oracle JDK
148152
// Enables creating an executable with the configuration files, has to be run on the OS corresponding to the desired version
149-
jdkPackagerType := "image"
153+
ThisBuild / jdkPackagerType := "image"
150154

151155
Universal / mappings += (resourceDirectory in Compile).value / "logback.xml" -> "conf/logback.xml"
152156

@@ -157,6 +161,7 @@ jdkPackagerJVMArgs := Seq(
157161
"-Xss10M"
158162
)
159163

164+
160165
coverageExcludedPackages := "io\\.iohk\\.ethereum\\.extvm\\.msg.*"
161166

162167
addCommandAlias(

project/plugins.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
logLevel := sbt.Level.Warn
22
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
33
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0")
4-
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.3.21")
4+
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.7.5")
55
addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "2.1.0")
66
addSbtPlugin("com.thesamet" % "sbt-protoc" % "0.99.25")
77
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.4.2")

src/main/scala/io/iohk/ethereum/nodebuilder/NodeBuilder.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ trait GenesisDataLoaderBuilder {
536536

537537
trait SecureRandomBuilder {
538538
lazy val secureRandom: SecureRandom =
539-
Config.secureRandomAlgo.map(SecureRandom.getInstance).getOrElse(new SecureRandom())
539+
Config.secureRandomAlgo.flatMap(name => Try(SecureRandom.getInstance(name)).toOption).getOrElse(new SecureRandom())
540540
}
541541

542542
/** Provides the basic functionality of a Node, except the consensus algorithm.

src/main/scala/io/iohk/ethereum/utils/Ref.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package io.iohk.ethereum.utils
33
import java.util.concurrent.atomic.AtomicReference
44

55
/**
6-
* An [[java.util.concurrent.atomic.AtomicReference AtomicReference]] that can be set once.
6+
* An [[https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/AtomicReference.html java.util.concurrent.atomic.AtomicReference]] that can be set once.
77
*/
88
class Ref[T <: AnyRef] {
99
private[this] final val ref = new AtomicReference[Option[T]](None)

0 commit comments

Comments
 (0)