-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnashorn.nimble
34 lines (27 loc) · 902 Bytes
/
nashorn.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
# Package
version = "0.1.0"
author = "hlaaftana"
description = "Nim bindings for Java Nashorn's JS API"
license = "MIT"
srcDir = "src"
backend = "js"
# Dependencies
requires "nim >= 0.18.0"
import ospaths
task buildTests, "builds tests":
for f in listFiles("tests"):
let (dir, name, ext) = splitFile(f)
if ext == ".nim":
exec "nim js -o:bin/" & name & ".js tests/" & name
task buildTestsRelease, "builds tests in release mode":
for f in listFiles("tests"):
let (dir, name, ext) = splitFile(f)
if ext == ".nim":
exec "nim js -d:release -o:bin/" & name & ".js tests/" & name
task runBuiltTests, "runs test scripts in bin folder":
for f in listFiles("bin"):
let (dir, name, ext) = splitFile(f)
if ext == ".js":
try:
exec (if name == "fx": "jjs -fx " else: "jjs ") & (dir / (name & ext))
except: discard