koch: 'update' feature optional for less dependencies

This commit is contained in:
Araq 2012-01-08 11:19:08 +01:00
commit 202972dea0

View file

@ -11,7 +11,10 @@ when defined(gcc) and defined(windows):
{.link: "icons/koch.res".} {.link: "icons/koch.res".}
import import
os, strutils, parseopt, osproc, httpclient, streams os, strutils, parseopt, osproc, streams
when defined(withUpdate):
import httpclient
when defined(haveZipLib): when defined(haveZipLib):
import zipfiles import zipfiles
@ -37,6 +40,7 @@ Possible Commands:
inno [options] builds the Inno Setup installer (for Windows) inno [options] builds the Inno Setup installer (for Windows)
tests run the testsuite tests run the testsuite
update updates nimrod to the latest version from github update updates nimrod to the latest version from github
(compile koch with -d:withUpdate to enable)
Boot options: Boot options:
-d:release produce a release version of the compiler -d:release produce a release version of the compiler
-d:tinyc include the Tiny C backend (not supported on Windows) -d:tinyc include the Tiny C backend (not supported on Windows)
@ -183,7 +187,11 @@ proc clean(args: string) =
# -------------- update ------------------------------------------------------- # -------------- update -------------------------------------------------------
proc update(args: string) = when defined(withUpdate):
when defined(windows):
{.warning: "Windows users: Make sure to run 'koch update' in Bash.".}
proc update(args: string) =
when defined(windows): when defined(windows):
echo("Windows users: Make sure to be running this in Bash. ", echo("Windows users: Make sure to be running this in Bash. ",
"If you aren't, press CTRL+C now.") "If you aren't, press CTRL+C now.")
@ -268,7 +276,11 @@ of cmdArgument:
of "inno": inno(op.cmdLineRest) of "inno": inno(op.cmdLineRest)
of "install": install(op.cmdLineRest) of "install": install(op.cmdLineRest)
of "test", "tests": tests(op.cmdLineRest) of "test", "tests": tests(op.cmdLineRest)
of "update": update(op.cmdLineRest) of "update":
when defined(withUpdate):
update(op.cmdLineRest)
else:
quit "this Koch has not been compiled with -d:withUpdate"
else: showHelp() else: showHelp()
of cmdEnd: showHelp() of cmdEnd: showHelp()