2021-03-02 13:32:20 +00:00
|
|
|
mode = ScriptMode.Verbose
|
|
|
|
|
|
|
|
packageName = "presto"
|
2024-10-30 12:21:32 +00:00
|
|
|
version = "0.1.0"
|
2021-03-02 13:32:20 +00:00
|
|
|
author = "Status Research & Development GmbH"
|
|
|
|
description = "REST API implementation"
|
|
|
|
license = "MIT"
|
|
|
|
skipDirs = @["tests", "examples"]
|
|
|
|
|
2023-06-01 13:32:45 +00:00
|
|
|
requires "nim >= 1.6.0",
|
2024-10-30 12:21:32 +00:00
|
|
|
"chronos ^= 4.0.3",
|
2021-03-02 13:32:20 +00:00
|
|
|
"chronicles",
|
2023-09-04 13:10:11 +00:00
|
|
|
"metrics",
|
2024-06-26 10:10:35 +00:00
|
|
|
"results",
|
2021-03-02 13:32:20 +00:00
|
|
|
"stew"
|
|
|
|
|
2022-12-09 08:17:13 +00:00
|
|
|
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-06-01 13:32:45 +00:00
|
|
|
" --styleCheck:usages --styleCheck:error" &
|
2022-12-09 08:17:13 +00:00
|
|
|
(if verbose: "" else: " --verbosity:0 --hints:off") &
|
|
|
|
" --skipParentCfg --skipUserCfg --outdir:build --nimcache:build/nimcache -f"
|
|
|
|
|
|
|
|
proc build(args, path: string) =
|
|
|
|
exec nimc & " " & lang & " " & cfg & " " & flags & " " & args & " " & path
|
|
|
|
|
2024-06-26 10:10:35 +00:00
|
|
|
proc run(path: string) =
|
|
|
|
build " --mm:refc -r", path
|
2024-02-14 02:36:37 +00:00
|
|
|
if (NimMajor, NimMinor) > (1, 6):
|
2024-06-26 10:10:35 +00:00
|
|
|
build " --mm:orc -r", path
|
2021-03-02 13:32:20 +00:00
|
|
|
|
|
|
|
task test, "Runs rest tests":
|
2024-06-26 10:10:35 +00:00
|
|
|
run "tests/testall"
|