From beaf754ea2eb644061322886d629740856492517 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 9 Jul 2018 19:08:38 +0100 Subject: [PATCH 1/8] HMBXR5601-328 - Use make instead of eclipsebuild --- compile/eclipsebuild/eclipseds5build.gsh | 55 ++++++++++++++++++++---- 1 file changed, 46 insertions(+), 9 deletions(-) diff --git a/compile/eclipsebuild/eclipseds5build.gsh b/compile/eclipsebuild/eclipseds5build.gsh index 5acc0ae..16854b7 100644 --- a/compile/eclipsebuild/eclipseds5build.gsh +++ b/compile/eclipsebuild/eclipseds5build.gsh @@ -1,37 +1,44 @@ -def doExport(exportfolder, exportpathlist, build_variant = "") { +def doExport(exportfolder, exportpathlist, build_variant = "", project_root = "") { for (exportpath in exportpathlist) { echo "Export path at: ${exportpath}" + env.srcFile = "${WORKSPACE}/${exportpath}" script { echo "Build variant is ${build_variant}" if (build_variant) { echo "Build variant is ${build_variant}" env.destFolder = "${exportfolder}/${build_variant}/${project}" - env.srcFile = "${WORKSPACE}/${exportpath}" - env.srcFileExpanded = srcFile.replace("-BUILDVARIANT-", "${build_variant}") + env.srcFile = srcFile.replace("-BUILDVARIANT-", "${build_variant}") } else { echo "No build variant" env.destFolder = "${exportfolder}/${project}" - env.srcFileExpanded = "${WORKSPACE}/${exportpath}" + } + echo "Project root is ${project_root}" + if (project_root) { + echo "Project root is ${project_root}" + env.srcFile = srcFile.replace("-PROJECTROOT-", "${project_root}") + } + else { + echo "No project root" } } dir (env.destFolder) { - echo "Copy \"${srcFileExpanded}\" to \"${destFolder}\"" + echo "Copy \"${srcFile}\" to \"${destFolder}\"" if (isUnix()) { - sh "cp -v \"${srcFileExpanded}\" \"${destFolder}\"" + sh "cp -v \"${srcFile}\" \"${destFolder}\"" } else { - bat 'copy \"%srcFileExpanded%\" \"%destFolder%\"' + bat 'copy \"%srcFile%\" \"%destFolder%\"' } } } } -// Build and export files +// Build and export files using Eclipse project files (unreliable) def doBuild(apps, exportfolder = "${WORKSPACE}/bin") { for (appInfo in apps ) { - (build, cleanbuild, project, variants, exportpathlist) = appInfo + (build, cleanbuild, project, projectroot, variants, exportpathlist) = appInfo if (build) { if (cleanbuild) { buildtype = "-cleanBuild" @@ -63,4 +70,34 @@ def doBuild(apps, exportfolder = "${WORKSPACE}/bin") { } } +// Build and export files using make files generated by Eclipse +def doMake(apps, exportfolder = "${WORKSPACE}/bin") { + for (appInfo in apps ) { + (build, cleanbuild, project, projectroot, variants, exportpathlist) = appInfo + if (build) { + for (build_variant in variants) { + echo "Changing directory to: ${WORKSPACE}/${projectroot}/${build_variant}" + dir("${WORKSPACE}/${projectroot}/${build_variant}") { + echo "Build command: ${BUILD_COMMAND}" + if (isUnix()) { + sh "${BUILD_COMMAND}" + } + else { + bat """ + "%BUILD_COMMAND%" + """ + } + } + doExport(exportfolder, exportpathlist, build_variant, projectroot) + } + } + else { + // Only export if the project has no variants - signifying that there are files to export which have been prebuilt + if (!variants) { + doExport(exportfolder, exportpathlist) + } + } + } +} + return this; From c902757cc8becc57849a537b6d0e5e3216d98e4e Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 9 Jul 2018 19:17:33 +0100 Subject: [PATCH 2/8] HMBXR5601-328 - Use make instead of eclipsebuild --- compile/eclipsebuild/eclipseds5build.gsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compile/eclipsebuild/eclipseds5build.gsh b/compile/eclipsebuild/eclipseds5build.gsh index 16854b7..73c15a3 100644 --- a/compile/eclipsebuild/eclipseds5build.gsh +++ b/compile/eclipsebuild/eclipseds5build.gsh @@ -73,7 +73,7 @@ def doBuild(apps, exportfolder = "${WORKSPACE}/bin") { // Build and export files using make files generated by Eclipse def doMake(apps, exportfolder = "${WORKSPACE}/bin") { for (appInfo in apps ) { - (build, cleanbuild, project, projectroot, variants, exportpathlist) = appInfo + (build, cleanbuild, project, variants, projectroot, exportpathlist) = appInfo if (build) { for (build_variant in variants) { echo "Changing directory to: ${WORKSPACE}/${projectroot}/${build_variant}" From 1869a40da9c9211225b68cc372e835149d588dad Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 10 Jul 2018 12:53:34 +0100 Subject: [PATCH 3/8] Revert "HMBXR5601-328 - Use make instead of eclipsebuild" This reverts commit 5e1e0c9d47cfaa4c366b84da4f8a583c93ae9693. --- compile/eclipsebuild/eclipseds5build.gsh | 55 ++++-------------------- 1 file changed, 9 insertions(+), 46 deletions(-) diff --git a/compile/eclipsebuild/eclipseds5build.gsh b/compile/eclipsebuild/eclipseds5build.gsh index 73c15a3..5acc0ae 100644 --- a/compile/eclipsebuild/eclipseds5build.gsh +++ b/compile/eclipsebuild/eclipseds5build.gsh @@ -1,44 +1,37 @@ -def doExport(exportfolder, exportpathlist, build_variant = "", project_root = "") { +def doExport(exportfolder, exportpathlist, build_variant = "") { for (exportpath in exportpathlist) { echo "Export path at: ${exportpath}" - env.srcFile = "${WORKSPACE}/${exportpath}" script { echo "Build variant is ${build_variant}" if (build_variant) { echo "Build variant is ${build_variant}" env.destFolder = "${exportfolder}/${build_variant}/${project}" - env.srcFile = srcFile.replace("-BUILDVARIANT-", "${build_variant}") + env.srcFile = "${WORKSPACE}/${exportpath}" + env.srcFileExpanded = srcFile.replace("-BUILDVARIANT-", "${build_variant}") } else { echo "No build variant" env.destFolder = "${exportfolder}/${project}" - } - echo "Project root is ${project_root}" - if (project_root) { - echo "Project root is ${project_root}" - env.srcFile = srcFile.replace("-PROJECTROOT-", "${project_root}") - } - else { - echo "No project root" + env.srcFileExpanded = "${WORKSPACE}/${exportpath}" } } dir (env.destFolder) { - echo "Copy \"${srcFile}\" to \"${destFolder}\"" + echo "Copy \"${srcFileExpanded}\" to \"${destFolder}\"" if (isUnix()) { - sh "cp -v \"${srcFile}\" \"${destFolder}\"" + sh "cp -v \"${srcFileExpanded}\" \"${destFolder}\"" } else { - bat 'copy \"%srcFile%\" \"%destFolder%\"' + bat 'copy \"%srcFileExpanded%\" \"%destFolder%\"' } } } } -// Build and export files using Eclipse project files (unreliable) +// Build and export files def doBuild(apps, exportfolder = "${WORKSPACE}/bin") { for (appInfo in apps ) { - (build, cleanbuild, project, projectroot, variants, exportpathlist) = appInfo + (build, cleanbuild, project, variants, exportpathlist) = appInfo if (build) { if (cleanbuild) { buildtype = "-cleanBuild" @@ -70,34 +63,4 @@ def doBuild(apps, exportfolder = "${WORKSPACE}/bin") { } } -// Build and export files using make files generated by Eclipse -def doMake(apps, exportfolder = "${WORKSPACE}/bin") { - for (appInfo in apps ) { - (build, cleanbuild, project, variants, projectroot, exportpathlist) = appInfo - if (build) { - for (build_variant in variants) { - echo "Changing directory to: ${WORKSPACE}/${projectroot}/${build_variant}" - dir("${WORKSPACE}/${projectroot}/${build_variant}") { - echo "Build command: ${BUILD_COMMAND}" - if (isUnix()) { - sh "${BUILD_COMMAND}" - } - else { - bat """ - "%BUILD_COMMAND%" - """ - } - } - doExport(exportfolder, exportpathlist, build_variant, projectroot) - } - } - else { - // Only export if the project has no variants - signifying that there are files to export which have been prebuilt - if (!variants) { - doExport(exportfolder, exportpathlist) - } - } - } -} - return this; From aff5898578ed7fe931d7ca03a9c000630551f136 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 10 Jul 2018 18:25:03 +0100 Subject: [PATCH 4/8] Seperate DS5 shell command from build command --- compile/eclipsebuild/eclipseds5build.gsh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/compile/eclipsebuild/eclipseds5build.gsh b/compile/eclipsebuild/eclipseds5build.gsh index 5acc0ae..347f723 100644 --- a/compile/eclipsebuild/eclipseds5build.gsh +++ b/compile/eclipsebuild/eclipseds5build.gsh @@ -43,11 +43,14 @@ def doBuild(apps, exportfolder = "${WORKSPACE}/bin") { retry(3) { // Eclipse occasionally raises exceptions (rather than the builds failing) echo "Build command: ${BUILD_COMMAND} ${buildtype} \"${project}/${build_variant}\"" if (isUnix()) { - sh "${BUILD_COMMAND} ${buildtype} \"${project}/${build_variant}\"" + ${DS5SHELL} \'${BUILD_COMMAND} -no-indexer -importAll "${SOURCE_PATH}"\' + sh """ + ${DS5SHELL} \'${BUILD_COMMAND} ${buildtype} \"${project}/${build_variant}\"\' + """ } else { bat """ - "%BUILD_COMMAND%" ${buildtype} "${project}\\${build_variant}" + "%DS5SHELL%" "%BUILD_COMMAND%" ${buildtype} "${project}\\${build_variant}" """ } } From fbb99a88e76ff545e81e5957e6d9f7f507de7bb7 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 10 Jul 2018 18:26:56 +0100 Subject: [PATCH 5/8] Seperate DS5 shell command from build command --- compile/eclipsebuild/eclipseds5build.gsh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compile/eclipsebuild/eclipseds5build.gsh b/compile/eclipsebuild/eclipseds5build.gsh index 347f723..35ea90c 100644 --- a/compile/eclipsebuild/eclipseds5build.gsh +++ b/compile/eclipsebuild/eclipseds5build.gsh @@ -43,9 +43,8 @@ def doBuild(apps, exportfolder = "${WORKSPACE}/bin") { retry(3) { // Eclipse occasionally raises exceptions (rather than the builds failing) echo "Build command: ${BUILD_COMMAND} ${buildtype} \"${project}/${build_variant}\"" if (isUnix()) { - ${DS5SHELL} \'${BUILD_COMMAND} -no-indexer -importAll "${SOURCE_PATH}"\' sh """ - ${DS5SHELL} \'${BUILD_COMMAND} ${buildtype} \"${project}/${build_variant}\"\' + \"${DS5SHELL}\" \'${BUILD_COMMAND} ${buildtype} \"${project}/${build_variant}\"\' """ } else { From 8005e0d3c6709b67499fd4c43bb41f1a25ac837a Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 10 Jul 2018 18:37:18 +0100 Subject: [PATCH 6/8] Seperate DS5 shell command from build command --- compile/eclipsebuild/eclipseds5build.gsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compile/eclipsebuild/eclipseds5build.gsh b/compile/eclipsebuild/eclipseds5build.gsh index 35ea90c..bbd17af 100644 --- a/compile/eclipsebuild/eclipseds5build.gsh +++ b/compile/eclipsebuild/eclipseds5build.gsh @@ -41,7 +41,7 @@ def doBuild(apps, exportfolder = "${WORKSPACE}/bin") { } for (build_variant in variants) { retry(3) { // Eclipse occasionally raises exceptions (rather than the builds failing) - echo "Build command: ${BUILD_COMMAND} ${buildtype} \"${project}/${build_variant}\"" + echo "Build command: \"${DS5SHELL}\" \'${BUILD_COMMAND} ${buildtype} \"${project}/${build_variant}\"\'" if (isUnix()) { sh """ \"${DS5SHELL}\" \'${BUILD_COMMAND} ${buildtype} \"${project}/${build_variant}\"\' From 804a86aeaababbacdab5cbab7484f40891404ec4 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 10 Jul 2018 19:24:34 +0100 Subject: [PATCH 7/8] Seperate DS5 shell command from build command --- compile/eclipsebuild/eclipseds5build.gsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compile/eclipsebuild/eclipseds5build.gsh b/compile/eclipsebuild/eclipseds5build.gsh index bbd17af..6c121e3 100644 --- a/compile/eclipsebuild/eclipseds5build.gsh +++ b/compile/eclipsebuild/eclipseds5build.gsh @@ -41,10 +41,10 @@ def doBuild(apps, exportfolder = "${WORKSPACE}/bin") { } for (build_variant in variants) { retry(3) { // Eclipse occasionally raises exceptions (rather than the builds failing) - echo "Build command: \"${DS5SHELL}\" \'${BUILD_COMMAND} ${buildtype} \"${project}/${build_variant}\"\'" + echo "Build command: ${DS5SHELL} \'${BUILD_COMMAND} ${buildtype} \"${project}/${build_variant}\"\'" if (isUnix()) { sh """ - \"${DS5SHELL}\" \'${BUILD_COMMAND} ${buildtype} \"${project}/${build_variant}\"\' + ${DS5SHELL} \'${BUILD_COMMAND} ${buildtype} \"${project}/${build_variant}\"\' """ } else { From fd7b0486cf076532cf5fec95b326c321d2ea2ce0 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 10 Jul 2018 23:27:58 +0100 Subject: [PATCH 8/8] Parameterise eclipse project build retries --- compile/eclipsebuild/eclipseds5build.gsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compile/eclipsebuild/eclipseds5build.gsh b/compile/eclipsebuild/eclipseds5build.gsh index 6c121e3..b5f4e16 100644 --- a/compile/eclipsebuild/eclipseds5build.gsh +++ b/compile/eclipsebuild/eclipseds5build.gsh @@ -40,7 +40,7 @@ def doBuild(apps, exportfolder = "${WORKSPACE}/bin") { buildtype = "-build" } for (build_variant in variants) { - retry(3) { // Eclipse occasionally raises exceptions (rather than the builds failing) + retry(maxprojectbuildretries) { // Eclipse occasionally raises exceptions (rather than the builds failing) echo "Build command: ${DS5SHELL} \'${BUILD_COMMAND} ${buildtype} \"${project}/${build_variant}\"\'" if (isUnix()) { sh """