Fixed project structure.
h3rald h3rald@h3rald.com
Sun, 06 May 2018 13:23:59 +0200
5 files changed,
37 insertions(+),
16 deletions(-)
M
nimhttpd.nim
→
src/nimhttpd.nim
@@ -12,16 +12,19 @@ strutils
from httpcore import HttpMethod, HttpHeaders +import + nimhttpdpkg/config + const - name = "NimHTTPd" - version = "1.0.5" + name = pkgTitle + version = pkgVersion style = "style.css".slurp - description = "A tiny static file web server" - -let usage = name & " v" & version & " - " & description & """ + description = pkgDescription + author = pkgAuthor - (c) 2014-2018 Fabio Cevasco +let usage = """ $1 v$2 - $3 + (c) 2014-2018 $4 Usage: nimhttpd [-p:port] [directory]@@ -31,7 +34,7 @@ directory The directory to serve (default: current directory).
Options: -p, --port The port to listen to (default: 1337). -""" +""" % [name, version, description, author] type
M
nimhttpd.nimble
→
nimhttpd.nimble
@@ -1,8 +1,21 @@
+import + ospaths + +template thisModuleFile: string = instantiationInfo(fullPaths = true).filename + +when fileExists(thisModuleFile.parentDir / "src/nimhttpdpkg/config.nim"): + # In the git repository the Nimble sources are in a ``src`` directory. + import src/nimhttpdpkg/config +else: + # When the package is installed, the ``src`` directory disappears. + import nimhttpdpkg/config + + # Package -version = "1.0.5" -author = "Fabio Cevasco" -description = "A tiny static file web server." +version = pkgVersion +author = pkgAuthor +description = pkgDescription license = "MIT" bin = @["nimhttpd"] srcDir = "src"@@ -12,13 +25,13 @@
requires "nim >= 0.18.0" const compile = "nim c -d:release" -const linux_x86 = "--cpu:i386 --os:linux" -const linux_x64 = "--cpu:amd64 --os:linux" -const linux_arm = "--cpu:arm --os:linux" -const windows_x64 = "--cpu:amd64 --os:windows" -const macosx_x64 = "" +const linux_x86 = "--cpu:i386 --os:linux -o:nimhttpd" +const linux_x64 = "--cpu:amd64 --os:linux -o:nimhttpd" +const linux_arm = "--cpu:arm --os:linux -o:nimhttpd" +const windows_x64 = "--cpu:amd64 --os:windows -o:nimhttpd.exe" +const macosx_x64 = "-o:nimhttpd" const program = "nimhttpd" -const program_file = "nimhttpd.nim" +const program_file = "src/nimhttpd.nim" const zip = "zip -X" proc shell(command, args: string, dest = "") =
A
src/nimhttpdpkg/config.nim
@@ -0,0 +1,5 @@
+const + pkgTitle* = "NimHTTPd" + pkgVersion* = "1.0.5" + pkgAuthor* = "Fabio Cevasco" + pkgDescription* = "A tiny static file web server."