generated from openpeeps/pistachio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpexels.nimble
42 lines (35 loc) · 935 Bytes
/
pexels.nimble
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Package
version = "0.1.0"
author = "George Lemon"
description = "Nim library for the Pexels API"
license = "MIT"
srcDir = "src"
# Dependencies
requires "nim >= 2.0.0"
requires "jsony"
import std/[os, macros]
proc targetSource(x: string): string {.compileTime.} =
result = x & " src" / "pexels" / x & ".nim"
macro genTaskBuilders*(modules: static seq[string]) =
result = newStmtList()
for k in modules:
add result,
nnkCommand.newTree(
ident"task",
ident("build_" & k),
newLit("build /" & k),
nnkStmtList.newTree(
nnkCommand.newTree(
ident"exec",
nnkInfix.newTree(
ident"&",
newLit"nim c -d:ssl -o:./bin/",
newCall(
ident"targetSource",
newLit(k)
)
)
)
)
)
genTaskBuilders(@["photo", "video"])