finally make niminst smart about which files are important
This commit is contained in:
parent
82a75635f7
commit
e0f57ee1a1
3 changed files with 42 additions and 179 deletions
|
|
@ -60,28 +60,9 @@ Files: "icons/koch.rc"
|
||||||
Files: "icons/koch.res"
|
Files: "icons/koch.res"
|
||||||
Files: "icons/koch_icon.o"
|
Files: "icons/koch_icon.o"
|
||||||
|
|
||||||
Files: "compiler/readme.txt"
|
Files: "compiler"
|
||||||
Files: "compiler/installer.ini"
|
Files: "doc"
|
||||||
Files: "compiler/*.cfg"
|
Files: "tools"
|
||||||
Files: "compiler/*.nim"
|
|
||||||
Files: "doc/*.txt"
|
|
||||||
Files: "doc/*.rst"
|
|
||||||
Files: "doc/manual/*.txt"
|
|
||||||
Files: "doc/*.nim"
|
|
||||||
Files: "doc/*.cfg"
|
|
||||||
Files: "compiler/nimfix/*.nim"
|
|
||||||
Files: "compiler/nimfix/*.cfg"
|
|
||||||
Files: "compiler/nimsuggest/*.nim"
|
|
||||||
Files: "compiler/nimsuggest/*.cfg"
|
|
||||||
Files: "compiler/plugins/locals/*.nim"
|
|
||||||
Files: "compiler/plugins/*.nim"
|
|
||||||
Files: "tools/*.nim"
|
|
||||||
Files: "tools/*.cfg"
|
|
||||||
Files: "tools/*.tmpl"
|
|
||||||
Files: "tools/niminst/*.nim"
|
|
||||||
Files: "tools/niminst/*.cfg"
|
|
||||||
Files: "tools/niminst/*.tmpl"
|
|
||||||
Files: "tools/niminst/*.nsh"
|
|
||||||
Files: "web/website.ini"
|
Files: "web/website.ini"
|
||||||
Files: "web/*.nim"
|
Files: "web/*.nim"
|
||||||
Files: "web/*.txt"
|
Files: "web/*.txt"
|
||||||
|
|
@ -90,150 +71,13 @@ Files: "bin/nimblepkg/*.nim"
|
||||||
Files: "bin/nimblepkg/*.cfg"
|
Files: "bin/nimblepkg/*.cfg"
|
||||||
|
|
||||||
[Lib]
|
[Lib]
|
||||||
Files: "lib/nimbase.h"
|
Files: "lib"
|
||||||
Files: "lib/*.nim"
|
|
||||||
Files: "lib/*.cfg"
|
|
||||||
Files: "lib/*.nimble"
|
|
||||||
|
|
||||||
Files: "lib/system/*.nim"
|
|
||||||
Files: "lib/core/*.nim"
|
|
||||||
Files: "lib/pure/*.nim"
|
|
||||||
Files: "lib/pure/*.cfg"
|
|
||||||
Files: "lib/pure/collections/*.nim"
|
|
||||||
Files: "lib/pure/concurrency/*.nim"
|
|
||||||
Files: "lib/pure/unidecode/*.nim"
|
|
||||||
Files: "lib/pure/concurrency/*.cfg"
|
|
||||||
Files: "lib/impure/*.nim"
|
|
||||||
Files: "lib/impure/nre/private/*.nim"
|
|
||||||
Files: "lib/wrappers/*.nim"
|
|
||||||
Files: "lib/arch/*.nim"
|
|
||||||
|
|
||||||
Files: "lib/wrappers/readline/*.nim"
|
|
||||||
Files: "lib/wrappers/linenoise/*.nim"
|
|
||||||
Files: "lib/wrappers/linenoise/*.c"
|
|
||||||
Files: "lib/wrappers/linenoise/*.h"
|
|
||||||
|
|
||||||
Files: "lib/windows/*.nim"
|
|
||||||
Files: "lib/posix/*.nim"
|
|
||||||
Files: "lib/js/*.nim"
|
|
||||||
Files: "lib/packages/docutils/*.nim"
|
|
||||||
|
|
||||||
Files: "lib/deprecated/core/*.nim"
|
|
||||||
Files: "lib/deprecated/pure/*.nim"
|
|
||||||
Files: "lib/deprecated/pure/*.cfg"
|
|
||||||
|
|
||||||
[Other]
|
[Other]
|
||||||
Files: "examples/*.nim"
|
Files: "examples"
|
||||||
Files: "examples/c++iface/*.nim"
|
|
||||||
Files: "examples/objciface/*.nim"
|
|
||||||
Files: "examples/cross_calculator/"
|
|
||||||
|
|
||||||
Files: "examples/*.html"
|
|
||||||
Files: "examples/*.txt"
|
|
||||||
Files: "examples/*.cfg"
|
|
||||||
Files: "examples/*.tmpl"
|
|
||||||
|
|
||||||
Files: "dist/nimble"
|
Files: "dist/nimble"
|
||||||
|
|
||||||
Files: "tests/actiontable/*.nim"
|
Files: "tests"
|
||||||
Files: "tests/alias/*.nim"
|
|
||||||
Files: "tests/ambsym/*.nim"
|
|
||||||
Files: "tests/array/*.nim"
|
|
||||||
Files: "tests/assign/*.nim"
|
|
||||||
Files: "tests/astoverload/*.nim"
|
|
||||||
Files: "tests/async/*.nim"
|
|
||||||
Files: "tests/benchmarks/*.nim"
|
|
||||||
Files: "tests/bind/*.nim"
|
|
||||||
Files: "tests/borrow/*.nim"
|
|
||||||
Files: "tests/casestmt/*.nim"
|
|
||||||
Files: "tests/ccgbugs/*.nim"
|
|
||||||
Files: "tests/clearmsg/*.nim"
|
|
||||||
Files: "tests/closure/*.nim"
|
|
||||||
Files: "tests/cnstseq/*.nim"
|
|
||||||
Files: "tests/collections/*.nim"
|
|
||||||
Files: "tests/compiles/*.nim"
|
|
||||||
Files: "tests/concat/*.nim"
|
|
||||||
Files: "tests/concepts/*.nim"
|
|
||||||
Files: "tests/constr/*.nim"
|
|
||||||
Files: "tests/constraints/*.nim"
|
|
||||||
Files: "tests/controlflow/*.nim"
|
|
||||||
Files: "tests/converter/*.nim"
|
|
||||||
Files: "tests/cpp/*.nim"
|
|
||||||
Files: "tests/defaultprocparam/*.nim"
|
|
||||||
Files: "tests/deprecated/*.nim"
|
|
||||||
Files: "tests/destructor/*.nim"
|
|
||||||
Files: "tests/dir with space/*.nim"
|
|
||||||
Files: "tests/discard/*.nim"
|
|
||||||
Files: "tests/distinct/*.nim"
|
|
||||||
Files: "tests/dll/*.nim"
|
|
||||||
Files: "tests/effects/*.nim"
|
|
||||||
Files: "tests/enum/*.nim"
|
|
||||||
Files: "tests/exception/*.nim"
|
|
||||||
Files: "tests/exprs/*.nim"
|
|
||||||
Files: "tests/fields/*.nim"
|
|
||||||
Files: "tests/float/*.nim"
|
|
||||||
Files: "tests/friends/*.nim"
|
|
||||||
Files: "tests/gc/*.nim"
|
|
||||||
Files: "tests/generics/*.nim"
|
|
||||||
Files: "tests/gensym/*.nim"
|
|
||||||
Files: "tests/global/*.nim"
|
|
||||||
Files: "tests/implicit/*.nim"
|
|
||||||
Files: "tests/init/*.nim"
|
|
||||||
Files: "tests/iter/*.nim"
|
|
||||||
Files: "tests/js/*.nim"
|
|
||||||
Files: "tests/js/*.cfg"
|
|
||||||
Files: "tests/let/*.nim"
|
|
||||||
Files: "tests/lexer/*.nim"
|
|
||||||
Files: "tests/lookups/*.nim"
|
|
||||||
Files: "tests/macros/*.nim"
|
|
||||||
Files: "tests/magics/*.nim"
|
|
||||||
Files: "tests/metatype/*.nim"
|
|
||||||
Files: "tests/method/*.nim"
|
|
||||||
Files: "tests/misc/*.nim"
|
|
||||||
Files: "tests/modules/*.nim"
|
|
||||||
Files: "tests/namedparams/*.nim"
|
|
||||||
Files: "tests/notnil/*.nim"
|
|
||||||
Files: "tests/objects/*.nim"
|
|
||||||
Files: "tests/objvariant/*.nim"
|
|
||||||
Files: "tests/openarray/*.nim"
|
|
||||||
Files: "tests/osproc/*.nim"
|
|
||||||
Files: "tests/overflw/*.nim"
|
|
||||||
Files: "tests/overload/*.nim"
|
|
||||||
Files: "tests/parallel/*.nim"
|
|
||||||
Files: "tests/parallel/*.cfg"
|
|
||||||
Files: "tests/parser/*.nim"
|
|
||||||
Files: "tests/pragmas/*.nim"
|
|
||||||
Files: "tests/proc/*.nim"
|
|
||||||
Files: "tests/procvar/*.nim"
|
|
||||||
Files: "tests/range/*.nim"
|
|
||||||
Files: "tests/rodfiles/*.nim"
|
|
||||||
Files: "tests/seq/*.nim"
|
|
||||||
Files: "tests/sets/*.nim"
|
|
||||||
Files: "tests/showoff/*.nim"
|
|
||||||
Files: "tests/specialops/*.nim"
|
|
||||||
Files: "tests/stdlib/*.nim"
|
|
||||||
Files: "tests/system/*.nim"
|
|
||||||
Files: "tests/template/*.nim"
|
|
||||||
Files: "tests/testament/*.nim"
|
|
||||||
Files: "tests/testdata/*.csv"
|
|
||||||
Files: "tests/testdata/*.html"
|
|
||||||
Files: "tests/testdata/*.json"
|
|
||||||
Files: "tests/testdata/*.txt"
|
|
||||||
Files: "tests/testdata/*.xml"
|
|
||||||
Files: "tests/threads/*.nim"
|
|
||||||
Files: "tests/threads/*.cfg"
|
|
||||||
Files: "tests/trmacros/*.nim"
|
|
||||||
Files: "tests/tuples/*.nim"
|
|
||||||
Files: "tests/typerel/*.nim"
|
|
||||||
Files: "tests/types/*.nim"
|
|
||||||
Files: "tests/usingstmt/*.nim"
|
|
||||||
Files: "tests/varres/*.nim"
|
|
||||||
Files: "tests/varstmt/*.nim"
|
|
||||||
Files: "tests/vm/*.nim"
|
|
||||||
Files: "tests/readme.txt"
|
|
||||||
Files: "tests/testament/css/*.css"
|
|
||||||
Files: "tests/testament/*.cfg"
|
|
||||||
Files: "lib/pure/unidecode/unidecode.dat"
|
|
||||||
|
|
||||||
[Windows]
|
[Windows]
|
||||||
Files: "bin/nim.exe"
|
Files: "bin/nim.exe"
|
||||||
|
|
|
||||||
4
koch.nim
4
koch.nim
|
|
@ -112,7 +112,7 @@ proc csource(args: string) =
|
||||||
|
|
||||||
proc bundleNimble() =
|
proc bundleNimble() =
|
||||||
if dirExists("dist/nimble/.git"):
|
if dirExists("dist/nimble/.git"):
|
||||||
exec("git --git-dir dist/nimble pull --rebase")
|
exec("git --git-dir dist/nimble/.git pull")
|
||||||
else:
|
else:
|
||||||
exec("git clone https://github.com/nim-lang/nimble.git dist/nimble")
|
exec("git clone https://github.com/nim-lang/nimble.git dist/nimble")
|
||||||
let tags = execProcess("git --git-dir dist/nimble/.git tag -l v*").splitLines
|
let tags = execProcess("git --git-dir dist/nimble/.git tag -l v*").splitLines
|
||||||
|
|
@ -121,7 +121,7 @@ proc bundleNimble() =
|
||||||
# now compile Nimble and copy it to $nim/bin for the installer.ini
|
# now compile Nimble and copy it to $nim/bin for the installer.ini
|
||||||
# to pick it up:
|
# to pick it up:
|
||||||
exec(findNim() & " c dist/nimble/src/nimble.nim")
|
exec(findNim() & " c dist/nimble/src/nimble.nim")
|
||||||
copyExe("dist/nimble/nimble".exe, "bin/nimble".exe)
|
copyExe("dist/nimble/src/nimble".exe, "bin/nimble".exe)
|
||||||
|
|
||||||
proc zip(args: string) =
|
proc zip(args: string) =
|
||||||
bundleNimble()
|
bundleNimble()
|
||||||
|
|
|
||||||
|
|
@ -202,23 +202,41 @@ proc parseCmdLine(c: var ConfigData) =
|
||||||
if c.infile.len == 0: quit(Usage)
|
if c.infile.len == 0: quit(Usage)
|
||||||
if c.mainfile.len == 0: c.mainfile = changeFileExt(c.infile, "nim")
|
if c.mainfile.len == 0: c.mainfile = changeFileExt(c.infile, "nim")
|
||||||
|
|
||||||
proc walkDirRecursively(s: var seq[string], root: string) =
|
proc ignoreFile(f, root: string, preventHtml: bool): bool =
|
||||||
|
let (_, name, ext) = splitFile(f)
|
||||||
|
let html = if preventHtml: ".html" else: ""
|
||||||
|
let explicit = splitPath(root).tail
|
||||||
|
result = (ext in ["", ".exe", ".idx"] or
|
||||||
|
ext == html or name[0] == '.') and f != explicit
|
||||||
|
|
||||||
|
proc walkDirRecursively(s: var seq[string], root: string,
|
||||||
|
preventHtml: bool) =
|
||||||
|
let tail = splitPath(root).tail
|
||||||
|
if tail == "nimcache" or tail[0] == '.':
|
||||||
|
return
|
||||||
|
let preventHtml = preventHtml or tail != "doc"
|
||||||
for k, f in walkDir(root):
|
for k, f in walkDir(root):
|
||||||
|
if f[0] == '.' and root[0] != '.':
|
||||||
|
discard "skip .git directories etc"
|
||||||
|
else:
|
||||||
case k
|
case k
|
||||||
of pcFile, pcLinkToFile: add(s, unixToNativePath(f))
|
of pcFile, pcLinkToFile:
|
||||||
of pcDir: walkDirRecursively(s, f)
|
if not ignoreFile(f, root, preventHtml):
|
||||||
|
add(s, unixToNativePath(f))
|
||||||
|
of pcDir:
|
||||||
|
walkDirRecursively(s, f, preventHtml)
|
||||||
of pcLinkToDir: discard
|
of pcLinkToDir: discard
|
||||||
|
|
||||||
proc addFiles(s: var seq[string], patterns: seq[string]) =
|
proc addFiles(s: var seq[string], patterns: seq[string]) =
|
||||||
for p in items(patterns):
|
for p in items(patterns):
|
||||||
if existsDir(p):
|
if existsDir(p):
|
||||||
walkDirRecursively(s, p)
|
walkDirRecursively(s, p, true)
|
||||||
else:
|
else:
|
||||||
var i = 0
|
var i = 0
|
||||||
for f in walkFiles(p):
|
for f in walkFiles(p):
|
||||||
if existsDir(f):
|
if existsDir(f):
|
||||||
walkDirRecursively(s, f)
|
walkDirRecursively(s, f, false)
|
||||||
else:
|
elif not ignoreFile(f, p, false):
|
||||||
add(s, unixToNativePath(f))
|
add(s, unixToNativePath(f))
|
||||||
inc(i)
|
inc(i)
|
||||||
if i == 0: echo("[Warning] No file found that matches: " & p)
|
if i == 0: echo("[Warning] No file found that matches: " & p)
|
||||||
|
|
@ -613,6 +631,7 @@ proc xzDist(c: var ConfigData) =
|
||||||
let nimbleFile = c.nimblePkgName & ".nimble"
|
let nimbleFile = c.nimblePkgName & ".nimble"
|
||||||
processFile(z, proj / nimbleFile, nimbleFile)
|
processFile(z, proj / nimbleFile, nimbleFile)
|
||||||
|
|
||||||
|
when true:
|
||||||
let oldDir = getCurrentDir()
|
let oldDir = getCurrentDir()
|
||||||
setCurrentDir(tmpDir)
|
setCurrentDir(tmpDir)
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue