forked from godot-nim/gdext-nim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gdext.nimble
41 lines (32 loc) · 1.24 KB
/
gdext.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
# Package
version = "0.2.6"
author = "godot-nim, la.panon."
description = "Nim for GDExtension. A pure library and a CLI tool."
license = "MIT"
srcDir = "src"
installExt = @["nim"]
namedBin = toTable {"gdext/gdextwiz": "gdextwiz"}
binDir = "bin"
# Dependencies
requires "nim >= 2.0.0"
import strformat
var upstream = "https://raw.githubusercontent.com/godotengine/godot-cpp/godot-4.3-stable/gdextension/extension_api.json"
task generate, "Generate extension API from the specified source. Remember all manual changes under src/ will be deleted.":
rmDir "src/classes"
rmDir "src/gen"
withDir "coronation":
exec &"nimble run -- --apisource:{upstream} --outdir:../src"
proc report(version, script: string) =
try:
exec script
except:
quit &"[Nim {version}] \"{script}\" failed."
task compatibilityTest, "Compile with a supported range of Nims and check for compatibility.":
const versions = ["2.0.0", "2.0.10", "2.2.0"]
for version in versions:
report version, &"choosenim {version}"
report version, "nim c tests/importall"
report version, "rm tests/importall"
report version, "nimble test"
report version, "gdextwiz run-editor testproject/editor"
echo "All tests passed!"