-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
nish.nimble
65 lines (52 loc) · 2.47 KB
/
nish.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
62
63
64
65
import os
# Package
version = "0.8.2"
author = "Bartek thindil Jasicki"
description = "A non-POSIX, multiplatform command line shell"
license = "BSD-3-Clause"
srcDir = "src"
bin = @["nish"]
binDir = "bin"
# Dependencies
requires "nim >= 2.0.0"
requires "contracts >= 0.2.2"
requires "nimassets >= 0.2.4"
requires "termstyle >= 0.1.0"
requires "nancy >= 0.1.1"
requires "nimalyzer >= 0.7.1"
requires "norm >= 2.8.1"
requires "unittest2"
# Tasks
task man, "create the UNIX man page for the shell":
var
readme = readFile("README.md")
man = readFile("tools" & DirSep & "nish.1.in")
readme = readme.replace("\n", "\n ")
man = man.replace("[README.md]", readme)
man = man.replace("[VERSION]", version)
writeFile(binDir & DirSep & "nish.1", man)
echo "The Unix man page for the shell was created."
task debug, "builds the shell in debug mode":
exec "nimassets -d=help -o=" & srcDir & DirSep & "helpcontent.nim"
exec "nim c -d:debug --styleCheck:hint --spellSuggest:auto --errorMax:0 --outdir:" &
binDir & " " & srcDir & DirSep & "nish.nim"
task release, "builds the project in release mode":
exec "nimassets -d=help -o=" & srcDir & DirSep & "helpcontent.nim"
exec "nim c -d:release --passc:-flto --passl:-s --outdir:" & binDir & " " &
srcDir & DirSep & "nish.nim"
task test, "run the project unit tests":
exec "nimassets -d=help -o=" & srcDir & DirSep & "helpcontent.nim"
for file in listFiles("tests"):
if file.endsWith("nim") and file != "tests" & DirSep & "megatest.nim":
exec "nim c --verbosity:0 -r " & file
task releasearm, "builds the project in release mode for Linux on arm":
exec "nimassets -d=help -o=" & srcDir & DirSep & "helpcontent.nim"
exec "nim c --cpu:arm -d:release --passc:-flto --passl:-s --outdir:" &
binDir & " " & srcDir & DirSep & "nish.nim"
task releasewindows, "builds the project in release mode for Windows 64-bit":
exec "nimassets -d=help -o=" & srcDir & DirSep & "helpcontent.nim"
exec "nim c -d:mingw --os:windows --cpu:amd64 --amd64.windows.gcc.exe:x86_64-w64-mingw32-gcc --amd64.windows.gcc.linkerexe=x86_64-w64-mingw32-gcc -d:release --passc:-flto --passl:-s --outdir:" & binDir & " " & srcDir & DirSep & "nish.nim"
task analyze, "builds the project in analyze mode (release with nimprofiler support)":
exec "nimassets -d=help -o=" & srcDir & DirSep & "helpcontent.nim"
exec "nim c -d:release --profiler:on --stackTrace:on --passc:-flto --passl:-s --outdir:" & binDir & " " &
srcDir & DirSep & "nish.nim"