# # # Maintenance program for Nim # (c) Copyright 2015 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. # # See doc/koch.txt for documentation. # when defined(gcc) and defined(windows): when defined(x86): {.link: "icons/koch.res".} else: {.link: "icons/koch_icon.o".} when defined(amd64) and defined(windows) and defined(vcc): {.link: "icons/koch-amd64-windows-vcc.res" .} when defined(i386) and defined(windows) and defined(vcc): {.link: "icons/koch-i386-windows-vcc.res" .} import os, strutils, parseopt, osproc, streams const VersionAsString = system.NimVersion #"0.10.2" when defined(withUpdate): import httpclient when defined(haveZipLib): import zipfiles const HelpText = """ +-----------------------------------------------------------------+ | Maintenance program for Nim | | Version $1| | (c) 2015 Andreas Rumpf | +-----------------------------------------------------------------+ Build time: $2, $3 Usage: koch [options] command [options for command] Options: --help, -h shows this help and quits Possible Commands: boot [options] bootstraps with given command line options install [bindir] installs to given directory; Unix only! geninstall generate ./install.sh; Unix only! testinstall test tar.xz package; Unix only! Only for devs! clean cleans Nim project; removes generated files web [options] generates the website and the full documentation website [options] generates only the website csource [options] builds the C sources for installation pdf builds the PDF documentation zip builds the installation ZIP package xz builds the installation XZ package nsis [options] builds the NSIS Setup installer (for Windows) tests [options] run the testsuite update updates nim to the latest version from github (compile koch with -d:withUpdate to enable) temp options creates a temporary compiler for testing winrelease creates a release (for coredevs only) Boot options: -d:release produce a release version of the compiler -d:tinyc include the Tiny C backend (not supported on Windows) -d:useLinenoise use the linenoise library for interactive mode (not needed on Windows) -d:nativeStacktrace use native stack traces (only for Mac OS X or Linux) -d:noCaas build Nim without CAAS support -d:avoidTimeMachine only for Mac OS X, excludes nimcache dir from backups Web options: --googleAnalytics:UA-... add the given google analytics code to the docs. To build the official docs, use UA-48159761-1 """ proc exe(f: string): string = return addFileExt(f, ExeExt) proc findNim(): string = var nim = "nim".exe result = "bin" / nim if existsFile(result): return for dir in split(getEnv("PATH"), PathSep): if existsFile(dir / nim): return dir / nim # assume there is a symlink to the exe or something: return nim proc exec(cmd: string, errorcode: int = QuitFailure, additionalPATH = "") = let prevPATH = getEnv("PATH") if additionalPATH.len > 0: var absolute = additionalPATH if not absolute.isA
discard """
output: "<br>"
"""
template htmlTag(tag: untyped) =
proc tag(): string = "<" & astToStr(tag) & ">"
htmlTag(br)
htmlTag(html)
echo br()