nim-json-rpc/json_rpc.nimble

53 lines
1.8 KiB
Plaintext
Raw Normal View History

mode = ScriptMode.Verbose
2018-06-26 19:08:11 +01:00
packageName = "json_rpc"
version = "0.0.2"
2018-03-02 13:01:30 +00:00
author = "Status Research & Development GmbH"
description = "Ethereum remote procedure calls"
license = "Apache License 2.0"
skipDirs = @["tests"]
2018-03-02 13:01:30 +00:00
### Dependencies
requires "nim >= 1.2.0",
2021-11-22 10:09:13 -03:00
"stew",
2018-05-09 15:08:03 +01:00
"nimcrypto",
"stint",
"chronos",
"httputils",
"chronicles",
"websock",
"json_serialization",
"unittest2"
let nimc = getEnv("NIMC", "nim") # Which nim compiler to use
let lang = getEnv("NIMLANG", "c") # Which backend (c/cpp/js)
let flags = getEnv("NIMFLAGS", "") # Extra flags for the compiler
let verbose = getEnv("V", "") notin ["", "0"]
let styleCheckStyle = if (NimMajor, NimMinor) < (1, 6): "hint" else: "error"
let cfg =
" --styleCheck:usages --styleCheck:" & styleCheckStyle &
(if verbose: "" else: " --verbosity:0 --hints:off") &
" --skipParentCfg --skipUserCfg --outdir:build --nimcache:build/nimcache -f" &
" --threads:on -d:chronicles_log_level=ERROR"
proc build(args, path: string) =
exec nimc & " " & lang & " " & cfg & " " & flags & " " & args & " " & path
proc run(args, path: string) =
build args & " -r", path
2018-04-11 14:48:34 +03:00
proc buildBinary(name: string, srcDir = "./", params = "", cmdParams = "") =
if not dirExists "build":
mkDir "build"
2022-04-08 10:25:41 +02:00
exec "nim " & getEnv("TEST_LANG", "c") & " " & getEnv("NIMFLAGS") &
" -r -f --skipUserCfg:on --skipParentCfg:on --verbosity:0" &
" --debuginfo --path:'.' --threads:on -d:chronicles_log_level=ERROR" &
" --styleCheck:usages --styleCheck:hint" &
" --hint[XDeclaredButNotUsed]:off --hint[Processing]:off " &
" --out:./build/" & name & " " & params & " " & srcDir & name & ".nim" &
" " & cmdParams
2018-04-11 14:48:34 +03:00
task test, "run tests":
run "", "tests/all"