From dc35fbbff6320cd927c9beba6ce595c2fcf7612b Mon Sep 17 00:00:00 2001 From: Christos Spirotis Date: Fri, 20 Mar 2020 07:38:56 +0000 Subject: [PATCH 01/44] Adding files for autobuild --- compile/eclipsebuild/eclipseSTM8build.groovy | 180 +++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 compile/eclipsebuild/eclipseSTM8build.groovy diff --git a/compile/eclipsebuild/eclipseSTM8build.groovy b/compile/eclipsebuild/eclipseSTM8build.groovy new file mode 100644 index 0000000..592483a --- /dev/null +++ b/compile/eclipsebuild/eclipseSTM8build.groovy @@ -0,0 +1,180 @@ +def doDisplayLeftovers() { +} + +def doKillLeftovers() { +} + +def doCheck(checkpathlist, build_variant = "") { + def result = 0 + for (checkpath in checkpathlist) { + echo "Checking file at: ${checkpath}" + script { + echo "Build variant is ${build_variant}" + if (build_variant) { + def srcFile = "${WORKSPACE}\${checkpath}" + def srcFileExpanded = srcFile.replace("-BUILDVARIANT-", "${build_variant}") + // Print out dependencies of the built file + echo "Showing dependencies of ${srcFileExpanded}" + if (srcFileExpanded.endsWith(".elf")) { + result = bat ( script: """ + ${CYGWINDIR}/bin/readelf -hS ${srcFileExpanded} + if errorlevel 1 EXIT /b 1 + """, + returnStatus: true + ) + } + else if (srcFileExpanded.endsWith(".stm8bin")) { + result = bat ( script: """ + ${COSMICDIR}/cobj -hs ${srcFileExpanded} + if errorlevel 1 EXIT /b 1 + """, + returnStatus: true + ) + } + if (result != 0) { + return result + } + } + } + } + return result +} + +def doExport(exportfolder, exportpathlist, partdest = "", build_variant = "") { + def result = 0 + def destFolder = "" + def srcFile = "" + def srcFileExpanded = "" + for (exportpath in exportpathlist) { + echo "Export path at: ${exportpath}" + script { + if (build_variant) { + echo "Build variant is ${build_variant}" + srcFile = "${WORKSPACE}\\${exportpath}" + srcFileExpanded = srcFile.replace("-BUILDVARIANT-", "${build_variant}") + } + else { + echo "No build variant" + srcFileExpanded = "${WORKSPACE}\\${exportpath}" + } + destFolder = "${exportfolder}" + if (partdest) { + destFolder += "\\" + partdest + } + } + def destFolderExpanded = destFolder.replace("-BUILDVARIANT-", "${build_variant}") + dir (destFolderExpanded) { + echo "Copy \"${srcFileExpanded}\" to \"${destFolderExpanded}\"" + result = bat( script: """ + copy "${srcFileExpanded}" "${destFolderExpanded}" + if errorlevel 1 EXIT /b 1 + """, + returnStatus: true + ) + if (result != 0) { + return result + } + } + } + return result +} + +// Import all eclipse projects in a given folder +def doImportProjects(ds5folder, ds5shellcommand, buildcommand, sourcefolder) { + bat """ + "${ds5shellcommand}" ${buildcommand} -no-indexer -importAll "${sourcefolder}" + """ +} + +def doBuildAndExportProject(String ds5folder, String ds5shellcommand, String buildcommand, String project, Boolean doexport, variants, String exportfolder, exportpathlist, String destpart) { + echo "Doing build and export project: ${project} : ${doexport}" + for (build_variant in variants) { + retry(maxprojectbuildretries) { // Eclipse occasionally raises exceptions (rather than the builds failing) + try { + if (toBuild.contains(build_variant)) { + doDisplayLeftovers() + echo "Build command: ${ds5shellcommand} \'${buildcommand} -no-indexer -build ${project}/${build_variant}\'" + timeout(time: 20, unit: 'MINUTES') { + bat """ + "${ds5shellcommand}" ${buildcommand} -no-indexer -build ${project}/${build_variant} + """ + } + result = doCheck(exportpathlist, build_variant) + if (result != 0) { + error "Failed to check files...." + } + echo "Doing export: ${doexport}" + if (doexport) { + result = doExport(exportfolder, exportpathlist, destpart, build_variant) + if (result != 0) { + error "Failed to copy...." + } + } + } + else { + echo "Not building ${build_variant} variant of project: ${project}" + } + } catch (Exception e) { + echo "Exception: ${e.getMessage()}\nBuild failed - Waiting for a while" + sleep(time: 4, unit: 'SECONDS') + error "Build failed..." + } + } + } +} + +def doExportOnlyProject(String project, Boolean doexport, variants, String exportfolder, exportpathlist, String destpart) { + echo "Doing export only project: ${project} : ${doexport}" + if (doexport) { + if (!variants) { + result = doExport(exportfolder, exportpathlist, destpart) + if (result != 0) { + error "Failed to copy...." + } + } else { + for (build_variant in variants) { + if (toBuild.contains(build_variant)) { + result = doExport(exportfolder, exportpathlist, destpart, build_variant) + if (result != 0) { + error "Failed to copy...." + } + } + } + } + } +} + +// Build and export files +def doBuild(apps, ds5folder, ds5shellcommand, buildcommand, sourcefolder, variantstobuild, exportfolder = "${WORKSPACE}") { + toBuild = [] + if (variantstobuild) { + toBuildUntrimmed = variantstobuild.split(',') + toBuildUntrimmed.each { + toBuild.add(it.trim()) + } + } + // The lock is being used because it was being found that the doKillLeftovers was affecting other builds + lock(resource: "eclipsebuild_${env.NODE_NAME}") { + try { + timeout(time: 5, unit: 'MINUTES') { + doImportProjects(ds5folder, ds5shellcommand, buildcommand, sourcefolder) + } + for (appInfo in apps) { + def Boolean build + def Boolean doexport + (build, doexport, project, variants, exportpathlist, destpart) = appInfo + if (build) { + doBuildAndExportProject(ds5folder, ds5shellcommand, buildcommand, project, doexport, variants, exportfolder, exportpathlist, destpart) + } + else { + doExportOnlyProject(project, doexport, variants, exportfolder, exportpathlist, destpart) + } + } + } catch (Exception e) { + // doKillLeftovers() + error "Exception: ${e.getMessage()}\nBuild failed - Killing leftovers" + } + } +} + +return this; From d147e91fd31c01455c2d8178858d040c0d7b1b0f Mon Sep 17 00:00:00 2001 From: Christos Spirotis Date: Wed, 22 Apr 2020 19:14:29 +0100 Subject: [PATCH 02/44] CORE-58 added cygwin_folder env variable, removed check for binary file --- compile/eclipsebuild/eclipseSTM8build.groovy | 8 -------- 1 file changed, 8 deletions(-) diff --git a/compile/eclipsebuild/eclipseSTM8build.groovy b/compile/eclipsebuild/eclipseSTM8build.groovy index 592483a..2aef386 100644 --- a/compile/eclipsebuild/eclipseSTM8build.groovy +++ b/compile/eclipsebuild/eclipseSTM8build.groovy @@ -23,14 +23,6 @@ def doCheck(checkpathlist, build_variant = "") { returnStatus: true ) } - else if (srcFileExpanded.endsWith(".stm8bin")) { - result = bat ( script: """ - ${COSMICDIR}/cobj -hs ${srcFileExpanded} - if errorlevel 1 EXIT /b 1 - """, - returnStatus: true - ) - } if (result != 0) { return result } From d5ad9c75fa9e50bc5dc9f6314dd7e6428bd1bcaa Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 10 Jul 2020 12:57:17 +0100 Subject: [PATCH 03/44] Increase time to do project importing before timeout --- compile/eclipsebuild/eclipseds5build.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compile/eclipsebuild/eclipseds5build.groovy b/compile/eclipsebuild/eclipseds5build.groovy index 9225100..1fd9078 100644 --- a/compile/eclipsebuild/eclipseds5build.groovy +++ b/compile/eclipsebuild/eclipseds5build.groovy @@ -227,7 +227,7 @@ def doBuild(apps, ds5folder, toolchainfolder, ds5shellcommand, buildcommand, sou // The lock is being used because it was being found that the doKillLeftovers was affecting other builds lock(resource: "eclipsebuild_${env.NODE_NAME}") { try { - timeout(time: 5, unit: 'MINUTES') { + timeout(time: 10, unit: 'MINUTES') { addToolchainPath(toolchainfolder) doImportProjects(ds5folder, toolchainfolder, ds5shellcommand, buildcommand, sourcefolder) } From 95f1278e4c5ba88fbc9f90e1a7e6b4ca13272cde Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 5 Sep 2020 22:20:44 +0100 Subject: [PATCH 04/44] Add doxygen deployment script --- documentation/doxygen_deploy.groovy | 75 +++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 documentation/doxygen_deploy.groovy diff --git a/documentation/doxygen_deploy.groovy b/documentation/doxygen_deploy.groovy new file mode 100644 index 0000000..736ed10 --- /dev/null +++ b/documentation/doxygen_deploy.groovy @@ -0,0 +1,75 @@ +pipeline { + agent { label "${AGENT_LABEL}" } + stages { + stage('Initial setup') { + steps { + script { + meta = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy").startnonbuild(this) + } + } + } + stage('Clean imports') { + steps { + script { + env.DOXYGEN = "doxygen" + cleanfolders = [ + DOXYGEN, + ] + cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy") + cleaner.clean(cleanfolders) + } + } + } + stage('Import doxygen artifacts') { + steps { + script { + importer = load("${autobuilder.commonscripts()}/import/importer.groovy") + def importoptions = new ImportOptions(this) + + importoptions.jenkinsjob(BUILD_JOB_WITH_DOXYGEN_ARTIFACTS, BUILD_JOB_WITH_DOXYGEN_ARTIFACTS_SELECTOR) + importoptions.setfilter(ARTIFACT_PATH_TO_DOXYGEN_ROOT + '/**') + doxygenmeta = importer.artifactimportfrombuildjob(meta, importoptions, DOXYGEN) + } + } + } +/* + + stage('Clean exports') { + steps { + script { + env.DOXYGEN = "api_docs" + cleanfolders = [ + API_DOCS, + ] + cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy") + cleaner.clean(cleanfolders) + } + } + } + + stage('Copy api docs') { + steps { + script { + dir("${SOURCEDIR}/documents/api/public") { + fileOperations([fileCopyOperation(targetLocation: "${WORKSPACE}/${API_DOCS}", includes: '*.docx,*.pptx')]) + } + } + } + } +*/ + } + post { + always { + echo 'Post-build' + } + failure { + echo 'Failed build' + } + unstable { + echo 'Unstable build' + } + success { + echo 'Succeeded build' + } + } +} From 6fa1bdaeaf4acf494a2161792fbdb762baec94e7 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 5 Sep 2020 22:22:08 +0100 Subject: [PATCH 05/44] Add doxygen deployment script --- documentation/doxygen_deploy.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/doxygen_deploy.groovy b/documentation/doxygen_deploy.groovy index 736ed10..af127ea 100644 --- a/documentation/doxygen_deploy.groovy +++ b/documentation/doxygen_deploy.groovy @@ -24,7 +24,7 @@ pipeline { steps { script { importer = load("${autobuilder.commonscripts()}/import/importer.groovy") - def importoptions = new ImportOptions(this) + def importoptions = new importer.ImportOptions(this) importoptions.jenkinsjob(BUILD_JOB_WITH_DOXYGEN_ARTIFACTS, BUILD_JOB_WITH_DOXYGEN_ARTIFACTS_SELECTOR) importoptions.setfilter(ARTIFACT_PATH_TO_DOXYGEN_ROOT + '/**') From 906714ac24a2992fa790cf2e6358f80bc329bbcb Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 5 Sep 2020 22:26:05 +0100 Subject: [PATCH 06/44] Add doxygen deployment script --- documentation/doxygen_deploy.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/doxygen_deploy.groovy b/documentation/doxygen_deploy.groovy index af127ea..dc442b6 100644 --- a/documentation/doxygen_deploy.groovy +++ b/documentation/doxygen_deploy.groovy @@ -24,7 +24,7 @@ pipeline { steps { script { importer = load("${autobuilder.commonscripts()}/import/importer.groovy") - def importoptions = new importer.ImportOptions(this) + def importoptions = importer.getNewImportOptions(this) importoptions.jenkinsjob(BUILD_JOB_WITH_DOXYGEN_ARTIFACTS, BUILD_JOB_WITH_DOXYGEN_ARTIFACTS_SELECTOR) importoptions.setfilter(ARTIFACT_PATH_TO_DOXYGEN_ROOT + '/**') From caf62da190dc894ef5749bda54537f4b98e3afa9 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 5 Sep 2020 22:30:24 +0100 Subject: [PATCH 07/44] Add doxygen deployment script --- documentation/doxygen_deploy.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/doxygen_deploy.groovy b/documentation/doxygen_deploy.groovy index dc442b6..ae0c063 100644 --- a/documentation/doxygen_deploy.groovy +++ b/documentation/doxygen_deploy.groovy @@ -24,7 +24,7 @@ pipeline { steps { script { importer = load("${autobuilder.commonscripts()}/import/importer.groovy") - def importoptions = importer.getNewImportOptions(this) + def importoptions = importer.getNewImportOptions() importoptions.jenkinsjob(BUILD_JOB_WITH_DOXYGEN_ARTIFACTS, BUILD_JOB_WITH_DOXYGEN_ARTIFACTS_SELECTOR) importoptions.setfilter(ARTIFACT_PATH_TO_DOXYGEN_ROOT + '/**') From bbbd7b6af6a3bc1943853ac55796cf639e848a1e Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 5 Sep 2020 22:42:54 +0100 Subject: [PATCH 08/44] Add doxygen deployment script --- documentation/doxygen_deploy.groovy | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/documentation/doxygen_deploy.groovy b/documentation/doxygen_deploy.groovy index ae0c063..3586860 100644 --- a/documentation/doxygen_deploy.groovy +++ b/documentation/doxygen_deploy.groovy @@ -29,6 +29,11 @@ pipeline { importoptions.jenkinsjob(BUILD_JOB_WITH_DOXYGEN_ARTIFACTS, BUILD_JOB_WITH_DOXYGEN_ARTIFACTS_SELECTOR) importoptions.setfilter(ARTIFACT_PATH_TO_DOXYGEN_ROOT + '/**') doxygenmeta = importer.artifactimportfrombuildjob(meta, importoptions, DOXYGEN) + + productname = doxygenmeta.productinfo.productname + buildstampprefix = doxygenmeta.buildstampinfo.buildstampprefix + + echo "Doyxgen imported for product: ${productname} and build stamp prefix: ${buildstampprefix}" } } } From 9c81da3e19c970f80f0317304ca46e130428b133 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 5 Sep 2020 23:02:33 +0100 Subject: [PATCH 09/44] Add doxygen deployment script --- documentation/doxygen_deploy.groovy | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/documentation/doxygen_deploy.groovy b/documentation/doxygen_deploy.groovy index 3586860..f84e7b0 100644 --- a/documentation/doxygen_deploy.groovy +++ b/documentation/doxygen_deploy.groovy @@ -34,34 +34,34 @@ pipeline { buildstampprefix = doxygenmeta.buildstampinfo.buildstampprefix echo "Doyxgen imported for product: ${productname} and build stamp prefix: ${buildstampprefix}" + + pathonserver = "${ROOT_PATH_ON_SERVER}/${productname}/${buildstampprefix}" } } } -/* - - stage('Clean exports') { + stage('Clean destination') { steps { script { - env.DOXYGEN = "api_docs" cleanfolders = [ - API_DOCS, + pathonserver, ] cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy") cleaner.clean(cleanfolders) } } } - - stage('Copy api docs') { + + stage('Copy doxygen to server') { steps { script { - dir("${SOURCEDIR}/documents/api/public") { - fileOperations([fileCopyOperation(targetLocation: "${WORKSPACE}/${API_DOCS}", includes: '*.docx,*.pptx')]) + doxygensource = "${DOXYGEN}/${DOXYGEN ARTIFACT_PATH_TO_DOXYGEN_ROOT)" + echo "Copying from ${doxygensource} to ${pathonserver}" + dir(doxygensource { + fileOperations([fileCopyOperation(targetLocation: pathonserver)]) } } } } -*/ } post { always { From e4086c3aee9a00341f059cf47cba84b1c411e5cb Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 5 Sep 2020 23:04:32 +0100 Subject: [PATCH 10/44] Add doxygen deployment script --- documentation/doxygen_deploy.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/doxygen_deploy.groovy b/documentation/doxygen_deploy.groovy index f84e7b0..6c92467 100644 --- a/documentation/doxygen_deploy.groovy +++ b/documentation/doxygen_deploy.groovy @@ -54,7 +54,7 @@ pipeline { stage('Copy doxygen to server') { steps { script { - doxygensource = "${DOXYGEN}/${DOXYGEN ARTIFACT_PATH_TO_DOXYGEN_ROOT)" + doxygensource = "${DOXYGEN}/${DOXYGEN ARTIFACT_PATH_TO_DOXYGEN_ROOT}" echo "Copying from ${doxygensource} to ${pathonserver}" dir(doxygensource { fileOperations([fileCopyOperation(targetLocation: pathonserver)]) From 748d9f7e667112aee4de508e741727468c9744a9 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 5 Sep 2020 23:07:30 +0100 Subject: [PATCH 11/44] Add doxygen deployment script --- documentation/doxygen_deploy.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/doxygen_deploy.groovy b/documentation/doxygen_deploy.groovy index 6c92467..8fd41ce 100644 --- a/documentation/doxygen_deploy.groovy +++ b/documentation/doxygen_deploy.groovy @@ -56,7 +56,7 @@ pipeline { script { doxygensource = "${DOXYGEN}/${DOXYGEN ARTIFACT_PATH_TO_DOXYGEN_ROOT}" echo "Copying from ${doxygensource} to ${pathonserver}" - dir(doxygensource { + dir(doxygensource) { fileOperations([fileCopyOperation(targetLocation: pathonserver)]) } } From 8477a500ceff047471bd8a4d6eca87067a8f56f8 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 5 Sep 2020 23:09:48 +0100 Subject: [PATCH 12/44] Add doxygen deployment script --- documentation/doxygen_deploy.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/doxygen_deploy.groovy b/documentation/doxygen_deploy.groovy index 8fd41ce..0c2d4a2 100644 --- a/documentation/doxygen_deploy.groovy +++ b/documentation/doxygen_deploy.groovy @@ -54,7 +54,7 @@ pipeline { stage('Copy doxygen to server') { steps { script { - doxygensource = "${DOXYGEN}/${DOXYGEN ARTIFACT_PATH_TO_DOXYGEN_ROOT}" + doxygensource = "${DOXYGEN}/${ARTIFACT_PATH_TO_DOXYGEN_ROOT}" echo "Copying from ${doxygensource} to ${pathonserver}" dir(doxygensource) { fileOperations([fileCopyOperation(targetLocation: pathonserver)]) From 6daa1d6106b8e0a07748563f35cddab03ea300b4 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 5 Sep 2020 23:19:12 +0100 Subject: [PATCH 13/44] Add doxygen deployment script --- documentation/doxygen_deploy.groovy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/documentation/doxygen_deploy.groovy b/documentation/doxygen_deploy.groovy index 0c2d4a2..d8422a4 100644 --- a/documentation/doxygen_deploy.groovy +++ b/documentation/doxygen_deploy.groovy @@ -56,6 +56,8 @@ pipeline { script { doxygensource = "${DOXYGEN}/${ARTIFACT_PATH_TO_DOXYGEN_ROOT}" echo "Copying from ${doxygensource} to ${pathonserver}" + dir(pathonserver) { + } dir(doxygensource) { fileOperations([fileCopyOperation(targetLocation: pathonserver)]) } From 2ae9dfcecc4ad6271be1a5a83326e69c6cb1d68d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 6 Sep 2020 08:27:55 +0100 Subject: [PATCH 14/44] Add doxygen deployment script --- documentation/doxygen_deploy.groovy | 34 +++++++++++++---------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/documentation/doxygen_deploy.groovy b/documentation/doxygen_deploy.groovy index d8422a4..db96b43 100644 --- a/documentation/doxygen_deploy.groovy +++ b/documentation/doxygen_deploy.groovy @@ -34,32 +34,28 @@ pipeline { buildstampprefix = doxygenmeta.buildstampinfo.buildstampprefix echo "Doyxgen imported for product: ${productname} and build stamp prefix: ${buildstampprefix}" - - pathonserver = "${ROOT_PATH_ON_SERVER}/${productname}/${buildstampprefix}" } } } - stage('Clean destination') { - steps { - script { - cleanfolders = [ - pathonserver, - ] - cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy") - cleaner.clean(cleanfolders) - } - } - } - stage('Copy doxygen to server') { steps { script { doxygensource = "${DOXYGEN}/${ARTIFACT_PATH_TO_DOXYGEN_ROOT}" - echo "Copying from ${doxygensource} to ${pathonserver}" - dir(pathonserver) { - } - dir(doxygensource) { - fileOperations([fileCopyOperation(targetLocation: pathonserver)]) + pathonserver = "${ROOT_PATH_ON_SERVER.trim()}/${productname}/${buildstampprefix}" + echo "Moving from ${doxygensource} to ${pathonserver}" + if isUnix() { + sh """#!/bin/bash + rm -rfv "${pathonserver}" + if [ \$? -ne 0 ]; then exit 1; fi + + mkdir -pv "${pathonserver}" + if [ \$? -ne 0 ]; then exit 1; fi + + mv -v "${doxygensource}"/* "${pathonserver}" + if [ \$? -ne 0 ]; then exit 1; fi + + } else { + error("This job does not run on Windows at the moment") } } } From 226ac5916263e17984c1fa0d2c935a7528a802c9 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 6 Sep 2020 08:28:58 +0100 Subject: [PATCH 15/44] Add doxygen deployment script --- documentation/doxygen_deploy.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/doxygen_deploy.groovy b/documentation/doxygen_deploy.groovy index db96b43..474307b 100644 --- a/documentation/doxygen_deploy.groovy +++ b/documentation/doxygen_deploy.groovy @@ -43,7 +43,7 @@ pipeline { doxygensource = "${DOXYGEN}/${ARTIFACT_PATH_TO_DOXYGEN_ROOT}" pathonserver = "${ROOT_PATH_ON_SERVER.trim()}/${productname}/${buildstampprefix}" echo "Moving from ${doxygensource} to ${pathonserver}" - if isUnix() { + if (isUnix()) { sh """#!/bin/bash rm -rfv "${pathonserver}" if [ \$? -ne 0 ]; then exit 1; fi From 8fd7cda8b6be6f337bdc027aece4af86b9354adf Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 6 Sep 2020 08:40:47 +0100 Subject: [PATCH 16/44] Add doxygen deployment script --- documentation/doxygen_deploy.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/doxygen_deploy.groovy b/documentation/doxygen_deploy.groovy index 474307b..2077b25 100644 --- a/documentation/doxygen_deploy.groovy +++ b/documentation/doxygen_deploy.groovy @@ -75,4 +75,4 @@ pipeline { echo 'Succeeded build' } } -} +} \ No newline at end of file From fcd01335deadd3229be32a57a06d55c817a6d5e4 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 6 Sep 2020 08:45:52 +0100 Subject: [PATCH 17/44] Add doxygen deployment script --- documentation/doxygen_deploy.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/documentation/doxygen_deploy.groovy b/documentation/doxygen_deploy.groovy index 2077b25..9eeb55d 100644 --- a/documentation/doxygen_deploy.groovy +++ b/documentation/doxygen_deploy.groovy @@ -75,4 +75,5 @@ pipeline { echo 'Succeeded build' } } -} \ No newline at end of file +} + From 1e9b5afaf0f0be61fedd74600e3f78dacdabed6e Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 6 Sep 2020 08:47:50 +0100 Subject: [PATCH 18/44] Add doxygen deployment script --- documentation/doxygen_deploy.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/doxygen_deploy.groovy b/documentation/doxygen_deploy.groovy index 9eeb55d..d30ddf6 100644 --- a/documentation/doxygen_deploy.groovy +++ b/documentation/doxygen_deploy.groovy @@ -53,7 +53,7 @@ pipeline { mv -v "${doxygensource}"/* "${pathonserver}" if [ \$? -ne 0 ]; then exit 1; fi - + """ } else { error("This job does not run on Windows at the moment") } From c473cfbb6efe6b43cda4148ddd2b6a302b42174b Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 6 Sep 2020 08:57:56 +0100 Subject: [PATCH 19/44] Add doxygen deployment script --- documentation/doxygen_deploy.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/doxygen_deploy.groovy b/documentation/doxygen_deploy.groovy index d30ddf6..26a15f3 100644 --- a/documentation/doxygen_deploy.groovy +++ b/documentation/doxygen_deploy.groovy @@ -42,7 +42,7 @@ pipeline { script { doxygensource = "${DOXYGEN}/${ARTIFACT_PATH_TO_DOXYGEN_ROOT}" pathonserver = "${ROOT_PATH_ON_SERVER.trim()}/${productname}/${buildstampprefix}" - echo "Moving from ${doxygensource} to ${pathonserver}" + echo "Copying from ${doxygensource} to ${pathonserver}" if (isUnix()) { sh """#!/bin/bash rm -rfv "${pathonserver}" @@ -51,7 +51,7 @@ pipeline { mkdir -pv "${pathonserver}" if [ \$? -ne 0 ]; then exit 1; fi - mv -v "${doxygensource}"/* "${pathonserver}" + cp -rv "${doxygensource}"/* "${pathonserver}" if [ \$? -ne 0 ]; then exit 1; fi """ } else { From b1262ef4ee42dbfbad7221b0e7f5226e0759f0e1 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 6 Sep 2020 09:05:12 +0100 Subject: [PATCH 20/44] Add doxygen deployment script --- documentation/doxygen_deploy.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/documentation/doxygen_deploy.groovy b/documentation/doxygen_deploy.groovy index 26a15f3..c57eedd 100644 --- a/documentation/doxygen_deploy.groovy +++ b/documentation/doxygen_deploy.groovy @@ -50,7 +50,8 @@ pipeline { mkdir -pv "${pathonserver}" if [ \$? -ne 0 ]; then exit 1; fi - + + echo cp -rv "${doxygensource}"/* "${pathonserver}" cp -rv "${doxygensource}"/* "${pathonserver}" if [ \$? -ne 0 ]; then exit 1; fi """ From bde11981fcc1f2efae0438cd091c5dd24748a7ff Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 6 Sep 2020 09:15:15 +0100 Subject: [PATCH 21/44] Add doxygen deployment script --- documentation/doxygen_deploy.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/doxygen_deploy.groovy b/documentation/doxygen_deploy.groovy index c57eedd..6642256 100644 --- a/documentation/doxygen_deploy.groovy +++ b/documentation/doxygen_deploy.groovy @@ -51,8 +51,8 @@ pipeline { mkdir -pv "${pathonserver}" if [ \$? -ne 0 ]; then exit 1; fi - echo cp -rv "${doxygensource}"/* "${pathonserver}" - cp -rv "${doxygensource}"/* "${pathonserver}" + echo mv -v "${doxygensource}"/ "${pathonserver}" + mv -v "${doxygensource}"/ "${pathonserver}" if [ \$? -ne 0 ]; then exit 1; fi """ } else { From 46b29279ce80d47ffd932519da052ea755678a64 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 25 Sep 2020 12:14:48 +0100 Subject: [PATCH 22/44] Include kernel zImage in app package --- packaging/debian.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/debian.groovy b/packaging/debian.groovy index 2ef1ba8..857cb32 100644 --- a/packaging/debian.groovy +++ b/packaging/debian.groovy @@ -45,6 +45,7 @@ class DebRootDefinition { GIS_OPT_SCRIPTS_CONTROL = "${DEBPATH}/opt/gis/scripts/control" GIS_OPT_WWW = "${DEBPATH}/opt/gis/www" GIS_OPT_OTHER = "${DEBPATH}/opt/gis/other" + GIS_OPT_KERNEL = "${DEBPATH}/opt/gis/kernel" GIS_OPT_LOGIC = "${DEBPATH}/opt/gis/logic" GIS_OPT_PRINTHEAD = "${DEBPATH}/opt/gis/printhead" From 7da9f89a3925294f9be7b42744f160c6a192e67a Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 25 Sep 2020 15:09:44 +0100 Subject: [PATCH 23/44] Include kernel zImage in app package --- packaging/debian.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/debian.groovy b/packaging/debian.groovy index 857cb32..a5fc773 100644 --- a/packaging/debian.groovy +++ b/packaging/debian.groovy @@ -17,6 +17,7 @@ class DebRootDefinition { String GIS_OPT_SCRIPTS_CONTROL String GIS_OPT_WWW String GIS_OPT_OTHER + String GIS_OPT_KERNEL String GIS_OPT_LOGIC String GIS_OPT_PRINTHEAD From ea7faf51c7b64eabd33e959d5557c1db05eca45c Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 4 Oct 2020 10:03:00 +0100 Subject: [PATCH 24/44] Show environment --- staticanalysis/cpd.groovy | 3 +++ 1 file changed, 3 insertions(+) diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index 2bd12d9..05c00fb 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -5,6 +5,9 @@ pipeline { steps { script { meta = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy").startnonbuild(this) + sh """#!/bin/bash + env + """ } } } From caf5ddbe8c06b44f4eee4f32c883685a4832b6b4 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 4 Oct 2020 10:18:32 +0100 Subject: [PATCH 25/44] Handle path exclusions --- staticanalysis/cpd.groovy | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index 05c00fb..7d4ccb7 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -85,17 +85,21 @@ pipeline { script { def PPDFOLDER = "${STATICANALYSIS}/ppd" dir(PPDFOLDER) { + def EXCLUDE_PARAM = '' + if (EXCLUDE_PATHS) { + EXCLUDE_PARAM = """--exclude "%EXCLUDE_PATHS%" """ + } if (isUnix()) { sh """#!/bin/bash set -e export PMD_JAVA_OPTS=-Xmx65536m - "${PPD}/run.sh" cpd --minimum-tokens 100 --files "${SRC}" --language cpp --format xml --failOnViolation false > cpd.xml + "${PPD}/run.sh" cpd --minimum-tokens 100 --files "${SRC}" --language cpp --format xml %EXCLUDE_PARAM% --failOnViolation false > cpd.xml """ } else { bat """ set PMD_JAVA_OPTS=-Xmx2048m - "${PPD}/cpd.bat" --minimum-tokens 100 --files "${SRC}" --language cpp --format xml --failOnViolation false > cpd.xml + "${PPD}/cpd.bat" --minimum-tokens 100 --files "${SRC}" --language cpp --format xml %EXCLUDE_PARAM% --failOnViolation false > cpd.xml """ } } From 4ec0d0e1b6ba2fb63b06b7fcd82b0d9169d57b2b Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 4 Oct 2020 10:28:14 +0100 Subject: [PATCH 26/44] Handle path exclusions --- staticanalysis/cpd.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index 7d4ccb7..49dde7c 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -85,7 +85,7 @@ pipeline { script { def PPDFOLDER = "${STATICANALYSIS}/ppd" dir(PPDFOLDER) { - def EXCLUDE_PARAM = '' + EXCLUDE_PARAM = '' if (EXCLUDE_PATHS) { EXCLUDE_PARAM = """--exclude "%EXCLUDE_PATHS%" """ } From 1d18f769e533383118c73ce1c0c12e420badd9ab Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 4 Oct 2020 10:30:21 +0100 Subject: [PATCH 27/44] Handle path exclusions --- staticanalysis/cpd.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index 49dde7c..60dad56 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -89,6 +89,7 @@ pipeline { if (EXCLUDE_PATHS) { EXCLUDE_PARAM = """--exclude "%EXCLUDE_PATHS%" """ } + echo "EXCLUDE_PARAM=%EXCLUDE_PARAM%" if (isUnix()) { sh """#!/bin/bash set -e From 7aa4e9299e41bab76093557b3faefb08ee17231b Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 4 Oct 2020 10:31:48 +0100 Subject: [PATCH 28/44] Handle path exclusions --- staticanalysis/cpd.groovy | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index 60dad56..b4fb1ad 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -85,22 +85,21 @@ pipeline { script { def PPDFOLDER = "${STATICANALYSIS}/ppd" dir(PPDFOLDER) { - EXCLUDE_PARAM = '' + def EXCLUDE_PARAM = '' if (EXCLUDE_PATHS) { - EXCLUDE_PARAM = """--exclude "%EXCLUDE_PATHS%" """ + EXCLUDE_PARAM = """--exclude "${EXCLUDE_PATHS}" """ } - echo "EXCLUDE_PARAM=%EXCLUDE_PARAM%" if (isUnix()) { sh """#!/bin/bash set -e export PMD_JAVA_OPTS=-Xmx65536m - "${PPD}/run.sh" cpd --minimum-tokens 100 --files "${SRC}" --language cpp --format xml %EXCLUDE_PARAM% --failOnViolation false > cpd.xml + "${PPD}/run.sh" cpd --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml """ } else { bat """ set PMD_JAVA_OPTS=-Xmx2048m - "${PPD}/cpd.bat" --minimum-tokens 100 --files "${SRC}" --language cpp --format xml %EXCLUDE_PARAM% --failOnViolation false > cpd.xml + "${PPD}/cpd.bat" --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml """ } } From d75fd3ca51627df7e38861842a453f19bf14b860 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 4 Oct 2020 10:38:38 +0100 Subject: [PATCH 29/44] Handle path exclusions --- staticanalysis/cpd.groovy | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index b4fb1ad..6731c94 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -89,18 +89,20 @@ pipeline { if (EXCLUDE_PATHS) { EXCLUDE_PARAM = """--exclude "${EXCLUDE_PATHS}" """ } - if (isUnix()) { - sh """#!/bin/bash - set -e - - export PMD_JAVA_OPTS=-Xmx65536m - "${PPD}/run.sh" cpd --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml - """ - } else { - bat """ - set PMD_JAVA_OPTS=-Xmx2048m - "${PPD}/cpd.bat" --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml - """ + dir(SRC) { + if (isUnix()) { + sh """#!/bin/bash + set -e + + export PMD_JAVA_OPTS=-Xmx65536m + "${PPD}/run.sh" cpd --minimum-tokens 100 --files . --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml + """ + } else { + bat """ + set PMD_JAVA_OPTS=-Xmx2048m + "${PPD}/cpd.bat" --minimum-tokens 100 --files . --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml + """ + } } } recordIssues(tools: [ From c82bbc6b4752b6c1582eaee6549c3f2888085572 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 4 Oct 2020 10:41:30 +0100 Subject: [PATCH 30/44] Handle path exclusions --- staticanalysis/cpd.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index 6731c94..127db9f 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -92,7 +92,7 @@ pipeline { dir(SRC) { if (isUnix()) { sh """#!/bin/bash - set -e + set -ev export PMD_JAVA_OPTS=-Xmx65536m "${PPD}/run.sh" cpd --minimum-tokens 100 --files . --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml From 9c9e0999fcd8ecfef74d3e6a38e755938f93314f Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 4 Oct 2020 10:59:05 +0100 Subject: [PATCH 31/44] Handle path exclusions --- staticanalysis/cpd.groovy | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index 127db9f..649ba89 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -87,22 +87,26 @@ pipeline { dir(PPDFOLDER) { def EXCLUDE_PARAM = '' if (EXCLUDE_PATHS) { - EXCLUDE_PARAM = """--exclude "${EXCLUDE_PATHS}" """ - } - dir(SRC) { - if (isUnix()) { - sh """#!/bin/bash - set -ev - - export PMD_JAVA_OPTS=-Xmx65536m - "${PPD}/run.sh" cpd --minimum-tokens 100 --files . --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml - """ - } else { - bat """ - set PMD_JAVA_OPTS=-Xmx2048m - "${PPD}/cpd.bat" --minimum-tokens 100 --files . --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml - """ + EXCLUDE_PARAM = '--exclude "' + def exclude_path_list = EXCLUDE_PATHS.split() + for (exclude_path in exclude_path_list) { + EXCLUDE_PARAM += "${WORKSPACE}/${exclude_path.trim()}," } + EXCLUDE_PARAM += '"' + } + if (isUnix()) { + sh """#!/bin/bash + set -ev + + export PMD_JAVA_OPTS=-Xmx65536m + echo "${PPD}/run.sh" cpd --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml + "${PPD}/run.sh" cpd --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml + """ + } else { + bat """ + set PMD_JAVA_OPTS=-Xmx2048m + "${PPD}/cpd.bat" --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml + """ } } recordIssues(tools: [ From ec496bb55743616fae5a6b7a3f40cde9525a2e79 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 4 Oct 2020 11:11:17 +0100 Subject: [PATCH 32/44] Handle path exclusions --- staticanalysis/cpd.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index 649ba89..d4956b1 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -90,7 +90,7 @@ pipeline { EXCLUDE_PARAM = '--exclude "' def exclude_path_list = EXCLUDE_PATHS.split() for (exclude_path in exclude_path_list) { - EXCLUDE_PARAM += "${WORKSPACE}/${exclude_path.trim()}," + EXCLUDE_PARAM += "${SRC}/${exclude_path.trim()}," } EXCLUDE_PARAM += '"' } From 0890fb01b3123b9475987dea37f760123ddeba8c Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 4 Oct 2020 11:16:10 +0100 Subject: [PATCH 33/44] Handle path exclusions --- staticanalysis/cpd.groovy | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index d4956b1..6d717a5 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -56,7 +56,10 @@ pipeline { SOURCEDIR = "${WORKSPACE}/source" configurationhelper.gitCheckoutAndRegister(meta, 'source', SOURCEURL, SOURCEREVISION, SOURCEDIR, '', 0, false) SOURCE_PATH = "${SOURCEDIR}" - env.SRC = "${SOURCE_PATH}/${SOURCE_OFFSET_PATH}" + SRC = "${SOURCE_PATH}" + if (SOURCE_OFFSET_PATH) { + SRC += "/${SOURCE_OFFSET_PATH}" + } } } } From 35018f9956528b297d05579d2db8a26a2520c1fb Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 4 Oct 2020 11:18:18 +0100 Subject: [PATCH 34/44] Handle path exclusions --- staticanalysis/cpd.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index 6d717a5..e20b0de 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -91,7 +91,7 @@ pipeline { def EXCLUDE_PARAM = '' if (EXCLUDE_PATHS) { EXCLUDE_PARAM = '--exclude "' - def exclude_path_list = EXCLUDE_PATHS.split() + def exclude_path_list = EXCLUDE_PATHS.split(',') for (exclude_path in exclude_path_list) { EXCLUDE_PARAM += "${SRC}/${exclude_path.trim()}," } From 7a590ecad57b4cd3700960759053fa73337efed5 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 4 Oct 2020 11:37:38 +0100 Subject: [PATCH 35/44] Handle path exclusions --- staticanalysis/cpd.groovy | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index e20b0de..07f922e 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -97,19 +97,21 @@ pipeline { } EXCLUDE_PARAM += '"' } - if (isUnix()) { - sh """#!/bin/bash - set -ev + dir(SRC) { + if (isUnix()) { + sh """#!/bin/bash + set -ev - export PMD_JAVA_OPTS=-Xmx65536m - echo "${PPD}/run.sh" cpd --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml - "${PPD}/run.sh" cpd --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml - """ - } else { - bat """ - set PMD_JAVA_OPTS=-Xmx2048m - "${PPD}/cpd.bat" --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml - """ + export PMD_JAVA_OPTS=-Xmx65536m + echo "${PPD}/run.sh" cpd --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml + "${PPD}/run.sh" cpd --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml + """ + } else { + bat """ + set PMD_JAVA_OPTS=-Xmx2048m + "${PPD}/cpd.bat" --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml + """ + } } } recordIssues(tools: [ From 29cfbbf9d651f5d511eef37b92d203251feec579 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 4 Oct 2020 12:05:45 +0100 Subject: [PATCH 36/44] Handle path exclusions --- staticanalysis/cpd.groovy | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index 07f922e..5f357ce 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -1,13 +1,10 @@ pipeline { - agent { label "${AGENT_LABEL}" } + agent { label AGENT_LABEL } stages { stage('Initial setup') { steps { script { meta = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy").startnonbuild(this) - sh """#!/bin/bash - env - """ } } } @@ -103,7 +100,6 @@ pipeline { set -ev export PMD_JAVA_OPTS=-Xmx65536m - echo "${PPD}/run.sh" cpd --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml "${PPD}/run.sh" cpd --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml """ } else { From 562c1cbc21f1f3ac246a06ff2771644458eae6c0 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 4 Oct 2020 12:29:19 +0100 Subject: [PATCH 37/44] Handle path exclusions --- staticanalysis/cpd.groovy | 41 +++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index 5f357ce..0bc5c12 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -84,30 +84,25 @@ pipeline { steps { script { def PPDFOLDER = "${STATICANALYSIS}/ppd" - dir(PPDFOLDER) { - def EXCLUDE_PARAM = '' - if (EXCLUDE_PATHS) { - EXCLUDE_PARAM = '--exclude "' - def exclude_path_list = EXCLUDE_PATHS.split(',') - for (exclude_path in exclude_path_list) { - EXCLUDE_PARAM += "${SRC}/${exclude_path.trim()}," - } - EXCLUDE_PARAM += '"' - } - dir(SRC) { - if (isUnix()) { - sh """#!/bin/bash - set -ev + def EXCLUDE_PARAM = '' + if (EXCLUDE_PATHS) { + EXCLUDE_PARAM = """--exclude "${EXCLUDE_PATHS.trim}"""" + } + dir(SRC) { + if (isUnix()) { + sh """#!/bin/bash + set -ev - export PMD_JAVA_OPTS=-Xmx65536m - "${PPD}/run.sh" cpd --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml - """ - } else { - bat """ - set PMD_JAVA_OPTS=-Xmx2048m - "${PPD}/cpd.bat" --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml - """ - } + mkdir "${PPDFOLDER}" + export PMD_JAVA_OPTS=-Xmx65536m + "${PPD}/run.sh" cpd --minimum-tokens 100 --files . --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > "${PPDFOLDER}cpd.xml" + """ + } else { + bat """ + mkdir "${PPDFOLDER}" + set PMD_JAVA_OPTS=-Xmx2048m + "${PPD}/cpd.bat" --minimum-tokens 100 --files . --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > "${PPDFOLDER}cpd.xml" + """ } } recordIssues(tools: [ From 0514270ca56dfacf90740100ed70fa03be537ed7 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 4 Oct 2020 12:31:18 +0100 Subject: [PATCH 38/44] Handle path exclusions --- staticanalysis/cpd.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index 0bc5c12..90c0efa 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -86,7 +86,7 @@ pipeline { def PPDFOLDER = "${STATICANALYSIS}/ppd" def EXCLUDE_PARAM = '' if (EXCLUDE_PATHS) { - EXCLUDE_PARAM = """--exclude "${EXCLUDE_PATHS.trim}"""" + EXCLUDE_PARAM = """--exclude "${EXCLUDE_PATHS.trim}" """ } dir(SRC) { if (isUnix()) { From df2bd2f03760bf060d0d9c4092c5c202bfba9633 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 4 Oct 2020 12:32:48 +0100 Subject: [PATCH 39/44] Handle path exclusions --- staticanalysis/cpd.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index 90c0efa..6651870 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -86,7 +86,7 @@ pipeline { def PPDFOLDER = "${STATICANALYSIS}/ppd" def EXCLUDE_PARAM = '' if (EXCLUDE_PATHS) { - EXCLUDE_PARAM = """--exclude "${EXCLUDE_PATHS.trim}" """ + EXCLUDE_PARAM = """--exclude "${EXCLUDE_PATHS.trim()}" """ } dir(SRC) { if (isUnix()) { From 0114f4e16b3e98afea231f430e4b81fc684bd484 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 4 Oct 2020 12:34:45 +0100 Subject: [PATCH 40/44] Handle path exclusions --- staticanalysis/cpd.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index 6651870..9e21374 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -93,13 +93,13 @@ pipeline { sh """#!/bin/bash set -ev - mkdir "${PPDFOLDER}" + mkdir -p "${PPDFOLDER}" export PMD_JAVA_OPTS=-Xmx65536m "${PPD}/run.sh" cpd --minimum-tokens 100 --files . --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > "${PPDFOLDER}cpd.xml" """ } else { bat """ - mkdir "${PPDFOLDER}" + mkdir -p "${PPDFOLDER}" set PMD_JAVA_OPTS=-Xmx2048m "${PPD}/cpd.bat" --minimum-tokens 100 --files . --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > "${PPDFOLDER}cpd.xml" """ From 21bc371542991ea4c4964115b3e5dc8105c27bec Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 4 Oct 2020 12:43:41 +0100 Subject: [PATCH 41/44] Handle path exclusions --- staticanalysis/cpd.groovy | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index 9e21374..01cdc64 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -86,24 +86,27 @@ pipeline { def PPDFOLDER = "${STATICANALYSIS}/ppd" def EXCLUDE_PARAM = '' if (EXCLUDE_PATHS) { - EXCLUDE_PARAM = """--exclude "${EXCLUDE_PATHS.trim()}" """ - } - dir(SRC) { - if (isUnix()) { - sh """#!/bin/bash - set -ev - - mkdir -p "${PPDFOLDER}" - export PMD_JAVA_OPTS=-Xmx65536m - "${PPD}/run.sh" cpd --minimum-tokens 100 --files . --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > "${PPDFOLDER}cpd.xml" - """ - } else { - bat """ - mkdir -p "${PPDFOLDER}" - set PMD_JAVA_OPTS=-Xmx2048m - "${PPD}/cpd.bat" --minimum-tokens 100 --files . --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > "${PPDFOLDER}cpd.xml" - """ + EXCLUDE_PARAM = '--exclude "' + def exclude_path_list = EXCLUDE_PATHS.split(',') + for (exclude_path in exclude_path_list) { + EXCLUDE_PARAM += "${SRC}/${exclude_path.trim()}," } + EXCLUDE_PARAM += '"' + } + if (isUnix()) { + sh """#!/bin/bash + set -ev + + mkdir -p "${PPDFOLDER}" + export PMD_JAVA_OPTS=-Xmx65536m"${SRC}""${SRC}" + "${PPD}/run.sh" cpd --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > "${PPDFOLDER}cpd.xml" + """ + } else { + bat """ + mkdir -p "${PPDFOLDER}" + set PMD_JAVA_OPTS=-Xmx2048m + "${PPD}/cpd.bat" --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > "${PPDFOLDER}cpd.xml" + """ } recordIssues(tools: [ cpd(pattern: "**/cpd.xml", reportEncoding: 'UTF-8'), From edb44517747f02f2054bdcaaff4bb0cec729458b Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 4 Oct 2020 12:47:06 +0100 Subject: [PATCH 42/44] Handle path exclusions --- staticanalysis/cpd.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index 01cdc64..d4bf093 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -98,7 +98,7 @@ pipeline { set -ev mkdir -p "${PPDFOLDER}" - export PMD_JAVA_OPTS=-Xmx65536m"${SRC}""${SRC}" + export PMD_JAVA_OPTS=-Xmx65536m "${PPD}/run.sh" cpd --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > "${PPDFOLDER}cpd.xml" """ } else { From be93f030970c724c0cdeb48764e7ea8a34947071 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 4 Oct 2020 12:52:31 +0100 Subject: [PATCH 43/44] Handle path exclusions --- staticanalysis/cpd.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index d4bf093..6f3a33f 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -99,13 +99,13 @@ pipeline { mkdir -p "${PPDFOLDER}" export PMD_JAVA_OPTS=-Xmx65536m - "${PPD}/run.sh" cpd --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > "${PPDFOLDER}cpd.xml" + "${PPD}/run.sh" cpd --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > "${PPDFOLDER}/cpd.xml" """ } else { bat """ mkdir -p "${PPDFOLDER}" set PMD_JAVA_OPTS=-Xmx2048m - "${PPD}/cpd.bat" --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > "${PPDFOLDER}cpd.xml" + "${PPD}/cpd.bat" --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > "${PPDFOLDER}/cpd.xml" """ } recordIssues(tools: [ From 41ec5e4630bdac11f8d4315699637a4fbce42731 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 16 Oct 2020 11:00:08 +0100 Subject: [PATCH 44/44] Release_to_git: Handle the case where the URI to the source repo associated with a subsystem and product name has changed --- release/do.groovy | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/release/do.groovy b/release/do.groovy index 3221d25..9148572 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -1,3 +1,5 @@ +gh = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy") + markunstable = false unstablereason = "" @@ -373,7 +375,8 @@ def gitrelease(buildmeta, previousreleasemeta, String releaserepo, String source def releasecomponent(toplevelbuildmeta, buildinfo, String otherreleasetags, String dryrunpush) { def buildmeta = buildinfo.meta - def String uniquefolder = "${buildmeta.productinfo.productname}_${buildmeta.productinfo.subcomponentname}" + def uriconverted = gh.uniquereporootname(buildmeta.gitinfo.remoteurl) + def String uniquefolder = "${buildmeta.productinfo.productname}_${buildmeta.productinfo.subcomponentname}_${uriconverted}" def String uniquefolderforrepo = "${releaserepofolder}/${uniquefolder}" def String uniquefoldertemp = "${tempfolder}/${uniquefolder}" def String uniquefolderforsourcerepo = "${sourcerepofolder}/${uniquefolder}"