nim-json-rpc/json_rpc.nimble

61 lines
2.0 KiB
Plaintext
Raw Normal View History

2023-12-14 08:34:13 +07:00
# json-rpc
# Copyright (c) 2019-2023 Status Research & Development GmbH
# Licensed under either of
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
# at your option.
# This file may not be copied, modified, or distributed except according to
# those terms.
mode = ScriptMode.Verbose
2018-06-26 19:08:11 +01:00
packageName = "json_rpc"
2024-01-11 21:23:55 +07:00
version = "0.3.0"
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
2023-05-25 09:16:08 +00:00
requires "nim >= 1.6.0",
2021-11-22 10:09:13 -03:00
"stew",
2018-05-09 15:08:03 +01:00
"nimcrypto",
"stint",
"chronos#head",
"httputils#head",
"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 cfg =
2023-05-25 09:16:08 +00:00
" --styleCheck:usages --styleCheck:error" &
(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"