diff options
Diffstat (limited to 'tests/manyloc/nake/nakefile.nim')
-rw-r--r-- | tests/manyloc/nake/nakefile.nim | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/tests/manyloc/nake/nakefile.nim b/tests/manyloc/nake/nakefile.nim index 2055d7834..fc479a5c2 100644 --- a/tests/manyloc/nake/nakefile.nim +++ b/tests/manyloc/nake/nakefile.nim @@ -10,7 +10,7 @@ const ExeName = "keineschweine" ServerDefines = "-d:NoSFML -d:NoChipmunk" TestBuildDefines = "-d:escapeMenuTest -d:debugWeps -d:showFPS -d:moreNim -d:debugKeys -d:foo -d:recordMode --forceBuild" - ReleaseDefines = "-d:release --deadCodeElim:on" + ReleaseDefines = "-d:release" ReleaseTestDefines = "-d:debugWeps -d:debugKeys --forceBuild" task "testprofile", "..": @@ -29,11 +29,12 @@ task "test2", "Build release test build test release build": if shell("nim", ReleaseDefines, ReleaseTestDefines, "compile", ExeName) == 0: shell "."/ExeName -discard """task "dirserver", "build the directory server": - withDir "server": - if shell("nim", ServerDefines, "compile", "dirserver") != 0: - echo "Failed to build the dirserver" - quit 1""" +when false: + task "dirserver", "build the directory server": + withDir "server": + if shell("nim", ServerDefines, "compile", "dirserver") != 0: + echo "Failed to build the dirserver" + quit 1 task "zoneserver", "build the zone server": withDir "enet_server": @@ -63,7 +64,7 @@ task "release", "release build": ## zip up all the files and such or something useful here task "testskel", "create skeleton test dir for testing": - let dirname = "test-"& $random(5000) + let dirname = "test-" & $rand(5000) removeDir dirName createDir dirName/"data/fnt" copyFile "data/fnt/LiberationMono-Regular", dirName/"data/fnt/LiberationMono-Regular.ttf" @@ -76,19 +77,20 @@ task "testskel", "create skeleton test dir for testing": task "clean", "cleanup generated files": var dirs = @["nimcache", "server"/"nimcache"] - dirs.map(proc(x: var string) = - if existsDir(x): removeDir(x)) + dirs.apply(proc(x: var string) = + if dirExists(x): removeDir(x)) task "download", "download game assets": var skipAssets = false path = expandFilename("data") + client = newHttpClient() path.add DirSep path.add(extractFilename(GameAssets)) - if existsFile(path): + if fileExists(path): echo "The file already exists\n", "[R]emove [M]ove [Q]uit [S]kip Source: ", GameAssets - case stdin.readLine.toLower + case stdin.readLine.toLowerAscii of "r": removeFile path of "m": @@ -101,7 +103,7 @@ task "download", "download game assets": echo "Downloading from ", GameAssets if not skipAssets: echo "Downloading to ", path - downloadFile GameAssets, path + client.downloadFile(GameAssets, path) echo "Download finished" let targetDir = parentDir(parentDir(path)) @@ -120,19 +122,19 @@ task "download", "download game assets": echo "Download binary libs? Only libs for linux are available currently, enjoy the irony.\n", "[Y]es [N]o Source: ", BinLibs - case stdin.readline.toLower + case stdin.readline.toLowerAscii of "y", "yes": discard ## o_O else: return path = extractFilename(BinLibs) - downloadFile BinLibs, path + client.downloadFile(BinLibs, path) echo "Downloaded dem libs ", path when true: echo "Unpack it yourself, sorry." else: ## this crashes, dunno why var z: TZipArchive - destDir = getCurrentDir()/("unzip"& $random(5000)) + destDir = getCurrentDir()/("unzip" & $rand(5000)) if not z.open(path, fmRead): echo "Could not open zip, bad download?" return |