nim-json-rpc/json_rpc.nimble

61 lines
1.9 KiB
Plaintext
Raw Normal View History

2023-12-14 08:34:13 +07:00
# json-rpc
# Copyright (c) 2019-2024 Status Research & Development GmbH
2023-12-14 08:34:13 +07:00
# 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"
version = "0.4.4"
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 & " --mm:refc -r", path
if (NimMajor, NimMinor) > (1, 6):
build args & " --mm:orc -r", path
2018-04-11 14:48:34 +03:00
proc buildOnly(args, path: string) =
build args & " --mm:refc", path
if (NimMajor, NimMinor) > (1, 6):
build args & " --mm:orc", path
2018-04-11 14:48:34 +03:00
task test, "run tests":
run "", "tests/all"
when not defined(windows):
# on windows, socker server build failed
buildOnly "-d:\"chronicles_sinks=textlines[dynamic],json[dynamic]\"", "tests/all"