2018-01-22 22:23:07 +00:00
|
|
|
mode = ScriptMode.Verbose
|
|
|
|
|
|
|
|
packageName = "nimbus"
|
|
|
|
version = "0.1.0"
|
|
|
|
author = "Status Research & Development GmbH"
|
|
|
|
description = "An Ethereum 2.0 Sharding Client for Resource-Restricted Devices"
|
|
|
|
license = "Apache License 2.0"
|
2018-06-19 19:17:20 +00:00
|
|
|
skipDirs = @["tests", "examples"]
|
2018-12-24 16:03:27 +00:00
|
|
|
# we can't have the result of a custom task in the "bin" var - https://github.com/nim-lang/nimble/issues/542
|
|
|
|
# bin = @["build/nimbus"]
|
2018-01-22 22:23:07 +00:00
|
|
|
|
2019-02-05 19:15:50 +00:00
|
|
|
requires "nim >= 0.19",
|
2018-12-24 16:03:27 +00:00
|
|
|
"chronicles",
|
2018-05-28 10:22:28 +00:00
|
|
|
"nimcrypto",
|
|
|
|
"stint",
|
2018-07-20 17:02:19 +00:00
|
|
|
"json_rpc",
|
2019-02-06 18:03:36 +00:00
|
|
|
"chronos",
|
2019-02-05 19:15:50 +00:00
|
|
|
"bncurve",
|
2019-02-06 18:03:36 +00:00
|
|
|
"eth",
|
2019-02-05 19:15:50 +00:00
|
|
|
"std_shims"
|
2018-01-30 10:51:13 +00:00
|
|
|
|
2019-02-16 21:23:17 +00:00
|
|
|
proc buildBinary(name: string, srcDir = "./", params = "", lang = "c") =
|
|
|
|
if not dirExists "build":
|
|
|
|
mkDir "build"
|
|
|
|
# allow something like "nim nimbus --verbosity:0 --hints:off nimbus.nims"
|
|
|
|
var extra_params = params
|
|
|
|
for i in 2..<paramCount():
|
|
|
|
extra_params &= " " & paramStr(i)
|
|
|
|
exec "nim " & lang & " --out:./build/" & name & " " & extra_params & " " & srcDir & name & ".nim"
|
2018-09-24 22:25:17 +00:00
|
|
|
|
2018-05-07 12:41:54 +00:00
|
|
|
proc test(name: string, lang = "c") =
|
2019-02-16 21:23:17 +00:00
|
|
|
buildBinary name, "tests/", "-r -d:chronicles_log_level=ERROR"
|
2018-01-29 17:40:22 +00:00
|
|
|
|
2018-04-03 16:09:09 +00:00
|
|
|
task test, "Run tests":
|
2019-02-16 21:23:17 +00:00
|
|
|
# debugging tools don't have tests yet, but they should be compilable
|
2019-02-15 02:11:20 +00:00
|
|
|
for binary in [
|
|
|
|
"premix/premix",
|
|
|
|
"premix/persist",
|
|
|
|
"premix/debug",
|
|
|
|
"premix/dumper",
|
|
|
|
"premix/hunter",
|
|
|
|
"tests/tracerTestGen",
|
|
|
|
"tests/persistBlockTestGen",
|
|
|
|
]:
|
|
|
|
exec "nim c --verbosity:0 --hints:off --warnings:off " & binary
|
|
|
|
rmFile binary
|
|
|
|
test "all_tests"
|
2018-09-24 22:25:17 +00:00
|
|
|
|
|
|
|
task nimbus, "Build Nimbus":
|
|
|
|
buildBinary "nimbus", "nimbus/"
|
2018-12-24 16:03:27 +00:00
|
|
|
|