Enable Travis folding in winrelease (#10528)

This commit is contained in:
genotrance
2019-02-02 06:26:32 -06:00
committed by Andreas Rumpf
parent ad4e3fd28c
commit 07553034de
2 changed files with 21 additions and 12 deletions

View File

@@ -373,9 +373,10 @@ proc winReleaseArch(arch: string) =
withMingw r"..\mingw" & arch & r"\bin":
# Rebuilding koch is necessary because it uses its pointer size to
# determine which mingw link to put in the NSIS installer.
nimexec "c --cpu:$# koch" % cpu
kochExec "boot -d:release --cpu:$#" % cpu
kochExec "--latest zip -d:release"
inFold "winrelease koch":
nimexec "c --cpu:$# koch" % cpu
kochExecFold("winrelease boot", "boot -d:release --cpu:$#" % cpu)
kochExecFold("winrelease zip", "--latest zip -d:release")
overwriteFile r"build\nim-$#.zip" % VersionAsString,
r"web\upload\download\nim-$#_x$#.zip" % [VersionAsString, arch]
@@ -384,13 +385,16 @@ proc winRelease*() =
# anymore!
# Build -docs file:
when true:
buildDocs(gaCode)
inFold "winrelease buildDocs":
buildDocs(gaCode)
withDir "web/upload/" & VersionAsString:
exec "7z a -tzip docs-$#.zip *.html" % VersionAsString
inFold "winrelease zipdocs":
exec "7z a -tzip docs-$#.zip *.html" % VersionAsString
overwriteFile "web/upload/$1/docs-$1.zip" % VersionAsString,
"web/upload/download/docs-$1.zip" % VersionAsString
when true:
csource("-d:release")
inFold "winrelease csource":
csource("-d:release")
when sizeof(pointer) == 4:
winReleaseArch "32"
when sizeof(pointer) == 8:

View File

@@ -25,7 +25,6 @@ proc findNim*(): string =
# 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:
@@ -38,14 +37,20 @@ proc exec*(cmd: string, errorcode: int = QuitFailure, additionalPath = "") =
if execShellCmd(cmd) != 0: quit("FAILURE", errorcode)
putEnv("PATH", prevPath)
template inFold*(desc, body) =
if existsEnv("TRAVIS"):
echo "travis_fold:start:" & desc.replace(" ", "_")
body
if existsEnv("TRAVIS"):
echo "travis_fold:end:" & desc.replace(" ", "_")
proc execFold*(desc, cmd: string, errorcode: int = QuitFailure, additionalPath = "") =
## Execute shell command. Add log folding on Travis CI.
# https://github.com/travis-ci/travis-ci/issues/2285#issuecomment-42724719
if existsEnv("TRAVIS"):
echo "travis_fold:start:" & desc.replace(" ", "_")
exec(cmd, errorcode, additionalPath)
if existsEnv("TRAVIS"):
echo "travis_fold:end:" & desc.replace(" ", "_")
inFold(desc):
exec(cmd, errorcode, additionalPath)
proc execCleanPath*(cmd: string,
additionalPath = ""; errorcode: int = QuitFailure) =