Disable parallel builds; Retry build if copy fails

This commit is contained in:
Dan Hawkins 2018-09-08 18:48:54 +01:00
commit 4022e1d35a
2 changed files with 29 additions and 7 deletions

View file

@ -0,0 +1,12 @@
// Disable parallel make builds - which may be causing autobuild issues
def doDisableParallelMake(rootSearchFolder = "${WORKSPACE}") {
if (isUnix()) {
sh """
# Looks for "<builder*parallelBuildOn="true"* in all .cproject files and replaces the "true" with "false"
find "${rootSearchFolder}" -iname ".cproject" | xargs -iXX sed -i "%s@\(<builder.*parallelBuildOn=\"\)true\(\"\)@\1false\2@g" XX
"""
}
}
return this;

View file

@ -1,5 +1,6 @@
def doExport(exportfolder, exportpathlist, build_variant = "") {
def result = 0
for (exportpath in exportpathlist) {
echo "Export path at: ${exportpath}"
script {
@ -19,19 +20,28 @@ def doExport(exportfolder, exportpathlist, build_variant = "") {
dir (env.destFolder) {
echo "Copy \"${srcFileExpanded}\" to \"${destFolder}\""
if (isUnix()) {
sh """
result = sh( script: """
cp -r -v "${srcFileExpanded}" "${destFolder}"
if [ \$? -ne 0 ]; then exit 1; fi
"""
""",
returnStatus: true
)
if (result != 0) {
return result
}
}
else {
bat '''
result = bat( script: '''
copy \"%srcFileExpanded%\" \"%destFolder%\"
if errorlevel 1 exit /b 1
'''
''',
returnStatus: true
)
if (result != 0) {
return result
}
}
}
}
return result
}
// Build and export files
@ -58,8 +68,8 @@ def doBuild(apps, exportfolder = "${WORKSPACE}/bin") {
"%DS5SHELL%" "%BUILD_COMMAND%" ${buildtype} "${project}\\${build_variant}"
"""
}
doExport(exportfolder, exportpathlist, build_variant)
}
doExport(exportfolder, exportpathlist, build_variant)
}
}
else {