Skip to content

Commit d417513

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

File tree

7 files changed

+14
-13
lines changed

7 files changed

+14
-13
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: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ val dep = {
1515
val akkaHttpVersion = "10.2.0"
1616
val circeVersion = "0.9.3"
1717
val rocksDb = "5.9.2"
18-
18+
1919
Seq(
2020
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
2121
"com.typesafe.akka" %% "akka-slf4j" % akkaVersion,
@@ -101,7 +101,9 @@ scalacOptions in (Compile, console) ~= (_.filterNot(Set(
101101
"-Xfatal-warnings"
102102
)))
103103

104-
parallelExecution in Test := false
104+
Test / parallelExecution := false
105+
106+
ThisBuild / turbo := true
105107

106108
testOptions in Test += Tests.Argument("-oDG")
107109

@@ -119,11 +121,13 @@ unmanagedResourceDirectories in Compile += baseDirectory.value / "src" / "main"
119121
(scalastyleConfig in Test) := baseDirectory.value / "scalastyle-test-config.xml"
120122
scalastyleSources in Test ++= {(unmanagedSourceDirectories in Integration).value}
121123

124+
// Packaging
125+
enablePlugins(JavaAppPackaging)
122126
mainClass in Compile := Some("io.iohk.ethereum.App")
123-
127+
discoveredMainClasses in Compile := Seq("io.iohk.ethereum.mallet.main.Mallet")
124128
// Requires the 'ant-javafx.jar' that comes with Oracle JDK
125129
// Enables creating an executable with the configuration files, has to be run on the OS corresponding to the desired version
126-
jdkPackagerType := "image"
130+
ThisBuild / jdkPackagerType := "image"
127131

128132
val sep = java.io.File.separator
129133
jdkPackagerJVMArgs := Seq(
@@ -132,4 +136,5 @@ jdkPackagerJVMArgs := Seq(
132136
"-Xss10M"
133137
)
134138

139+
135140
coverageExcludedPackages := "io\\.iohk\\.ethereum\\.extvm\\.msg.*"

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
@@ -510,7 +510,7 @@ trait GenesisDataLoaderBuilder {
510510

511511
trait SecureRandomBuilder {
512512
lazy val secureRandom: SecureRandom =
513-
Config.secureRandomAlgo.map(SecureRandom.getInstance).getOrElse(new SecureRandom())
513+
Config.secureRandomAlgo.flatMap(name => Try(SecureRandom.getInstance(name)).toOption).getOrElse(new SecureRandom())
514514
}
515515

516516
/** 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)

src/universal/bin/mallet

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/universal/bin/mallet.bat

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)