all repos — nifty @ 000ea8b48f6f9ac686e2cd031a8cb59ece641b63

A tiny (pseudo) package manager and script runner.

Added nakefile.
h3rald h3rald@h3rald.com
Sun, 29 Apr 2018 15:34:05 +0200
commit

000ea8b48f6f9ac686e2cd031a8cb59ece641b63

parent

da878ca36ba0377eab2e9a28e15a472c4bfcbbe6

2 files changed, 60 insertions(+), 0 deletions(-)

jump to
M .gitignore.gitignore

@@ -2,4 +2,6 @@ nimcache/

Nifty_UserGuide.htm nifty.exe nifty +nakefile +nakefile.exe packages/
A nakefile.nim

@@ -0,0 +1,58 @@

+import + nake + +import + lib/config + +const + compile = "nim c -d:release" + linux_x86 = "--cpu:i386 --os:linux" + linux_x64 = "--cpu:amd64 --os:linux" + linux_arm = "--cpu:arm --os:linux" + windows_x64 = "--cpu:amd64 --os:windows" + macosx_x64 = "" + #parallel = "--parallelBuild:1 --verbosity:3" + hs = "nifty" + hs_file = "nifty.nim" + zip = "zip -X" + +proc filename_for(os: string, arch: string): string = + return "nifty" & "_v" & version & "_" & os & "_" & arch & ".zip" + +task "windows-x64-build", "Build nifty for Windows (x64)": + direshell compile, windows_x64, hs_file + +task "linux-x86-build", "Build nifty for Linux (x86)": + direshell compile, linux_x86, hs_file + +task "linux-x64-build", "Build nifty for Linux (x64)": + direshell compile, linux_x64, hs_file + +task "linux-arm-build", "Build nifty for Linux (ARM)": + direshell compile, linux_arm, hs_file + +task "macosx-x64-build", "Build nifty for Mac OS X (x64)": + direshell compile, macosx_x64, hs_file + +task "release", "Release nifty": + echo "\n\n\n WINDOWS - x64:\n\n" + runTask "windows-x64-build" + direshell zip, filename_for("windows", "x64"), hs & ".exe" + direshell "rm", hs & ".exe" + echo "\n\n\n LINUX - x64:\n\n" + runTask "linux-x64-build" + direshell zip, filename_for("linux", "x64"), hs + direshell "rm", hs + echo "\n\n\n LINUX - x86:\n\n" + runTask "linux-x86-build" + direshell zip, filename_for("linux", "x86"), hs + direshell "rm", hs + echo "\n\n\n LINUX - ARM:\n\n" + runTask "linux-arm-build" + direshell zip, filename_for("linux", "arm"), hs + direshell "rm", hs + echo "\n\n\n MAC OS X - x64:\n\n" + runTask "macosx-x64-build" + direshell zip, filename_for("macosx", "x64"), hs + direshell "rm", hs + echo "\n\n\n ALL DONE!"