1
0
forked from 0ad/0ad

Fix removal of added files for macOS and Windows.

Don't display Debug: and Release: if no message was printed.

This was SVN commit r26101.
This commit is contained in:
Stan 2021-12-23 15:10:16 +00:00
parent 6b7541cec5
commit e7cc6117ce
2 changed files with 27 additions and 20 deletions

View File

@ -35,7 +35,7 @@ pipeline {
steps {
script {
try {
svn "https://svn.wildfiregames.com/public/ps/trunk"
sh "svn update"
} catch(e) {
sh "svn cleanup"
sleep 300
@ -51,8 +51,10 @@ pipeline {
try {
sh "arc patch --diff ${params.DIFF_ID} --force"
} catch (e) {
sh "svn st binaries/data/ | cut -c 9- | xargs rm -rfv"
sh "svn st source/ | cut -c 9- | xargs rm -rfv"
sh "svn st -q | cut -c 9- | xargs rm -rfv"
sh "svn revert -R ."
sh "svn st | cut -c 9- | xargs rm -rf"
sh "arc patch --diff ${params.DIFF_ID} --force"
}
}
@ -112,10 +114,10 @@ pipeline {
catchError {
sh '''
for file in builderr-*.txt ; do
if [ -s "$file" ]; then
echo "$file" >> .phabricator-comment
cat "$file" >> .phabricator-comment
fi
if [ -s "$file" ]; then
echo "$file" >> .phabricator-comment
cat "$file" >> .phabricator-comment
fi
done
'''
}
@ -130,9 +132,10 @@ pipeline {
throw e
} finally {
sh "rm -f .phabricator-comment builderr-*.txt cxxtest-*.xml"
sh "svn st binaries/data/ | cut -c 9- | xargs rm -rfv"
sh "svn st source/ | cut -c 9- | xargs rm -rfv"
sh "svn st -q | cut -c 9- | xargs rm -rfv"
sh "svn revert -R ."
sh "svn st binaries/data/ | cut -c 9- | xargs rm -rf"
sh "svn st source/ | cut -c 9- | xargs rm -rf"
}
}
}

View File

@ -18,6 +18,13 @@
// This pipeline is used to build patches on MSVC 15.0 (Visual Studio 2017).
def jobs = "2"
def visualStudioPath = "\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\MSBuild\\15.0\\Bin\\MSBuild.exe\""
def cleanFiles() {
bat 'powershell.exe "svn st -q | ForEach-Object { Remove-Item -ErrorAction Ignore -Recurse -Force -Verbose -LiteralPath $_.substring(8) } " '
bat 'powershell.exe "svn st binaries/data | ForEach-Object { Remove-Item -ErrorAction Ignore -Recurse -Verbose -Force -LiteralPath $_.substring(8) } " '
bat 'powershell.exe "svn st source/ | ForEach-Object { Remove-Item -ErrorAction Ignore -Recurse -Force -Verbose -LiteralPath $_.substring(8) } " '
bat 'svn revert -R .'
}
pipeline {
agent { label 'WindowsSlave' }
options {
@ -51,10 +58,9 @@ pipeline {
steps {
script {
try {
bat "arc patch --diff ${params.DIFF_ID} --force"
bat "arc patch --diff ${params.DIFF_ID} --force"
} catch (e) {
bat 'svn revert -R .'
bat 'powershell.exe "svn st --no-ignore | %% {$_.substring(8)} | del -r" '
cleanFiles()
bat "arc patch --diff ${params.DIFF_ID} --force"
}
}
@ -62,15 +68,15 @@ pipeline {
}
stage ('Update-Workspace') {
steps {
bat "(robocopy /MIR C:\\wxwidgets3.0.4\\lib libraries\\win32\\wxwidgets\\lib) ^& IF %ERRORLEVEL% LEQ 1 exit 0"
bat "(robocopy /MIR C:\\wxwidgets3.0.4\\include libraries\\win32\\wxwidgets\\include) ^& IF %ERRORLEVEL% LEQ 1 exit 0"
bat "(robocopy /MIR /NDL /NJH /NJS /NP /NS /NC C:\\wxwidgets3.0.4\\lib libraries\\win32\\wxwidgets\\lib) ^& IF %ERRORLEVEL% LEQ 1 exit 0"
bat "(robocopy /MIR /NDL /NJH /NJS /NP /NS /NC C:\\wxwidgets3.0.4\\include libraries\\win32\\wxwidgets\\include) ^& IF %ERRORLEVEL% LEQ 1 exit 0"
bat "cd build\\workspaces && update-workspaces.bat --atlas --build-shared-glooxwrapper --jenkins-tests"
}
}
stage ('Debug: Build') {
steps {
dir('build\\workspaces\\vs2017'){
bat("\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\MSBuild\\15.0\\Bin\\MSBuild.exe\" pyrogenesis.sln /p:XPDeprecationWarning=false /m:${jobs} /p:PlatformToolset=v141_xp /t:pyrogenesis /t:AtlasUI /t:test /p:Configuration=Debug -clp:Warningsonly -clp:ErrorsOnly > ..\\..\\..\\build-errors-debug.txt 2>&1")
bat("${visualStudioPath} pyrogenesis.sln /nologo /p:XPDeprecationWarning=false /m:${jobs} /p:PlatformToolset=v141_xp /t:pyrogenesis /t:AtlasUI /t:test /p:Configuration=Debug -clp:Warningsonly -clp:ErrorsOnly > ..\\..\\..\\build-errors-debug.txt 2>&1")
}
}
post {
@ -106,7 +112,7 @@ pipeline {
stage ('Release: Build') {
steps {
dir('build\\workspaces\\vs2017'){
bat("\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\MSBuild\\15.0\\Bin\\MSBuild.exe\" pyrogenesis.sln /p:XPDeprecationWarning=false /m:${jobs} /p:PlatformToolset=v141_xp /t:pyrogenesis /t:AtlasUI /t:test /p:Configuration=Release -clp:Warningsonly -clp:ErrorsOnly > ..\\..\\..\\build-errors-release.txt 2>&1")
bat("${visualStudioPath} pyrogenesis.sln /nologo /p:XPDeprecationWarning=false /m:${jobs} /p:PlatformToolset=v141_xp /t:pyrogenesis /t:AtlasUI /t:test /p:Configuration=Release -clp:Warningsonly -clp:ErrorsOnly > ..\\..\\..\\build-errors-release.txt 2>&1")
}
}
post {
@ -136,9 +142,9 @@ pipeline {
always {
script {
catchError {
bat "if exist build-errors-debug.txt echo Debug: >> .phabricator-comment"
bat 'powershell.exe "if (![String]::IsNullOrWhiteSpace((Get-Content -ErrorAction Ignore -Path build-errors-debug.txt))) { Add-Content .phabricator-comment Debug: }" '
bat "if exist build-errors-debug.txt type build-errors-debug.txt >> .phabricator-comment"
bat "if exist build-errors-release.txt echo Release: >> .phabricator-comment"
bat 'powershell.exe "if (![String]::IsNullOrWhiteSpace((Get-Content -ErrorAction Ignore -Path build-errors-release.txt))) { Add-Content .phabricator-comment Release: }" '
bat "if exist build-errors-release.txt type build-errors-release.txt >> .phabricator-comment"
}
try {
@ -153,9 +159,7 @@ pipeline {
bat 'del build-errors-debug.txt'
bat 'del build-errors-release.txt'
bat 'del cxxtest_*.xml'
bat 'svn revert -R .'
bat 'powershell.exe "svn st binaries/data | %% {$_.substring(8)} | del -r " '
bat 'powershell.exe "svn st source/ | %% {$_.substring(8)} | del -r " '
cleanFiles()
}
}
}