version 0.8.2
This commit is contained in:
parent
581572b28c
commit
053309e60a
125 changed files with 6564 additions and 1308 deletions
|
|
@ -1,4 +1,4 @@
|
|||
#subsChar ?
|
||||
#! stdtmpl(subsChar='?') | standard
|
||||
#proc GenerateBuildScript(c: TConfigData): string =
|
||||
# result = "#! /bin/sh\n# Generated by niminst\n"
|
||||
CC="gcc"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#subsChar ?
|
||||
#! stdtmpl(subsChar='?') | standard
|
||||
#proc GenerateDeinstallScript(c: TConfigData): string =
|
||||
# result = "#! /bin/sh\n# Generated by niminst\n"
|
||||
# var proj = c.name.toLower
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
#! stdtmpl | standard
|
||||
#proc GenerateInnoSetup(c: TConfigData): string =
|
||||
# result = ""
|
||||
; Default Template for NimInst
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#subsChar ?
|
||||
#! stdtmpl(subsChar = '?') | standard
|
||||
#proc GenerateInstallScript(c: TConfigData): string =
|
||||
# result = "#! /bin/sh\n# Generated by niminst\n"
|
||||
# var proj = c.name.toLower
|
||||
|
|
|
|||
|
|
@ -152,8 +152,8 @@ proc walkDirRecursively(s: var seq[string], root: string) =
|
|||
for k, f in walkDir(root):
|
||||
case k
|
||||
of pcFile, pcLinkToFile: add(s, UnixToNativePath(f))
|
||||
of pcDirectory: walkDirRecursively(s, f)
|
||||
of pcLinkToDirectory: nil
|
||||
of pcDir: walkDirRecursively(s, f)
|
||||
of pcLinkToDir: nil
|
||||
|
||||
proc addFiles(s: var seq[string], patterns: seq[string]) =
|
||||
for p in items(patterns):
|
||||
|
|
@ -339,9 +339,10 @@ proc setupDist(c: var TConfigData) =
|
|||
if c.innoSetup.path.len == 0:
|
||||
c.innoSetup.path = "iscc.exe"
|
||||
var outcmd = if c.outdir.len == 0: "build" else: c.outdir
|
||||
var cmd = "$# $# /O$# $#" % [c.innoSetup.path, c.innoSetup.flags, outcmd, n]
|
||||
var cmd = "$# $# /O$# $#" % [quoteIfContainsWhite(c.innoSetup.path),
|
||||
c.innoSetup.flags, outcmd, n]
|
||||
Echo(cmd)
|
||||
if executeShellCommand(cmd) == 0:
|
||||
if execShellCmd(cmd) == 0:
|
||||
removeFile(n)
|
||||
else:
|
||||
quit("External program failed")
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ type
|
|||
TKeyValPair = tuple[key, val: string]
|
||||
TConfigData = object of TObject
|
||||
tabs, links: seq[TKeyValPair]
|
||||
doc, srcdoc, webdoc: seq[string]
|
||||
doc, srcdoc, webdoc, pdf: seq[string]
|
||||
authors, projectName, projectTitle, logo, infile, outdir, ticker: string
|
||||
vars: PStringTable
|
||||
nimrodArgs: string
|
||||
|
|
@ -25,9 +25,10 @@ proc initConfigData(c: var TConfigData) =
|
|||
c.doc = @[]
|
||||
c.srcdoc = @[]
|
||||
c.webdoc = @[]
|
||||
c.pdf = @[]
|
||||
c.infile = ""
|
||||
c.outdir = ""
|
||||
c.nimrodArgs = ""
|
||||
c.nimrodArgs = "--hint[Conf]:off "
|
||||
c.authors = ""
|
||||
c.projectTitle = ""
|
||||
c.projectName = ""
|
||||
|
|
@ -65,7 +66,7 @@ proc parseCmdLine(c: var TConfigData) =
|
|||
case kind
|
||||
of cmdArgument:
|
||||
c.infile = addFileExt(key, "ini")
|
||||
c.nimrodArgs = cmdLineRest(p)
|
||||
c.nimrodArgs.add(cmdLineRest(p))
|
||||
break
|
||||
of cmdLongOption, cmdShortOption:
|
||||
case normalize(key)
|
||||
|
|
@ -86,8 +87,8 @@ proc walkDirRecursively(s: var seq[string], root, ext: string) =
|
|||
of pcFile, pcLinkToFile:
|
||||
if cmpIgnoreCase(ext, splitFile(f).ext) == 0:
|
||||
add(s, f)
|
||||
of pcDirectory: walkDirRecursively(s, f, ext)
|
||||
of pcLinkToDirectory: nil
|
||||
of pcDir: walkDirRecursively(s, f, ext)
|
||||
of pcLinkToDir: nil
|
||||
|
||||
proc addFiles(s: var seq[string], dir, ext: string, patterns: seq[string]) =
|
||||
for p in items(patterns):
|
||||
|
|
@ -132,6 +133,7 @@ proc parseIniFile(c: var TConfigData) =
|
|||
of "documentation":
|
||||
case normalize(k.key)
|
||||
of "doc": addFiles(c.doc, "doc", ".txt", split(v, {';'}))
|
||||
of "pdf": addFiles(c.pdf, "doc", ".txt", split(v, {';'}))
|
||||
of "srcdoc": addFiles(c.srcdoc, "lib", ".nim", split(v, {';'}))
|
||||
of "webdoc": addFiles(c.webdoc, "lib", ".nim", split(v, {';'}))
|
||||
else: quit(errorStr(p, "unknown variable: " & k.key))
|
||||
|
|
@ -167,11 +169,24 @@ proc buildDoc(c: var TConfigData, destPath: string) =
|
|||
[c.nimrodArgs, destPath])
|
||||
|
||||
proc buildPdfDoc(c: var TConfigData, destPath: string) =
|
||||
for d in items(c.doc):
|
||||
Exec("nimrod rst2tex $# $#" % [c.nimrodArgs, d])
|
||||
|
||||
|
||||
|
||||
if os.execShellCmd("pdflatex -version") != 0:
|
||||
echo "pdflatex not found; not PDF documentation generated"
|
||||
else:
|
||||
for d in items(c.pdf):
|
||||
Exec("nimrod rst2tex $# $#" % [c.nimrodArgs, d])
|
||||
# call LaTeX twice to get cross references right:
|
||||
Exec("pdflatex " & changeFileExt(d, "tex"))
|
||||
Exec("pdflatex " & changeFileExt(d, "tex"))
|
||||
# delete all the crappy temporary files:
|
||||
var pdf = extractFileTrunk(d) & ".pdf"
|
||||
moveFile(destPath / pdf, pdf)
|
||||
removeFile(changeFileExt(pdf, "aux"))
|
||||
if existsFile(changeFileExt(pdf, "toc")):
|
||||
removeFile(changeFileExt(pdf, "toc"))
|
||||
removeFile(changeFileExt(pdf, "log"))
|
||||
removeFile(changeFileExt(pdf, "out"))
|
||||
removeFile(changeFileExt(d, "tex"))
|
||||
|
||||
proc buildAddDoc(c: var TConfigData, destPath: string) =
|
||||
# build additional documentation (without the index):
|
||||
for d in items(c.webdoc):
|
||||
|
|
@ -205,6 +220,7 @@ proc main(c: var TConfigData) =
|
|||
buildAddDoc(c, "web/upload")
|
||||
buildDoc(c, "web/upload")
|
||||
buildDoc(c, "doc")
|
||||
#buildPdfDoc(c, "doc")
|
||||
|
||||
var c: TConfigData
|
||||
initConfigData(c)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
#! stdtmpl | standard
|
||||
#proc generateHTMLPage(c: var TConfigData, currentTab, content: string): string =
|
||||
# result = ""
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue