-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckers.nimble
61 lines (47 loc) · 2.14 KB
/
checkers.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Package
version = "0.1.0"
author = "tandy1000"
description = "checkers"
license = "MIT"
# Deps
requires "nim >= 1.2.0"
requires "nico >= 0.2.5"
requires "oolib"
srcDir = "src"
import strformat
const releaseOpts = "-d:danger"
const debugOpts = "-d:debug"
task runr, "Runs checkers for current platform":
exec &"nim c -r {releaseOpts} -o:checkers src/main.nim"
task rund, "Runs debug checkers for current platform":
exec &"nim c -r {debugOpts} -o:checkers src/main.nim"
task release, "Builds checkers for current platform":
exec &"nim c {releaseOpts} -o:checkers src/main.nim"
task webd, "Builds debug checkers for web":
exec &"nim c {debugOpts} -d:emscripten -o:build/checkers.html src/main.nim"
task webr, "Builds release checkers for web":
exec &"nim c {releaseOpts} --deepcopy:on -d:emscripten -o:checkers.html src/main.nim"
exec &"mv -t build checkers.data checkers.html checkers.wasm checkers.js"
exec &"rm -rf tmp"
task debug, "Builds debug checkers for current platform":
exec &"nim c {debugOpts} -o:checkers_debug src/main.nim"
task deps, "Downloads dependencies":
exec "curl https://www.libsdl.org/release/SDL2-2.0.12-win32-x64.zip -o SDL2_x64.zip"
exec "unzip SDL2_x64.zip"
#exec "curl https://www.libsdl.org/release/SDL2-2.0.12-win32-x86.zip -o SDL2_x86.zip"
task androidr, "Release build for android":
if defined(windows):
exec &"nicoandroid.cmd"
else:
exec &"nicoandroid"
exec &"nim c -c --nimcache:android/app/jni/src/armeabi {releaseOpts} --cpu:arm --os:android -d:androidNDK --noMain --genScript src/main.nim"
exec &"nim c -c --nimcache:android/app/jni/src/arm64 {releaseOpts} --cpu:arm64 --os:android -d:androidNDK --noMain --genScript src/main.nim"
exec &"nim c -c --nimcache:android/app/jni/src/x86 {releaseOpts} --cpu:i386 --os:android -d:androidNDK --noMain --genScript src/main.nim"
exec &"nim c -c --nimcache:android/app/jni/src/x86_64 {releaseOpts} --cpu:amd64 --os:android -d:androidNDK --noMain --genScript src/main.nim"
withDir "android":
if defined(windows):
exec &"gradlew.bat assembleDebug"
else:
exec "./gradlew assembleDebug"
task test, "run tests":
exec "nim r tests/test.nim"