2023-12-14 08:34:13 +07:00
|
|
|
# json-rpc
|
2024-02-14 02:28:29 +00:00
|
|
|
# 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.
|
|
|
|
|
|
2022-12-02 13:17:27 +01:00
|
|
|
mode = ScriptMode.Verbose
|
|
|
|
|
|
2018-06-26 19:08:11 +01:00
|
|
|
packageName = "json_rpc"
|
2024-10-15 16:59:34 +07:00
|
|
|
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"
|
2018-05-22 20:42:14 +01:00
|
|
|
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",
|
2018-06-07 10:02:14 +03:00
|
|
|
"stint",
|
2024-01-03 20:06:53 +07:00
|
|
|
"chronos#head",
|
|
|
|
|
"httputils#head",
|
2021-12-16 11:47:45 +01:00
|
|
|
"chronicles",
|
2021-11-29 13:17:41 +02:00
|
|
|
"websock",
|
2022-12-02 13:17:27 +01:00
|
|
|
"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" &
|
2022-12-02 13:17:27 +01:00
|
|
|
(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) =
|
2024-07-01 18:07:28 +02:00
|
|
|
build args & " --mm:refc -r", path
|
2024-02-14 02:28:29 +00:00
|
|
|
if (NimMajor, NimMinor) > (1, 6):
|
2024-07-01 18:07:28 +02:00
|
|
|
build args & " --mm:orc -r", path
|
2018-04-11 14:48:34 +03:00
|
|
|
|
2024-02-19 13:47:40 +07:00
|
|
|
proc buildOnly(args, path: string) =
|
2024-07-01 18:07:28 +02:00
|
|
|
build args & " --mm:refc", path
|
2024-02-19 13:47:40 +07:00
|
|
|
if (NimMajor, NimMinor) > (1, 6):
|
2024-07-01 18:07:28 +02:00
|
|
|
build args & " --mm:orc", path
|
2018-04-11 14:48:34 +03:00
|
|
|
|
|
|
|
|
task test, "run tests":
|
2022-12-02 13:17:27 +01:00
|
|
|
run "", "tests/all"
|
2024-02-19 13:47:40 +07:00
|
|
|
|
|
|
|
|
when not defined(windows):
|
|
|
|
|
# on windows, socker server build failed
|
|
|
|
|
buildOnly "-d:\"chronicles_sinks=textlines[dynamic],json[dynamic]\"", "tests/all"
|