Now that the build has become reliable - remove some debug; Refactor clean up and build set up

This commit is contained in:
Dan Hawkins 2018-09-15 13:42:44 +01:00
commit cd889893dd

View file

@ -60,20 +60,30 @@ def doExport(exportfolder, exportpathlist, project = "", build_variant = "") {
return result
}
// Build and export files
// Register toolchain
def doRegisterToolchain(ds5folder, toolchainfolder) {
// Register toolchain (if it is not already)
if (isUnix()) {
sh """
"${ds5folder}/bin/add_toolchain" --non-interactive "${toolchainfolder}"
"""
env.PATH = env.TOOLCHAIN_FOLDER + ":" + env.PATH
}
else {
bat """
"%ds5folder%\\bin\\add_toolchain" --non-interactive "%toolchainfolder%"
"""
env.PATH = env.TOOLCHAIN_FOLDER + ";" + env.PATH
}
echo "Path is: ${PATH}"
}
// Add toolchain to path
def addToolchainPath(toolchainfolder) {
// Register toolchain (if it is not already)
if (isUnix()) {
env.PATH = toolchainfolder + ":" + env.PATH
}
else {
env.PATH = toolchainfolder + ";" + env.PATH
}
echo "Path is: ${PATH}"
}
@ -81,7 +91,7 @@ def doRegisterToolchain(ds5folder, toolchainfolder) {
// Build and export files
def doBuild(apps, ds5folder, toolchainfolder, ds5shellcommand, buildcommand, exportfolder = "${WORKSPACE}/bin") {
doKillLeftovers()
doRegisterToolchain(ds5folder, toolchainfolder)
addToolchainPath(toolchainfolder)
for (appInfo in apps ) {
(build, cleanbuild, project, variants, exportpathlist) = appInfo
if (build) {
@ -93,6 +103,7 @@ def doBuild(apps, ds5folder, toolchainfolder, ds5shellcommand, buildcommand, exp
}
for (build_variant in variants) {
retry(maxprojectbuildretries) { // Eclipse occasionally raises exceptions (rather than the builds failing)
doRegisterToolchain(ds5folder, toolchainfolder)
echo "Build command: ${ds5shellcommand} \'${buildcommand} ${buildtype} \"${project}/${build_variant}\"\'"
if (isUnix()) {
sh """