this could be done by post-processing nimble file with a header and footer, eg:
before nimble runs nim e foo.nimble, a temp ~/.cache/nim/nimble/foo.nimble.nims is created with:
var version:string
var author: string
...
var installDirs: seq[string]
proc requires(s: string) = ...
include "foo.nimble"
proc finalize() = ... # if needed
so that this works as regular nimscript:
version = system.NimVersion
author = "Andreas Rumpf"
description = "Compiler package providing the compiler sources as a library."
license = "MIT"
installDirs = @["compiler", "nimsuggest"]
requires "nim >= 0.14.0"
nimble [nimble_args...] --nim=nim_temp -- [nim_args...]
@genotrance said here: https://irclogs.nim-lang.org/04-01-2019.html#22:39:08
but awaiting a link :-)
note
this could be done by post-processing nimble file with a header and footer, eg: before nimble runs
nim e foo.nimble
, a temp~/.cache/nim/nimble/foo.nimble.nims
is created with:so that this works as regular nimscript: