From 8073420970773a084f2277544dd80114df854da9 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 11 Nov 2017 10:39:37 +0000 Subject: [PATCH 01/96] add README --- README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 From 744ee5f3d0d0fb0b9e873fba5c3e72105c962266 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 11 Nov 2017 10:50:17 +0000 Subject: [PATCH 02/96] GIS-1621 - Add first jenkins groovy script --- ScriptTest/script_test_1.gsh | 75 ++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 ScriptTest/script_test_1.gsh diff --git a/ScriptTest/script_test_1.gsh b/ScriptTest/script_test_1.gsh new file mode 100644 index 0000000..6b3e988 --- /dev/null +++ b/ScriptTest/script_test_1.gsh @@ -0,0 +1,75 @@ +pipeline { + // agent { label 'Pemba' } + // agent { label 'floreana' } + agent { label 'tiger' } + // agent any + + stages { + stage('Checkout') { + steps { + checkout([$class: 'GitSCM', + branches: [[name: 'refs/heads/master']], + doGenerateSubmoduleConfigurations: false, + extensions: [[$class: 'RelativeTargetDirectory', + relativeTargetDir: 'arepo'], + [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false, timeout: 60], + [$class: 'CleanBeforeCheckout'], + [$class: 'CheckoutOption', timeout: 60]], + submoduleCfg: [], + userRemoteConfigs: [[url: 'git@hydra:danhawkins/testproject.git']]]) + script { + if (isUnix()) { + sh 'echo $WORKSPACE' + sh 'ls -lsR $WORKSPACE' + } + else { + bat 'echo %WORKSPACE%' + bat 'dir "%WORKSPACE%"' + } + } + } + } + stage('Build') { + steps { + script { + if (isUnix()) { + sh 'echo make $APARAMETER' + sh 'echo $WORKSPACE' + sh 'cat $WORKSPACE/arepo/README2.md' + } + else { + bat 'echo make "%APARAMETER%"' + bat 'echo %WORKSPACE%' + bat 'type "%WORKSPACE%\\arepo\\README2.md"' + } + } + } + } + stage('Test'){ + steps { + script { + if (isUnix()) { + sh 'echo make check' + sh 'echo do test' + } + else { + bat 'echo make check' + bat 'echo do test' + } + } + } + } + stage('Deploy') { + steps { + script { + if (isUnix()) { + sh 'echo make publish' + } + else { + bat 'echo make publish' + } + } + } + } + } +} From 8d0a7bbd170fef8f97021fa24b6ee7c307effa49 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 11 Nov 2017 17:22:37 +0000 Subject: [PATCH 03/96] GIS-1621 - Now working --- ScriptTest/script_test_1.gsh | 75 ------------ build/build.gsh | 222 +++++++++++++++++++++++++++++++++++ 2 files changed, 222 insertions(+), 75 deletions(-) delete mode 100644 ScriptTest/script_test_1.gsh create mode 100644 build/build.gsh diff --git a/ScriptTest/script_test_1.gsh b/ScriptTest/script_test_1.gsh deleted file mode 100644 index 6b3e988..0000000 --- a/ScriptTest/script_test_1.gsh +++ /dev/null @@ -1,75 +0,0 @@ -pipeline { - // agent { label 'Pemba' } - // agent { label 'floreana' } - agent { label 'tiger' } - // agent any - - stages { - stage('Checkout') { - steps { - checkout([$class: 'GitSCM', - branches: [[name: 'refs/heads/master']], - doGenerateSubmoduleConfigurations: false, - extensions: [[$class: 'RelativeTargetDirectory', - relativeTargetDir: 'arepo'], - [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false, timeout: 60], - [$class: 'CleanBeforeCheckout'], - [$class: 'CheckoutOption', timeout: 60]], - submoduleCfg: [], - userRemoteConfigs: [[url: 'git@hydra:danhawkins/testproject.git']]]) - script { - if (isUnix()) { - sh 'echo $WORKSPACE' - sh 'ls -lsR $WORKSPACE' - } - else { - bat 'echo %WORKSPACE%' - bat 'dir "%WORKSPACE%"' - } - } - } - } - stage('Build') { - steps { - script { - if (isUnix()) { - sh 'echo make $APARAMETER' - sh 'echo $WORKSPACE' - sh 'cat $WORKSPACE/arepo/README2.md' - } - else { - bat 'echo make "%APARAMETER%"' - bat 'echo %WORKSPACE%' - bat 'type "%WORKSPACE%\\arepo\\README2.md"' - } - } - } - } - stage('Test'){ - steps { - script { - if (isUnix()) { - sh 'echo make check' - sh 'echo do test' - } - else { - bat 'echo make check' - bat 'echo do test' - } - } - } - } - stage('Deploy') { - steps { - script { - if (isUnix()) { - sh 'echo make publish' - } - else { - bat 'echo make publish' - } - } - } - } - } -} diff --git a/build/build.gsh b/build/build.gsh new file mode 100644 index 0000000..500f20b --- /dev/null +++ b/build/build.gsh @@ -0,0 +1,222 @@ +pipeline { + // agent { label 'Pemba' } + // agent { label 'floreana' } + agent { label 'build' } + // agent any + stages { + stage('Checkout source') { + steps { + checkout([$class: 'GitSCM', + branches: [ + [name: 'origin/${BRANCH_NAME}'] + ], + doGenerateSubmoduleConfigurations: false, + extensions: [ + [$class: 'CleanBeforeCheckout'], + [$class: 'CloneOption', depth: 0, noTags: false, reference: '${REPO_ROOT}/newsw', shallow: false, timeout: 60], + [$class: 'CheckoutOption', timeout: 60], + [$class: 'RelativeTargetDirectory', relativeTargetDir: 'GitRepository'], + [$class: 'PathRestriction', excludedRegions: '', includedRegions: '''src/.* autobuild/.*'''] + ], + submoduleCfg: [ + ], + userRemoteConfigs: [ + [url: 'git@hydra:gis/newsw.git'] + ] + ]) + } + } + stage('Checkout dependencies') { + steps { + checkout([$class: 'GitSCM', + branches: [ + [name: 'refs/tags/${FD1200_FIRMWARE_RELEASE_VERSION}'] + ], + doGenerateSubmoduleConfigurations: false, + extensions: [ + [$class: 'CleanBeforeCheckout'], + [$class: 'CloneOption', depth: 0, noTags: false, reference: '${REPO_ROOT}/samba_fw_releases', shallow: true, timeout: 60], + [$class: 'CheckoutOption', timeout: 60], + [$class: 'RelativeTargetDirectory', relativeTargetDir: 'samba_fw'] + ], + submoduleCfg: [ + ], + userRemoteConfigs: [ + [url: 'git@hydra:gis/samba_fw_releases.git'] + ] + ]) + checkout([$class: 'GitSCM', + branches: [ + [name: 'refs/tags/${XR_1003_EMBEDDED_LOGIC_RELEASE_VERSION}'] + ], + doGenerateSubmoduleConfigurations: false, + extensions: [ + [$class: 'CleanBeforeCheckout'], + [$class: 'CloneOption', depth: 0, noTags: false, reference: '${REPO_ROOT}/HMB_XR_1003_Embeddded_Logic.git', shallow: true, timeout: 60], + [$class: 'CheckoutOption', timeout: 60], + [$class: 'RelativeTargetDirectory', relativeTargetDir: 'xr1003_el'] + ], + submoduleCfg: [ + ], + userRemoteConfigs: [ + [url: 'git@hydra:releases/HMB_XR_1003_Embeddded_Logic.git'] + ] + ]) + checkout([$class: 'GitSCM', + branches: [ + [name: 'refs/tags/${VERSION_STAMPING_VERSION}'] + ], + doGenerateSubmoduleConfigurations: false, + extensions: [ + [$class: 'CleanBeforeCheckout'], + [$class: 'CloneOption', noTags: false, reference: '${REPO_ROOT}\\ver_stamping_releases', shallow: true, timeout: 60], + [$class: 'CheckoutOption', timeout: 60], + [$class: 'RelativeTargetDirectory', relativeTargetDir: 'ver_stamping'] + ], + submoduleCfg: [], + userRemoteConfigs: [ + [url: 'git@hydra:releases/ver_stamping_releases.git'] + ] + ]) + checkout([$class: 'GitSCM', + branches: [ + [name: 'origin/master'] + ], + doGenerateSubmoduleConfigurations: false, + extensions: [ + [$class: 'CleanBeforeCheckout'], + [$class: 'CloneOption', noTags: false, reference: '${REPO_ROOT}\\print_release_difference', shallow: true, timeout: 60], + [$class: 'CheckoutOption', timeout: 60], + [$class: 'RelativeTargetDirectory', relativeTargetDir: 'print_release_difference'] + ], + submoduleCfg: [ + ], + userRemoteConfigs: [ + [url: 'git@hydra:gis/print_release_difference.git'] + ] + ]) + + } + } + stage('Setup links') { + steps { + bat ''' + @echo on' + rmdir jobscripts + mklink /J jobscripts GitRepository\\autobuild\\build + rmdir jobscripts_common + mklink /J jobscripts_common "GitRepository\\autobuild\\common" + rmdir security + mklink /J security "GitRepository\\autobuild\\security" + rmdir src + mklink /J src GitRepository\\src + if errorlevel 1 exit /b 1 + ''' + } + } + stage('Imports and exports') { + steps { + bat ''' + call jobscripts\\reset_imports_and_exports.bat + if errorlevel 1 exit /b 1 + ''' + } + } + stage('Clean') { + steps { + bat ''' + call jobscripts\\clean.bat + if errorlevel 1 exit /b 1 + ''' + } + } + stage('Generating version number') { + steps { + bat ''' + call jobscripts\\versioning.bat + if errorlevel 1 exit /b 1 + ''' + script { + env.BUILD_STAMP = readFile('version/buildstamp.txt').trim() + env.SRC_REVISION = readFile('version/revision.txt').trim() + } + } + } + stage('Generating version differences lists') { + steps { + bat ''' + set CURRENT_RELEASE=origin/%BRANCH_NAME% + set PREVIOUS_RELEASE=%PREVIOUS_RELEASE_BRANCH_NAME% + set WORKING_PATH=%WORKSPACE%/GitRepository + set DIFFERENCE_OPTIONS="opposite notcommon" + "%PYTHON34%" "%WORKSPACE%/print_release_difference/show_release_differences.py" > "%WORKSPACE%\\version\\differences.txt" + if errorlevel 1 exit /b 1 + ''' + } + } + stage('Inherit version imports') { + steps { + bat ''' + call jobscripts\\version_imports.bat + if errorlevel 1 exit /b 1 + ''' + } + } + stage('Version stamp files') { + steps { + bat ''' + call jobscripts\\versionrcfiles.bat + if errorlevel 1 exit /b 1 + ''' + } + } + stage('Compile') { + steps { + bat ''' + call jobscripts\\autobuild.bat + if errorlevel 1 exit /b 1 + ''' + } + } + stage('Make SDK source') { + steps { + bat ''' + call jobscripts\\make_src_sdk.bat + if errorlevel 1 exit /b 1 + ''' + } + } + stage('Build SDK source') { + steps { + bat ''' + call jobscripts\\build_sdk.bat + if errorlevel 1 exit /b 1 + ''' + } + } + stage('Prepare exports') { + steps { + bat ''' + call jobscripts\\export.bat + if errorlevel 1 exit /b 1 + ''' + } + } + stage('Scan for warnings') { + steps { + warnings canComputeNew: false, canResolveRelativePaths: false, categoriesPattern: '', consoleParsers: [[parserName: 'MSBuild']], defaultEncoding: '', excludePattern: '', healthy: '', includePattern: '', messagesPattern: '', unHealthy: '' + } + } + stage('Archiving artifacts') { + steps { + archiveArtifacts 'bin/**,scripts/**,version/**,pipeline/**,sdk_source/**,sdk_source_tree_built.txt,ildasm/**' + } + } + } + post { + success { + echo 'Succeeded build' + } + } +} + From 43beb78946205895782c057a1fb3ca7cb02d05a1 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 11 Nov 2017 17:42:40 +0000 Subject: [PATCH 04/96] GIS-1621 - Try to parse output --- build/build.gsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/build.gsh b/build/build.gsh index 500f20b..ffc9773 100644 --- a/build/build.gsh +++ b/build/build.gsh @@ -217,6 +217,9 @@ pipeline { success { echo 'Succeeded build' } + always { + step([$class: 'LogParserPublisher', parsingRulesPath: 'GitRepository/autobuild/build/log parsing rules/vs.txt', useProjectRule: true]) + } } } From 9814e14fb56a609bccaeaa3ee7e4b078153af419 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 12 Nov 2017 09:54:04 +0000 Subject: [PATCH 05/96] GIS-1621 - Try to parse output --- build/build.gsh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/build/build.gsh b/build/build.gsh index ffc9773..8e49430 100644 --- a/build/build.gsh +++ b/build/build.gsh @@ -214,12 +214,13 @@ pipeline { } } post { - success { + always { + echo 'Post-build' + //step([$class: 'LogParserPublisher', parsingRulesPath: 'GitRepository/autobuild/build/log parsing rules/vs.txt', useProjectRule: true]) + } + success { echo 'Succeeded build' } - always { - step([$class: 'LogParserPublisher', parsingRulesPath: 'GitRepository/autobuild/build/log parsing rules/vs.txt', useProjectRule: true]) - } - } + } } From 4b7d20c01db5e2d5af7607d5cf7535c34e30a0bd Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 12 Nov 2017 10:17:37 +0000 Subject: [PATCH 06/96] GIS-1621 - Try to parse output --- build/build.gsh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/build/build.gsh b/build/build.gsh index 8e49430..499af4c 100644 --- a/build/build.gsh +++ b/build/build.gsh @@ -218,8 +218,19 @@ pipeline { echo 'Post-build' //step([$class: 'LogParserPublisher', parsingRulesPath: 'GitRepository/autobuild/build/log parsing rules/vs.txt', useProjectRule: true]) } - success { - echo 'Succeeded build' + success { + echo 'Succeeded build' + build job: '2.0.x_test', + parameters: [ + string(name: 'TEST_PORT', value: '2016'), + booleanParam(name: 'PIPELINE_NO_TEST', value: false), + booleanParam(name: 'USING_GIT', value: true), + string(name: 'REPEAT_COUNT', value: '0'), + booleanParam(name: 'QUICK_TEST', value: true), + booleanParam(name: 'LIST_TESTS', value: false), + string(name: 'BRANCH', value: 'master') + ], + propagate: false } } } From e84879a84501c56ed7c3e8acbfc5ad0efb5af4e3 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 12 Nov 2017 15:09:03 +0000 Subject: [PATCH 07/96] GIS-1621 - Try to parse output --- build/build.gsh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/build/build.gsh b/build/build.gsh index 499af4c..3781d3c 100644 --- a/build/build.gsh +++ b/build/build.gsh @@ -204,7 +204,18 @@ pipeline { } stage('Scan for warnings') { steps { - warnings canComputeNew: false, canResolveRelativePaths: false, categoriesPattern: '', consoleParsers: [[parserName: 'MSBuild']], defaultEncoding: '', excludePattern: '', healthy: '', includePattern: '', messagesPattern: '', unHealthy: '' + warnings canComputeNew: false, + canResolveRelativePaths: false, + categoriesPattern: '', + consoleParsers: [ + [parserName: 'MSBuild'] + ], + defaultEncoding: '', + excludePattern: '', + healthy: '', + includePattern: '', + messagesPattern: '', + unHealthy: '' } } stage('Archiving artifacts') { @@ -216,11 +227,13 @@ pipeline { post { always { echo 'Post-build' - //step([$class: 'LogParserPublisher', parsingRulesPath: 'GitRepository/autobuild/build/log parsing rules/vs.txt', useProjectRule: true]) + } + failure { + step([$class: 'LogParserPublisher', parsingRulesPath: 'GitRepository/autobuild/build/log parsing rules/vs.txt', useProjectRule: true]) } success { echo 'Succeeded build' - build job: '2.0.x_test', + build job: '${BRANCH_NAME}_test', parameters: [ string(name: 'TEST_PORT', value: '2016'), booleanParam(name: 'PIPELINE_NO_TEST', value: false), From 60127bfce18e7379930e07fa686996b77c8c1a76 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 12 Nov 2017 15:10:54 +0000 Subject: [PATCH 08/96] GIS-1621 - Try to parse output --- build/build.gsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/build.gsh b/build/build.gsh index 3781d3c..8065b13 100644 --- a/build/build.gsh +++ b/build/build.gsh @@ -243,7 +243,7 @@ pipeline { booleanParam(name: 'LIST_TESTS', value: false), string(name: 'BRANCH', value: 'master') ], - propagate: false + propagate: true } } } From dafdaa9a08e43a9d5368fbd13faa22f4ff32c987 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 12 Nov 2017 15:44:17 +0000 Subject: [PATCH 09/96] GIS-1621 - Expand variables properly; Format script --- build/build.gsh | 99 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 76 insertions(+), 23 deletions(-) diff --git a/build/build.gsh b/build/build.gsh index 8065b13..922899c 100644 --- a/build/build.gsh +++ b/build/build.gsh @@ -8,15 +8,28 @@ pipeline { steps { checkout([$class: 'GitSCM', branches: [ - [name: 'origin/${BRANCH_NAME}'] + [name: "origin/${BRANCH_NAME}"] ], doGenerateSubmoduleConfigurations: false, extensions: [ [$class: 'CleanBeforeCheckout'], - [$class: 'CloneOption', depth: 0, noTags: false, reference: '${REPO_ROOT}/newsw', shallow: false, timeout: 60], - [$class: 'CheckoutOption', timeout: 60], - [$class: 'RelativeTargetDirectory', relativeTargetDir: 'GitRepository'], - [$class: 'PathRestriction', excludedRegions: '', includedRegions: '''src/.* autobuild/.*'''] + [$class: 'CloneOption', + depth: 0, + noTags: false, + reference: "${REPO_ROOT}/newsw", + shallow: false, + timeout: 60 + ], + [$class: 'CheckoutOption', + timeout: 60 + ], + [$class: 'RelativeTargetDirectory', + relativeTargetDir: 'GitRepository' + ], + [$class: 'PathRestriction', + excludedRegions: '', + includedRegions: '''src/.* autobuild/.*''' + ] ], submoduleCfg: [ ], @@ -30,14 +43,24 @@ pipeline { steps { checkout([$class: 'GitSCM', branches: [ - [name: 'refs/tags/${FD1200_FIRMWARE_RELEASE_VERSION}'] + [name: "refs/tags/${FD1200_FIRMWARE_RELEASE_VERSION}"] ], doGenerateSubmoduleConfigurations: false, extensions: [ [$class: 'CleanBeforeCheckout'], - [$class: 'CloneOption', depth: 0, noTags: false, reference: '${REPO_ROOT}/samba_fw_releases', shallow: true, timeout: 60], - [$class: 'CheckoutOption', timeout: 60], - [$class: 'RelativeTargetDirectory', relativeTargetDir: 'samba_fw'] + [$class: 'CloneOption', + depth: 0, + noTags: false, + reference: "${REPO_ROOT}/samba_fw_releases", + shallow: true, + timeout: 60 + ], + [$class: 'CheckoutOption', + timeout: 60 + ], + [$class: 'RelativeTargetDirectory', + relativeTargetDir: 'samba_fw' + ] ], submoduleCfg: [ ], @@ -47,14 +70,24 @@ pipeline { ]) checkout([$class: 'GitSCM', branches: [ - [name: 'refs/tags/${XR_1003_EMBEDDED_LOGIC_RELEASE_VERSION}'] + [name: "refs/tags/${XR_1003_EMBEDDED_LOGIC_RELEASE_VERSION}"] ], doGenerateSubmoduleConfigurations: false, extensions: [ [$class: 'CleanBeforeCheckout'], - [$class: 'CloneOption', depth: 0, noTags: false, reference: '${REPO_ROOT}/HMB_XR_1003_Embeddded_Logic.git', shallow: true, timeout: 60], - [$class: 'CheckoutOption', timeout: 60], - [$class: 'RelativeTargetDirectory', relativeTargetDir: 'xr1003_el'] + [$class: 'CloneOption', + depth: 0, + noTags: false, + reference: "${REPO_ROOT}/HMB_XR_1003_Embeddded_Logic.git", + shallow: true, + timeout: 60 + ], + [$class: 'CheckoutOption', + timeout: 60 + ], + [$class: 'RelativeTargetDirectory', + relativeTargetDir: 'xr1003_el' + ] ], submoduleCfg: [ ], @@ -64,14 +97,23 @@ pipeline { ]) checkout([$class: 'GitSCM', branches: [ - [name: 'refs/tags/${VERSION_STAMPING_VERSION}'] + [name: "refs/tags/${VERSION_STAMPING_VERSION}"] ], doGenerateSubmoduleConfigurations: false, extensions: [ [$class: 'CleanBeforeCheckout'], - [$class: 'CloneOption', noTags: false, reference: '${REPO_ROOT}\\ver_stamping_releases', shallow: true, timeout: 60], - [$class: 'CheckoutOption', timeout: 60], - [$class: 'RelativeTargetDirectory', relativeTargetDir: 'ver_stamping'] + [$class: 'CloneOption', + noTags: false, + reference: "${REPO_ROOT}/ver_stamping_releases", + shallow: true, + timeout: 60 + ], + [$class: 'CheckoutOption', + timeout: 60 + ], + [$class: 'RelativeTargetDirectory', + relativeTargetDir: 'ver_stamping' + ] ], submoduleCfg: [], userRemoteConfigs: [ @@ -85,9 +127,18 @@ pipeline { doGenerateSubmoduleConfigurations: false, extensions: [ [$class: 'CleanBeforeCheckout'], - [$class: 'CloneOption', noTags: false, reference: '${REPO_ROOT}\\print_release_difference', shallow: true, timeout: 60], - [$class: 'CheckoutOption', timeout: 60], - [$class: 'RelativeTargetDirectory', relativeTargetDir: 'print_release_difference'] + [$class: 'CloneOption', + noTags: false, + reference: "${REPO_ROOT}/print_release_difference", + shallow: true, + timeout: 60 + ], + [$class: 'CheckoutOption', + timeout: 60 + ], + [$class: 'RelativeTargetDirectory', + relativeTargetDir: 'print_release_difference' + ] ], submoduleCfg: [ ], @@ -229,11 +280,14 @@ pipeline { echo 'Post-build' } failure { - step([$class: 'LogParserPublisher', parsingRulesPath: 'GitRepository/autobuild/build/log parsing rules/vs.txt', useProjectRule: true]) + step([$class: 'LogParserPublisher', + parsingRulesPath: 'GitRepository/autobuild/build/log parsing rules/vs.txt', + useProjectRule: true + ]) } success { echo 'Succeeded build' - build job: '${BRANCH_NAME}_test', + build job: "${BRANCH_NAME}_test", parameters: [ string(name: 'TEST_PORT', value: '2016'), booleanParam(name: 'PIPELINE_NO_TEST', value: false), @@ -247,4 +301,3 @@ pipeline { } } } - From b86e13a3690e13d90d451a683d1ed8ef5ca42d8d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 12 Nov 2017 16:06:51 +0000 Subject: [PATCH 10/96] GIS-1621 - Don't trigger subsequent builds; Let them trigger of this build --- build/build.gsh | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/build/build.gsh b/build/build.gsh index 922899c..e284106 100644 --- a/build/build.gsh +++ b/build/build.gsh @@ -280,6 +280,7 @@ pipeline { echo 'Post-build' } failure { + echo 'Failed build' step([$class: 'LogParserPublisher', parsingRulesPath: 'GitRepository/autobuild/build/log parsing rules/vs.txt', useProjectRule: true @@ -287,17 +288,6 @@ pipeline { } success { echo 'Succeeded build' - build job: "${BRANCH_NAME}_test", - parameters: [ - string(name: 'TEST_PORT', value: '2016'), - booleanParam(name: 'PIPELINE_NO_TEST', value: false), - booleanParam(name: 'USING_GIT', value: true), - string(name: 'REPEAT_COUNT', value: '0'), - booleanParam(name: 'QUICK_TEST', value: true), - booleanParam(name: 'LIST_TESTS', value: false), - string(name: 'BRANCH', value: 'master') - ], - propagate: true } } } From 8f30453ca6903922f740b404039a1632c59eb8e4 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 28 Nov 2017 11:42:56 +0000 Subject: [PATCH 11/96] add README --- README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 From c62d2d3096fe786680a89f3f0d92b0689bb48515 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 28 Nov 2017 16:51:58 +0000 Subject: [PATCH 12/96] Put a newline in the git included regions filter --- build/build.gsh | 141 ++++++++++++++++++++++++------------------------ 1 file changed, 71 insertions(+), 70 deletions(-) diff --git a/build/build.gsh b/build/build.gsh index e284106..a398a96 100644 --- a/build/build.gsh +++ b/build/build.gsh @@ -14,22 +14,23 @@ pipeline { extensions: [ [$class: 'CleanBeforeCheckout'], [$class: 'CloneOption', - depth: 0, - noTags: false, - reference: "${REPO_ROOT}/newsw", - shallow: false, - timeout: 60 - ], + depth: 0, + noTags: false, + reference: "${REPO_ROOT}/newsw", + shallow: false, + timeout: 60 + ], [$class: 'CheckoutOption', - timeout: 60 - ], + timeout: 60 + ], [$class: 'RelativeTargetDirectory', - relativeTargetDir: 'GitRepository' - ], + relativeTargetDir: 'GitRepository' + ], [$class: 'PathRestriction', - excludedRegions: '', - includedRegions: '''src/.* autobuild/.*''' - ] + excludedRegions: '', + includedRegions: '''src/.* + autobuild/.*''' + ] ], submoduleCfg: [ ], @@ -49,18 +50,18 @@ pipeline { extensions: [ [$class: 'CleanBeforeCheckout'], [$class: 'CloneOption', - depth: 0, - noTags: false, - reference: "${REPO_ROOT}/samba_fw_releases", - shallow: true, - timeout: 60 - ], + depth: 0, + noTags: false, + reference: "${REPO_ROOT}/samba_fw_releases", + shallow: true, + timeout: 60 + ], [$class: 'CheckoutOption', - timeout: 60 - ], + timeout: 60 + ], [$class: 'RelativeTargetDirectory', - relativeTargetDir: 'samba_fw' - ] + relativeTargetDir: 'samba_fw' + ] ], submoduleCfg: [ ], @@ -76,18 +77,18 @@ pipeline { extensions: [ [$class: 'CleanBeforeCheckout'], [$class: 'CloneOption', - depth: 0, - noTags: false, - reference: "${REPO_ROOT}/HMB_XR_1003_Embeddded_Logic.git", - shallow: true, - timeout: 60 - ], + depth: 0, + noTags: false, + reference: "${REPO_ROOT}/HMB_XR_1003_Embeddded_Logic.git", + shallow: true, + timeout: 60 + ], [$class: 'CheckoutOption', - timeout: 60 - ], + timeout: 60 + ], [$class: 'RelativeTargetDirectory', - relativeTargetDir: 'xr1003_el' - ] + relativeTargetDir: 'xr1003_el' + ] ], submoduleCfg: [ ], @@ -103,17 +104,17 @@ pipeline { extensions: [ [$class: 'CleanBeforeCheckout'], [$class: 'CloneOption', - noTags: false, - reference: "${REPO_ROOT}/ver_stamping_releases", - shallow: true, - timeout: 60 - ], + noTags: false, + reference: "${REPO_ROOT}/ver_stamping_releases", + shallow: true, + timeout: 60 + ], [$class: 'CheckoutOption', - timeout: 60 - ], + timeout: 60 + ], [$class: 'RelativeTargetDirectory', - relativeTargetDir: 'ver_stamping' - ] + relativeTargetDir: 'ver_stamping' + ] ], submoduleCfg: [], userRemoteConfigs: [ @@ -128,17 +129,17 @@ pipeline { extensions: [ [$class: 'CleanBeforeCheckout'], [$class: 'CloneOption', - noTags: false, - reference: "${REPO_ROOT}/print_release_difference", - shallow: true, - timeout: 60 - ], + noTags: false, + reference: "${REPO_ROOT}/print_release_difference", + shallow: true, + timeout: 60 + ], [$class: 'CheckoutOption', - timeout: 60 - ], + timeout: 60 + ], [$class: 'RelativeTargetDirectory', - relativeTargetDir: 'print_release_difference' - ] + relativeTargetDir: 'print_release_difference' + ] ], submoduleCfg: [ ], @@ -256,17 +257,17 @@ pipeline { stage('Scan for warnings') { steps { warnings canComputeNew: false, - canResolveRelativePaths: false, - categoriesPattern: '', - consoleParsers: [ - [parserName: 'MSBuild'] - ], - defaultEncoding: '', - excludePattern: '', - healthy: '', - includePattern: '', - messagesPattern: '', - unHealthy: '' + canResolveRelativePaths: false, + categoriesPattern: '', + consoleParsers: [ + [parserName: 'MSBuild'] + ], + defaultEncoding: '', + excludePattern: '', + healthy: '', + includePattern: '', + messagesPattern: '', + unHealthy: '' } } stage('Archiving artifacts') { @@ -276,16 +277,16 @@ pipeline { } } post { - always { + always { echo 'Post-build' - } - failure { + } + failure { echo 'Failed build' - step([$class: 'LogParserPublisher', - parsingRulesPath: 'GitRepository/autobuild/build/log parsing rules/vs.txt', - useProjectRule: true - ]) - } + step([$class: 'LogParserPublisher', + parsingRulesPath: 'GitRepository/autobuild/build/log parsing rules/vs.txt', + useProjectRule: true + ]) + } success { echo 'Succeeded build' } From 3f2f2851681b8aa77c4cac08e1dd5593ec6e4ab7 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 28 Nov 2017 17:04:43 +0000 Subject: [PATCH 13/96] Directory filtering doesn't seem to be working - resulting in no build triggers - so removing it --- build/build.gsh | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/build/build.gsh b/build/build.gsh index a398a96..1051f40 100644 --- a/build/build.gsh +++ b/build/build.gsh @@ -14,23 +14,18 @@ pipeline { extensions: [ [$class: 'CleanBeforeCheckout'], [$class: 'CloneOption', - depth: 0, - noTags: false, - reference: "${REPO_ROOT}/newsw", - shallow: false, - timeout: 60 - ], + depth: 0, + noTags: false, + reference: "${REPO_ROOT}/newsw", + shallow: false, + timeout: 60 + ], [$class: 'CheckoutOption', - timeout: 60 - ], + timeout: 60 + ], [$class: 'RelativeTargetDirectory', - relativeTargetDir: 'GitRepository' - ], - [$class: 'PathRestriction', - excludedRegions: '', - includedRegions: '''src/.* - autobuild/.*''' - ] + relativeTargetDir: 'GitRepository' + ], ], submoduleCfg: [ ], From 20dd451bc8bc4f36957147469141f0c50d5fb7ed Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 28 Nov 2017 20:59:01 +0000 Subject: [PATCH 14/96] Add a second test file --- README2.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 README2.md diff --git a/README2.md b/README2.md new file mode 100644 index 0000000..e69de29 From f671337ae8d333c94ee648d85d53ab91e64be610 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 28 Nov 2017 21:00:04 +0000 Subject: [PATCH 15/96] Merge commit '20dd451bc8bc4f36957147469141f0c50d5fb7ed' --- README2.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 README2.md diff --git a/README2.md b/README2.md new file mode 100644 index 0000000..e69de29 From 18be423194cddea3e9f72ae71dccca2d817f316e Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 28 Nov 2017 21:35:34 +0000 Subject: [PATCH 16/96] Add a test groovy script --- test.gsh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 test.gsh diff --git a/test.gsh b/test.gsh new file mode 100644 index 0000000..a38bfaf --- /dev/null +++ b/test.gsh @@ -0,0 +1,6 @@ +// Methods in this file will end up as object methods on the object that load returns. +def lookAtThis(String whoAreYou) { + echo "Look at this, ${whoAreYou}! You loaded this from another file!" +} + +return this; From a9b77d0d121b0c27ea7e50458b040df820c15fd0 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 28 Nov 2017 21:35:34 +0000 Subject: [PATCH 17/96] Add a test groovy script --- test.gsh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 test.gsh diff --git a/test.gsh b/test.gsh new file mode 100644 index 0000000..a38bfaf --- /dev/null +++ b/test.gsh @@ -0,0 +1,6 @@ +// Methods in this file will end up as object methods on the object that load returns. +def lookAtThis(String whoAreYou) { + echo "Look at this, ${whoAreYou}! You loaded this from another file!" +} + +return this; From 51b4b03be8bc3eb71be393c527a34e7819766023 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 28 Nov 2017 21:57:56 +0000 Subject: [PATCH 18/96] Add a test groovy script --- test.gsh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 test.gsh diff --git a/test.gsh b/test.gsh new file mode 100644 index 0000000..23fcfc0 --- /dev/null +++ b/test.gsh @@ -0,0 +1,7 @@ +// Methods in this file will end up as object methods on the object that load returns. +def lookAtThis(String whoAreYou) { + echo "Look at this, ${whoAreYou}! You loaded this from another file!" +} + +return this; + From 61a6840f7c6de1def6be97283bd131c934af4a8b Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 28 Nov 2017 23:58:55 +0000 Subject: [PATCH 19/96] Start of versioning script --- versionnumbering/versioninfo.gsh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 versionnumbering/versioninfo.gsh diff --git a/versionnumbering/versioninfo.gsh b/versionnumbering/versioninfo.gsh new file mode 100644 index 0000000..579b976 --- /dev/null +++ b/versionnumbering/versioninfo.gsh @@ -0,0 +1,29 @@ +// Methods in this file will end up as object methods on the object that load returns. + +def makeVersionFolder(String versionFolder) { + dir("${versionFolder}") { + + + + + + + +def generateVersionFiles(String versionFolder, + Integer BaseGitNumber, + String SrcFolder, + String SrcBranch) { + echo """Building version folder at: ${versionFolder} + base git number: ${BaseGitNumber} + source folder: ${SrcFolder} + source branch: ${SrcBranch}""" + + dir + + + +def lookAtThis(String whoAreYou) { + echo "Look at this, ${whoAreYou}! You loaded this from another file!" +} + +return this; From 76339b9b91f4bc895e05dd134f5234c389456a4f Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 28 Nov 2017 23:58:55 +0000 Subject: [PATCH 20/96] Start of versioning script --- versionnumbering/versioninfo.gsh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 versionnumbering/versioninfo.gsh diff --git a/versionnumbering/versioninfo.gsh b/versionnumbering/versioninfo.gsh new file mode 100644 index 0000000..579b976 --- /dev/null +++ b/versionnumbering/versioninfo.gsh @@ -0,0 +1,29 @@ +// Methods in this file will end up as object methods on the object that load returns. + +def makeVersionFolder(String versionFolder) { + dir("${versionFolder}") { + + + + + + + +def generateVersionFiles(String versionFolder, + Integer BaseGitNumber, + String SrcFolder, + String SrcBranch) { + echo """Building version folder at: ${versionFolder} + base git number: ${BaseGitNumber} + source folder: ${SrcFolder} + source branch: ${SrcBranch}""" + + dir + + + +def lookAtThis(String whoAreYou) { + echo "Look at this, ${whoAreYou}! You loaded this from another file!" +} + +return this; From 9f307dd502323554587e129f7235eccfe2ea8970 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 30 Nov 2017 18:25:01 +0000 Subject: [PATCH 21/96] Add python script and eclipse project files for version numbering --- .project | 17 +++ .pydevproject | 8 ++ versionnumbering/versioninfo.py | 192 ++++++++++++++++++++++++++++++++ 3 files changed, 217 insertions(+) create mode 100644 .project create mode 100644 .pydevproject create mode 100644 versionnumbering/versioninfo.py diff --git a/.project b/.project new file mode 100644 index 0000000..e329c3f --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + Common Build Scripts + + + + + + org.python.pydev.PyDevBuilder + + + + + + org.python.pydev.pythonNature + + diff --git a/.pydevproject b/.pydevproject new file mode 100644 index 0000000..d111c07 --- /dev/null +++ b/.pydevproject @@ -0,0 +1,8 @@ + + + +/${PROJECT_DIR_NAME} + +python interpreter +python35 + diff --git a/versionnumbering/versioninfo.py b/versionnumbering/versioninfo.py new file mode 100644 index 0000000..0567097 --- /dev/null +++ b/versionnumbering/versioninfo.py @@ -0,0 +1,192 @@ +# encoding: utf-8 +''' +versionnumbering -- shortdesc + +versionnumbering generates a version folder with a common set of version information files in it + +@author: dan + +@copyright: 2017 Global Inkjet Systems Ltd. All rights reserved. +''' +import os +import sys +import shutil +import subprocess + +from argparse import ArgumentParser +from argparse import RawDescriptionHelpFormatter + +__all__ = [] +__version__ = 0.1 +__date__ = '2017-11-29' +__updated__ = '2017-11-29' + +def resetFolder(versionfolder): + print("Removing folders and contents of: {0}".format(versionfolder)) + try: + shutil.rmtree(versionfolder) + except FileNotFoundError: + pass + + print("Creating folder: {0}".format(versionfolder)) + os.makedirs(versionfolder) + +def getGitRevision(gitrootpath, basenumber): + cwd = os.getcwd() + + path = os.path.expanduser(gitrootpath) + print("Changing current working directory to: {0}".format(path)) + os.chdir(path) + + gitvar = "GIT_EXECUTABLE" + if gitvar in os.environ and os.environ[gitvar]: + gitexecutable = os.environ[gitvar] + else: + print("Expecting GIT_EXECUTABLE environment variable to have path to git. Defaulting to 'git'") + gitexecutable = "git" + + print("Determining revision info using git command: {0}".format(gitexecutable)) + completed = subprocess.run([gitexecutable, "rev-list", "HEAD", "--count"], stdout=subprocess.PIPE) + print("Command {0} returned: {1}".format(completed.args, completed.returncode)) + changecount = completed.stdout.decode("utf-8").strip() + print("Change count: {0}".format(changecount)) + adjustedchangecount = int(changecount) + int(basenumber) + print("Adjusted change count: {0}".format(adjustedchangecount)) + + print("Determining current revision info using git command: {0}".format(gitexecutable)) + completed = subprocess.run([gitexecutable, "rev-parse", "HEAD"], stdout=subprocess.PIPE) + print("Command {0} returned: {1}".format(completed.args, completed.returncode)) + revision = completed.stdout.decode("utf-8").strip() + print("Revision: {0}".format(revision)) + + os.chdir(cwd) + print("Restored current working directory to: {0}".format(cwd)) + + return (adjustedchangecount, revision) + +def getVersionPrefix(sourcebranch): + print("Determining version number prefix from source branch name: {0}".format(sourcebranch)) + + defaultversionprefix = "1.30000.0" + splits = sourcebranch.split('/') + if len(splits) < 1: + print("Source branch name is invalid. Defaulting to: {0}".format(defaultversionprefix)) + return defaultversionprefix + + sourcebranch = splits[-1] + + if sourcebranch.lower().endswith("master"): # Special case + return "1.20000.0." + + splits = sourcebranch.split('.') + versionprefix = "" + if len(splits) < 1: + print("This source branch name has no decimal points in its name so defaulting to: {0}".format(defaultversionprefix)) + versionprefix = defaultversionprefix + else: + splitnumbercount = 0 + for split in splits: + if split.isdigit(): + versionprefix += split + "." + splitnumbercount += 1 + else: + break + if splitnumbercount > 2: + break + if splitnumbercount == 0: + print("No leading numbers were found in source branch name so defaulting to: {0}".format(defaultversionprefix)) + versionprefix = defaultversionprefix + elif splitnumbercount == 1: + versionprefix += "0.0." + elif splitnumbercount == 2: + versionprefix += "0." + + print("Determined version prefix to be: {0}".format(versionprefix)) + return versionprefix + +def writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevision, buildnumber, buildstamp): + with open(os.path.join(versionfolder, "buildjobname.txt"), 'w') as f: + f.write(buildjobname) + + with open(os.path.join(versionfolder, "prefix.txt"), 'w') as f: + f.write(versionprefix) + + with open(os.path.join(versionfolder, "revision.txt"), 'w') as f: + f.write(gitrevision) + + with open(os.path.join(versionfolder, "buildnumber.txt"), 'w') as f: + f.write(buildnumber) + + with open(os.path.join(versionfolder, "buildstamp.txt"), 'w') as f: + f.write(buildstamp) + +def main(argv=None): # IGNORE:C0111 + '''Command line options.''' + + if argv is None: + argv = sys.argv + else: + sys.argv.extend(argv) + + program_name = os.path.basename(sys.argv[0]) + program_version = "v%s" % __version__ + program_build_date = str(__updated__) + program_version_message = '%%(prog)s %s (%s)' % (program_version, program_build_date) + program_shortdesc = __import__('__main__').__doc__.split("\n")[1] + program_license = '''%s + + Created by dan on %s. + Copyright 2017 Global Inkjet Systems Ltd. All rights reserved. + + Distributed on an "AS IS" basis without warranties + or conditions of any kind, either express or implied. + +USAGE +''' % (program_shortdesc, str(__date__)) + + try: + # Setup argument parser + parser = ArgumentParser(description=program_license, formatter_class=RawDescriptionHelpFormatter) + parser.add_argument("-s", "--sourcebranch", dest="sourcebranch", action="store", default="origin/master", help="source branch name to discover version number [default: %(default)s]") + parser.add_argument("-v", "--versionfolder", dest="versionfolder", action="store", default="version", help="version folder to be created [default: %(default)s]") + parser.add_argument("-g", "--gitroot", dest="gitrootfolder", action="store", default="GitRepository", help="root path of source files [default: %(default)s]") + parser.add_argument("-b", "--baseversionnumber", dest="baseversionnumber", action="store", default=int(1000), help="base git version number [default: %(default)s]") + parser.add_argument("-j", "--buildjobname", dest="buildjobname", action="store", default="-", help="build job name [default: %(default)s]") + parser.add_argument("-n", "--buildnumber", dest="buildnumber", action="store", default="1", help="build number [default: %(default)s]") + + # Process arguments + args = parser.parse_args() + + sourcebranch = args.sourcebranch + versionfolder = args.versionfolder + gitrootfolder = args.gitrootfolder + baseversionnumber = args.baseversionnumber + buildjobname = args.buildjobname + buildnumber = args.buildnumber + + print("Source branch:", sourcebranch, "version folder:", versionfolder, "Git root:", gitrootfolder) + print("Base version number:", baseversionnumber, "Build job name:", buildjobname, "Build number:", buildnumber) + + resetFolder(versionfolder) + + (gitrevisioncount, gitrevision) = getGitRevision(gitrootfolder, baseversionnumber) + + versionprefix = getVersionPrefix(sourcebranch) + + buildstamp = versionprefix + str(gitrevisioncount) + print("Build stamp is: {0}".format(buildstamp)) + + writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevision, buildnumber, buildstamp) + + return 0 + except Exception as e: + print("Error while creating version info:", e.__repr__()) + return 1 + except Exception as e: + indent = len(program_name) * " " + print(program_name + ": " + repr(e) + "\n") + print(indent + " for help use --help") + return 2 + +if __name__ == "__main__": + sys.exit(main()) From a63889509d3e7ba0961051d2618bba51840deb8f Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 30 Nov 2017 18:25:01 +0000 Subject: [PATCH 22/96] Add python script and eclipse project files for version numbering --- .project | 17 +++ .pydevproject | 8 ++ versionnumbering/versioninfo.py | 192 ++++++++++++++++++++++++++++++++ 3 files changed, 217 insertions(+) create mode 100644 .project create mode 100644 .pydevproject create mode 100644 versionnumbering/versioninfo.py diff --git a/.project b/.project new file mode 100644 index 0000000..e329c3f --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + Common Build Scripts + + + + + + org.python.pydev.PyDevBuilder + + + + + + org.python.pydev.pythonNature + + diff --git a/.pydevproject b/.pydevproject new file mode 100644 index 0000000..d111c07 --- /dev/null +++ b/.pydevproject @@ -0,0 +1,8 @@ + + + +/${PROJECT_DIR_NAME} + +python interpreter +python35 + diff --git a/versionnumbering/versioninfo.py b/versionnumbering/versioninfo.py new file mode 100644 index 0000000..0567097 --- /dev/null +++ b/versionnumbering/versioninfo.py @@ -0,0 +1,192 @@ +# encoding: utf-8 +''' +versionnumbering -- shortdesc + +versionnumbering generates a version folder with a common set of version information files in it + +@author: dan + +@copyright: 2017 Global Inkjet Systems Ltd. All rights reserved. +''' +import os +import sys +import shutil +import subprocess + +from argparse import ArgumentParser +from argparse import RawDescriptionHelpFormatter + +__all__ = [] +__version__ = 0.1 +__date__ = '2017-11-29' +__updated__ = '2017-11-29' + +def resetFolder(versionfolder): + print("Removing folders and contents of: {0}".format(versionfolder)) + try: + shutil.rmtree(versionfolder) + except FileNotFoundError: + pass + + print("Creating folder: {0}".format(versionfolder)) + os.makedirs(versionfolder) + +def getGitRevision(gitrootpath, basenumber): + cwd = os.getcwd() + + path = os.path.expanduser(gitrootpath) + print("Changing current working directory to: {0}".format(path)) + os.chdir(path) + + gitvar = "GIT_EXECUTABLE" + if gitvar in os.environ and os.environ[gitvar]: + gitexecutable = os.environ[gitvar] + else: + print("Expecting GIT_EXECUTABLE environment variable to have path to git. Defaulting to 'git'") + gitexecutable = "git" + + print("Determining revision info using git command: {0}".format(gitexecutable)) + completed = subprocess.run([gitexecutable, "rev-list", "HEAD", "--count"], stdout=subprocess.PIPE) + print("Command {0} returned: {1}".format(completed.args, completed.returncode)) + changecount = completed.stdout.decode("utf-8").strip() + print("Change count: {0}".format(changecount)) + adjustedchangecount = int(changecount) + int(basenumber) + print("Adjusted change count: {0}".format(adjustedchangecount)) + + print("Determining current revision info using git command: {0}".format(gitexecutable)) + completed = subprocess.run([gitexecutable, "rev-parse", "HEAD"], stdout=subprocess.PIPE) + print("Command {0} returned: {1}".format(completed.args, completed.returncode)) + revision = completed.stdout.decode("utf-8").strip() + print("Revision: {0}".format(revision)) + + os.chdir(cwd) + print("Restored current working directory to: {0}".format(cwd)) + + return (adjustedchangecount, revision) + +def getVersionPrefix(sourcebranch): + print("Determining version number prefix from source branch name: {0}".format(sourcebranch)) + + defaultversionprefix = "1.30000.0" + splits = sourcebranch.split('/') + if len(splits) < 1: + print("Source branch name is invalid. Defaulting to: {0}".format(defaultversionprefix)) + return defaultversionprefix + + sourcebranch = splits[-1] + + if sourcebranch.lower().endswith("master"): # Special case + return "1.20000.0." + + splits = sourcebranch.split('.') + versionprefix = "" + if len(splits) < 1: + print("This source branch name has no decimal points in its name so defaulting to: {0}".format(defaultversionprefix)) + versionprefix = defaultversionprefix + else: + splitnumbercount = 0 + for split in splits: + if split.isdigit(): + versionprefix += split + "." + splitnumbercount += 1 + else: + break + if splitnumbercount > 2: + break + if splitnumbercount == 0: + print("No leading numbers were found in source branch name so defaulting to: {0}".format(defaultversionprefix)) + versionprefix = defaultversionprefix + elif splitnumbercount == 1: + versionprefix += "0.0." + elif splitnumbercount == 2: + versionprefix += "0." + + print("Determined version prefix to be: {0}".format(versionprefix)) + return versionprefix + +def writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevision, buildnumber, buildstamp): + with open(os.path.join(versionfolder, "buildjobname.txt"), 'w') as f: + f.write(buildjobname) + + with open(os.path.join(versionfolder, "prefix.txt"), 'w') as f: + f.write(versionprefix) + + with open(os.path.join(versionfolder, "revision.txt"), 'w') as f: + f.write(gitrevision) + + with open(os.path.join(versionfolder, "buildnumber.txt"), 'w') as f: + f.write(buildnumber) + + with open(os.path.join(versionfolder, "buildstamp.txt"), 'w') as f: + f.write(buildstamp) + +def main(argv=None): # IGNORE:C0111 + '''Command line options.''' + + if argv is None: + argv = sys.argv + else: + sys.argv.extend(argv) + + program_name = os.path.basename(sys.argv[0]) + program_version = "v%s" % __version__ + program_build_date = str(__updated__) + program_version_message = '%%(prog)s %s (%s)' % (program_version, program_build_date) + program_shortdesc = __import__('__main__').__doc__.split("\n")[1] + program_license = '''%s + + Created by dan on %s. + Copyright 2017 Global Inkjet Systems Ltd. All rights reserved. + + Distributed on an "AS IS" basis without warranties + or conditions of any kind, either express or implied. + +USAGE +''' % (program_shortdesc, str(__date__)) + + try: + # Setup argument parser + parser = ArgumentParser(description=program_license, formatter_class=RawDescriptionHelpFormatter) + parser.add_argument("-s", "--sourcebranch", dest="sourcebranch", action="store", default="origin/master", help="source branch name to discover version number [default: %(default)s]") + parser.add_argument("-v", "--versionfolder", dest="versionfolder", action="store", default="version", help="version folder to be created [default: %(default)s]") + parser.add_argument("-g", "--gitroot", dest="gitrootfolder", action="store", default="GitRepository", help="root path of source files [default: %(default)s]") + parser.add_argument("-b", "--baseversionnumber", dest="baseversionnumber", action="store", default=int(1000), help="base git version number [default: %(default)s]") + parser.add_argument("-j", "--buildjobname", dest="buildjobname", action="store", default="-", help="build job name [default: %(default)s]") + parser.add_argument("-n", "--buildnumber", dest="buildnumber", action="store", default="1", help="build number [default: %(default)s]") + + # Process arguments + args = parser.parse_args() + + sourcebranch = args.sourcebranch + versionfolder = args.versionfolder + gitrootfolder = args.gitrootfolder + baseversionnumber = args.baseversionnumber + buildjobname = args.buildjobname + buildnumber = args.buildnumber + + print("Source branch:", sourcebranch, "version folder:", versionfolder, "Git root:", gitrootfolder) + print("Base version number:", baseversionnumber, "Build job name:", buildjobname, "Build number:", buildnumber) + + resetFolder(versionfolder) + + (gitrevisioncount, gitrevision) = getGitRevision(gitrootfolder, baseversionnumber) + + versionprefix = getVersionPrefix(sourcebranch) + + buildstamp = versionprefix + str(gitrevisioncount) + print("Build stamp is: {0}".format(buildstamp)) + + writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevision, buildnumber, buildstamp) + + return 0 + except Exception as e: + print("Error while creating version info:", e.__repr__()) + return 1 + except Exception as e: + indent = len(program_name) * " " + print(program_name + ": " + repr(e) + "\n") + print(indent + " for help use --help") + return 2 + +if __name__ == "__main__": + sys.exit(main()) From 93caaec49afb99a61b6f324212cb24f557eb5c48 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 30 Nov 2017 18:39:49 +0000 Subject: [PATCH 23/96] Remove redundant file --- versionnumbering/versioninfo.gsh | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 versionnumbering/versioninfo.gsh diff --git a/versionnumbering/versioninfo.gsh b/versionnumbering/versioninfo.gsh deleted file mode 100644 index 579b976..0000000 --- a/versionnumbering/versioninfo.gsh +++ /dev/null @@ -1,29 +0,0 @@ -// Methods in this file will end up as object methods on the object that load returns. - -def makeVersionFolder(String versionFolder) { - dir("${versionFolder}") { - - - - - - - -def generateVersionFiles(String versionFolder, - Integer BaseGitNumber, - String SrcFolder, - String SrcBranch) { - echo """Building version folder at: ${versionFolder} - base git number: ${BaseGitNumber} - source folder: ${SrcFolder} - source branch: ${SrcBranch}""" - - dir - - - -def lookAtThis(String whoAreYou) { - echo "Look at this, ${whoAreYou}! You loaded this from another file!" -} - -return this; From 7a553a6f9e8c038fbe15120191b0969216e2aee4 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 30 Nov 2017 18:39:49 +0000 Subject: [PATCH 24/96] Remove redundant file --- versionnumbering/versioninfo.gsh | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 versionnumbering/versioninfo.gsh diff --git a/versionnumbering/versioninfo.gsh b/versionnumbering/versioninfo.gsh deleted file mode 100644 index 579b976..0000000 --- a/versionnumbering/versioninfo.gsh +++ /dev/null @@ -1,29 +0,0 @@ -// Methods in this file will end up as object methods on the object that load returns. - -def makeVersionFolder(String versionFolder) { - dir("${versionFolder}") { - - - - - - - -def generateVersionFiles(String versionFolder, - Integer BaseGitNumber, - String SrcFolder, - String SrcBranch) { - echo """Building version folder at: ${versionFolder} - base git number: ${BaseGitNumber} - source folder: ${SrcFolder} - source branch: ${SrcBranch}""" - - dir - - - -def lookAtThis(String whoAreYou) { - echo "Look at this, ${whoAreYou}! You loaded this from another file!" -} - -return this; From d347fd921fc36354143f48b49434f89090d500ad Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 1 Dec 2017 17:03:09 +0000 Subject: [PATCH 25/96] Output git remote info into version folder --- versionnumbering/versioninfo.py | 51 ++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/versionnumbering/versioninfo.py b/versionnumbering/versioninfo.py index 0567097..35e91cd 100644 --- a/versionnumbering/versioninfo.py +++ b/versionnumbering/versioninfo.py @@ -59,10 +59,16 @@ def getGitRevision(gitrootpath, basenumber): revision = completed.stdout.decode("utf-8").strip() print("Revision: {0}".format(revision)) + print("Determining remote info using git command: {0}".format(gitexecutable)) + completed = subprocess.run([gitexecutable, "remote", "show", "origin"], stdout=subprocess.PIPE) + print("Command {0} returned: {1}".format(completed.args, completed.returncode)) + remoteinfo = completed.stdout.decode("utf-8") + print("Remote info: {0}".format(remoteinfo)) + os.chdir(cwd) print("Restored current working directory to: {0}".format(cwd)) - return (adjustedchangecount, revision) + return (adjustedchangecount, revision, remoteinfo) def getVersionPrefix(sourcebranch): print("Determining version number prefix from source branch name: {0}".format(sourcebranch)) @@ -104,7 +110,7 @@ def getVersionPrefix(sourcebranch): print("Determined version prefix to be: {0}".format(versionprefix)) return versionprefix -def writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevision, buildnumber, buildstamp): +def writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevision, remoteinfo, buildnumber, buildstamp): with open(os.path.join(versionfolder, "buildjobname.txt"), 'w') as f: f.write(buildjobname) @@ -114,6 +120,9 @@ def writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevision, b with open(os.path.join(versionfolder, "revision.txt"), 'w') as f: f.write(gitrevision) + with open(os.path.join(versionfolder, "remoteinfo.txt"), 'w') as f: + f.write(remoteinfo) + with open(os.path.join(versionfolder, "buildnumber.txt"), 'w') as f: f.write(buildnumber) @@ -157,31 +166,33 @@ USAGE # Process arguments args = parser.parse_args() - sourcebranch = args.sourcebranch - versionfolder = args.versionfolder - gitrootfolder = args.gitrootfolder - baseversionnumber = args.baseversionnumber - buildjobname = args.buildjobname - buildnumber = args.buildnumber + try: + sourcebranch = args.sourcebranch + versionfolder = args.versionfolder + gitrootfolder = args.gitrootfolder + baseversionnumber = args.baseversionnumber + buildjobname = args.buildjobname + buildnumber = args.buildnumber - print("Source branch:", sourcebranch, "version folder:", versionfolder, "Git root:", gitrootfolder) - print("Base version number:", baseversionnumber, "Build job name:", buildjobname, "Build number:", buildnumber) + print("Source branch:", sourcebranch, "version folder:", versionfolder, "Git root:", gitrootfolder) + print("Base version number:", baseversionnumber, "Build job name:", buildjobname, "Build number:", buildnumber) - resetFolder(versionfolder) + resetFolder(versionfolder) - (gitrevisioncount, gitrevision) = getGitRevision(gitrootfolder, baseversionnumber) + (gitrevisioncount, gitrevision, remoteinfo) = getGitRevision(gitrootfolder, baseversionnumber) - versionprefix = getVersionPrefix(sourcebranch) + versionprefix = getVersionPrefix(sourcebranch) - buildstamp = versionprefix + str(gitrevisioncount) - print("Build stamp is: {0}".format(buildstamp)) + buildstamp = versionprefix + str(gitrevisioncount) + print("Build stamp is: {0}".format(buildstamp)) - writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevision, buildnumber, buildstamp) + writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevision, remoteinfo, buildnumber, buildstamp) + + return 0 + except Exception as e: + print("Error while creating version info:", e.__repr__()) + return 1 - return 0 - except Exception as e: - print("Error while creating version info:", e.__repr__()) - return 1 except Exception as e: indent = len(program_name) * " " print(program_name + ": " + repr(e) + "\n") From d33f6828a4e6a95abcaf4884b0d14ea9b1fad018 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 2 Dec 2017 10:43:53 +0000 Subject: [PATCH 26/96] Add differences folder --- differences/.project | 17 +++ differences/.pydevproject | 8 ++ differences/show_release_differences.py | 151 ++++++++++++++++++++++++ 3 files changed, 176 insertions(+) create mode 100644 differences/.project create mode 100644 differences/.pydevproject create mode 100644 differences/show_release_differences.py diff --git a/differences/.project b/differences/.project new file mode 100644 index 0000000..75af0fc --- /dev/null +++ b/differences/.project @@ -0,0 +1,17 @@ + + + Release_difference + + + + + + org.python.pydev.PyDevBuilder + + + + + + org.python.pydev.pythonNature + + diff --git a/differences/.pydevproject b/differences/.pydevproject new file mode 100644 index 0000000..c3434da --- /dev/null +++ b/differences/.pydevproject @@ -0,0 +1,8 @@ + + + +/${PROJECT_DIR_NAME} + +python 3.0 +Default + diff --git a/differences/show_release_differences.py b/differences/show_release_differences.py new file mode 100644 index 0000000..1d525b9 --- /dev/null +++ b/differences/show_release_differences.py @@ -0,0 +1,151 @@ +''' +Created on 2 Mar 2017 + +@author: Dan +''' +import subprocess +import os +import sys +import re + +GIT_EXECUTABLE = os.getenv("GIT_EXECUTABLE") +if GIT_EXECUTABLE == None: + print("Please define the GIT_EXECUTABLE environment variable to the git executable path") + sys.exit(1) + +WORKING_PATH = os.getenv("WORKING_PATH") +if WORKING_PATH == None: + print("Please define the WORKING_PATH environment variable to the git repository path to use") + sys.exit(1) + +CURRENT_RELEASE = os.getenv("CURRENT_RELEASE") +if CURRENT_RELEASE == None: + print("Please define the CURRENT_RELEASE version") + sys.exit(1) + +PREVIOUS_RELEASE = os.getenv("PREVIOUS_RELEASE") +if PREVIOUS_RELEASE == None: + print("Please define the PREVIOUS_RELEASE version") + sys.exit(1) + +DIFFERENCE_OPTIONS = os.getenv("DIFFERENCE_OPTIONS") +if DIFFERENCE_OPTIONS == None: + DIFFERENCE_OPTIONS = "" + +class GitException(Exception): + def __init__(self, message): + self.message = message + + def __repr__(self): + return self.message + +def printDivider(times = 1, length = 100): + for _ in range(times): + print("*" * length) + +TABSIZE = 4 +def printTabbed(string, tabs = 0): + print("{0}{1}".format(" " * (TABSIZE * tabs), string)) + +def getGitLogDifferences(workingPath, previousRelease, currentRelease, tripledot = False): + gitExecutable = GIT_EXECUTABLE + if tripledot: + releaseExpression = previousRelease + "..." + currentRelease + else: + releaseExpression = previousRelease + ".." + currentRelease + currentdir = os.getcwd() + os.chdir(workingPath) + gitlog = [] + printTabbed("Executing: {0} {1} {2} {3}".format(gitExecutable, "log", "--oneline", releaseExpression)) + proc = subprocess.Popen([gitExecutable, "log", "--oneline", releaseExpression], stdout=subprocess.PIPE) + while True: + line = proc.stdout.readline() + if line: + linestring = line.decode('utf-8').rstrip() + gitlog.append(linestring) + #printTabbed(linestring, 1) + else: + break + proc.wait() + if proc.returncode > 0: + raise GitException("Git executable returned an error") + os.chdir(currentdir) + return gitlog + +expectedpattern = re.compile("^.* +(?:[gG][iI][sS][ _-]*|[tT]rac \#*|\#\s*)(\d+):*(.*)$") +revertpattern = re.compile('^(\S*) Revert " *GIS-(\d+):* (.*)"$') +mergepattern = re.compile("^(.*)((?:Merge branch '.*'|Merge remote-tracking branch '.*'|Merge commit '.*'|Add '.*' from commit).*)$") + +def processLog(gitlog): + reverts = [] + merges = {} + other = [] + numbered = {} + for line in gitlog: + expectedmatch = expectedpattern.match(line) + revertmatch = revertpattern.match(line) + mergematch = mergepattern.match(line) + if expectedmatch == None and revertmatch == None and mergematch == None: + other.append(line) + if revertmatch: + gisnumber = "GIS-" + revertmatch.group(2) + description = revertmatch.group(3) + reverts.append("Revert: {0} {1}".format(gisnumber, description)) + if mergematch: + merge = mergematch.group(2) + if not merge in merges: + merges[merge] = 1 + else: + merges[merge] += 1 + if expectedmatch: + gisnumber = "GIS-" + expectedmatch.group(1) + description = expectedmatch.group(2) + if not gisnumber in numbered: + numbered[gisnumber] = [] + numbered[gisnumber].append(description) + return (reverts, merges, other, numbered) + +def showDifferences(differences): + (revertslog, mergeslog, otherlog, numberedlog) = differences + printDivider() + printTabbed("GIS-Numbers Log:") + for (gisnumber, descriptions) in sorted(numberedlog.items()): + printTabbed(gisnumber, 1) + descriptions = numberedlog[gisnumber]; + for description in descriptions: + printTabbed(description, 2) + printDivider() + printTabbed("Revert log:") + for reversion in sorted(revertslog): + printTabbed(reversion, 1) + printDivider() + printTabbed("Merges log:") + for merge in sorted(mergeslog): + printTabbed(merge, 1) + printDivider() + printTabbed("Other log:") + for other in sorted(otherlog): + printTabbed(other, 1) + +def main(): + workingPath = WORKING_PATH + previous = PREVIOUS_RELEASE + now = CURRENT_RELEASE + printDivider(times = 4) + printTabbed("Looking for changes in {2} that are not in {1} of the repository at path: {0}".format(workingPath, previous, now)) + gitlog = getGitLogDifferences(workingPath, previous, now) + showDifferences(processLog(gitlog)) + if 'opposite' in DIFFERENCE_OPTIONS.lower(): + printDivider(times = 4) + printTabbed("Looking for changes in {2} that are not in {1} of the repository at path: {0}".format(workingPath, now, previous)) + gitlog = getGitLogDifferences(workingPath, now, previous) + showDifferences(processLog(gitlog)) + if 'notcommon' in DIFFERENCE_OPTIONS.lower(): + printDivider(times = 4) + printTabbed("Looking for changes that are not common to {1} or {2} at path: {0}".format(workingPath, now, previous)) + gitlog = getGitLogDifferences(workingPath, now, previous, tripledot = True) + showDifferences(processLog(gitlog)) + sys.exit(0) + +if __name__ == '__main__': + main() \ No newline at end of file From e58acae19d89d804ca1bfc9b9426fe91d7f9f010 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 2 Dec 2017 21:46:11 +0000 Subject: [PATCH 27/96] Tested version of differences generation --- .settings/org.eclipse.core.resources.prefs | 2 + differences/show_release_differences.py | 207 ++++++++++++------- version/differences.txt | 230 +++++++++++++++++++++ versionnumbering/versioninfo.py | 21 +- 4 files changed, 375 insertions(+), 85 deletions(-) create mode 100644 .settings/org.eclipse.core.resources.prefs create mode 100644 version/differences.txt diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..1174a06 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding//versionnumbering/versioninfo.py=utf-8 diff --git a/differences/show_release_differences.py b/differences/show_release_differences.py index 1d525b9..a778892 100644 --- a/differences/show_release_differences.py +++ b/differences/show_release_differences.py @@ -1,36 +1,26 @@ ''' -Created on 2 Mar 2017 +showreleasedifferences -- shortdesc -@author: Dan +showreleasedifferences generates a version folder with a common set of version information files in it + +@author: dan + +@copyright: 2017 Global Inkjet Systems Ltd. All rights reserved. ''' import subprocess import os import sys import re -GIT_EXECUTABLE = os.getenv("GIT_EXECUTABLE") -if GIT_EXECUTABLE == None: - print("Please define the GIT_EXECUTABLE environment variable to the git executable path") - sys.exit(1) +from argparse import ArgumentParser +from argparse import RawDescriptionHelpFormatter -WORKING_PATH = os.getenv("WORKING_PATH") -if WORKING_PATH == None: - print("Please define the WORKING_PATH environment variable to the git repository path to use") - sys.exit(1) +__all__ = [] +__version__ = 0.1 +__date__ = '2017-11-29' +__updated__ = '2017-11-29' -CURRENT_RELEASE = os.getenv("CURRENT_RELEASE") -if CURRENT_RELEASE == None: - print("Please define the CURRENT_RELEASE version") - sys.exit(1) - -PREVIOUS_RELEASE = os.getenv("PREVIOUS_RELEASE") -if PREVIOUS_RELEASE == None: - print("Please define the PREVIOUS_RELEASE version") - sys.exit(1) - -DIFFERENCE_OPTIONS = os.getenv("DIFFERENCE_OPTIONS") -if DIFFERENCE_OPTIONS == None: - DIFFERENCE_OPTIONS = "" +gitExecutable = os.getenv("GIT_EXECUTABLE", default="git") class GitException(Exception): def __init__(self, message): @@ -39,31 +29,34 @@ class GitException(Exception): def __repr__(self): return self.message -def printDivider(times = 1, length = 100): +def makeFolder(versionfolder): + print("Creating folder (if not already there): {0}".format(versionfolder)) + os.makedirs(versionfolder, exist_ok = True) + +def printDivider(outfh, times = 1, length = 100): for _ in range(times): - print("*" * length) + outfh.write("{0}\n".format("*" * length)) TABSIZE = 4 -def printTabbed(string, tabs = 0): - print("{0}{1}".format(" " * (TABSIZE * tabs), string)) +def printTabbed(outfh, string, tabs = 0): + outfh.write("{0}{1}\n".format(" " * (TABSIZE * tabs), string)) -def getGitLogDifferences(workingPath, previousRelease, currentRelease, tripledot = False): - gitExecutable = GIT_EXECUTABLE +def getGitLogDifferences(outfh, gitrootfolder, previousRelease, currentRelease, tripledot = False): if tripledot: releaseExpression = previousRelease + "..." + currentRelease else: releaseExpression = previousRelease + ".." + currentRelease currentdir = os.getcwd() - os.chdir(workingPath) + os.chdir(gitrootfolder) gitlog = [] - printTabbed("Executing: {0} {1} {2} {3}".format(gitExecutable, "log", "--oneline", releaseExpression)) + printTabbed(outfh, "Executing: {0} {1} {2} {3}".format(gitExecutable, "log", "--oneline", releaseExpression)) proc = subprocess.Popen([gitExecutable, "log", "--oneline", releaseExpression], stdout=subprocess.PIPE) while True: line = proc.stdout.readline() if line: linestring = line.decode('utf-8').rstrip() gitlog.append(linestring) - #printTabbed(linestring, 1) + #printTabbed(outfh, linestring, 1) else: break proc.wait() @@ -72,15 +65,23 @@ def getGitLogDifferences(workingPath, previousRelease, currentRelease, tripledot os.chdir(currentdir) return gitlog -expectedpattern = re.compile("^.* +(?:[gG][iI][sS][ _-]*|[tT]rac \#*|\#\s*)(\d+):*(.*)$") -revertpattern = re.compile('^(\S*) Revert " *GIS-(\d+):* (.*)"$') +jiraprojectpattern = { + 'GIS' : ( re.compile("^.* +(?:[gG][iI][sS][ _-]*|[tT]rac \#*|\#\s*)(\d+):*(.*)$"), + re.compile('^(\S*) Revert " *GIS-(\d+):* (.*)"$'), + ), + 'IMB': ( re.compile("^.* +(?:[Ii][Mm][Bb][ _-]*|\#\s*)(\d+):*(.*)$"), + re.compile('^(\S*) Revert " *IMB-(\d+):* (.*)"$'), + ), + } + mergepattern = re.compile("^(.*)((?:Merge branch '.*'|Merge remote-tracking branch '.*'|Merge commit '.*'|Add '.*' from commit).*)$") -def processLog(gitlog): +def processLog(gitlog, jirakeyprefix): reverts = [] merges = {} other = [] numbered = {} + (expectedpattern, revertpattern) = jiraprojectpattern[jirakeyprefix] for line in gitlog: expectedmatch = expectedpattern.match(line) revertmatch = revertpattern.match(line) @@ -88,7 +89,7 @@ def processLog(gitlog): if expectedmatch == None and revertmatch == None and mergematch == None: other.append(line) if revertmatch: - gisnumber = "GIS-" + revertmatch.group(2) + gisnumber = jirakeyprefix + "-" + revertmatch.group(2) description = revertmatch.group(3) reverts.append("Revert: {0} {1}".format(gisnumber, description)) if mergematch: @@ -98,54 +99,116 @@ def processLog(gitlog): else: merges[merge] += 1 if expectedmatch: - gisnumber = "GIS-" + expectedmatch.group(1) + gisnumber = jirakeyprefix + "-" + expectedmatch.group(1) description = expectedmatch.group(2) if not gisnumber in numbered: numbered[gisnumber] = [] numbered[gisnumber].append(description) return (reverts, merges, other, numbered) -def showDifferences(differences): +def showDifferences(differences, jirakeyprefix, outfh): (revertslog, mergeslog, otherlog, numberedlog) = differences - printDivider() - printTabbed("GIS-Numbers Log:") + printDivider(outfh) + printTabbed(outfh, jirakeyprefix + "-Numbers Log:") for (gisnumber, descriptions) in sorted(numberedlog.items()): - printTabbed(gisnumber, 1) + printTabbed(outfh, gisnumber, 1) descriptions = numberedlog[gisnumber]; for description in descriptions: - printTabbed(description, 2) - printDivider() - printTabbed("Revert log:") + printTabbed(outfh, description, 2) + printDivider(outfh) + printTabbed(outfh, "Revert log:") for reversion in sorted(revertslog): - printTabbed(reversion, 1) - printDivider() - printTabbed("Merges log:") + printTabbed(outfh, reversion, 1) + printDivider(outfh) + printTabbed(outfh, "Merges log:") for merge in sorted(mergeslog): - printTabbed(merge, 1) - printDivider() - printTabbed("Other log:") + printTabbed(outfh, merge, 1) + printDivider(outfh) + printTabbed(outfh, "Other log:") for other in sorted(otherlog): - printTabbed(other, 1) + printTabbed(outfh, other, 1) -def main(): - workingPath = WORKING_PATH - previous = PREVIOUS_RELEASE - now = CURRENT_RELEASE - printDivider(times = 4) - printTabbed("Looking for changes in {2} that are not in {1} of the repository at path: {0}".format(workingPath, previous, now)) - gitlog = getGitLogDifferences(workingPath, previous, now) - showDifferences(processLog(gitlog)) - if 'opposite' in DIFFERENCE_OPTIONS.lower(): - printDivider(times = 4) - printTabbed("Looking for changes in {2} that are not in {1} of the repository at path: {0}".format(workingPath, now, previous)) - gitlog = getGitLogDifferences(workingPath, now, previous) - showDifferences(processLog(gitlog)) - if 'notcommon' in DIFFERENCE_OPTIONS.lower(): - printDivider(times = 4) - printTabbed("Looking for changes that are not common to {1} or {2} at path: {0}".format(workingPath, now, previous)) - gitlog = getGitLogDifferences(workingPath, now, previous, tripledot = True) - showDifferences(processLog(gitlog)) - sys.exit(0) +def main(argv=None): # IGNORE:C0111 + '''Command line options.''' -if __name__ == '__main__': - main() \ No newline at end of file + if argv is None: + argv = sys.argv + else: + sys.argv.extend(argv) + + program_name = os.path.basename(sys.argv[0]) + program_version = "v%s" % __version__ + program_build_date = str(__updated__) + program_version_message = '%%(prog)s %s (%s)' % (program_version, program_build_date) + program_shortdesc = __import__('__main__').__doc__.split("\n")[1] + program_license = '''%s + + Created by dan on %s. + Copyright 2017 Global Inkjet Systems Ltd. All rights reserved. + + Distributed on an "AS IS" basis without warranties + or conditions of any kind, either express or implied. + +USAGE +''' % (program_shortdesc, str(__date__)) + + try: + # Setup argument parser + parser = ArgumentParser(description=program_license, formatter_class=RawDescriptionHelpFormatter) + parser.add_argument("-g", "--gitroot", dest="gitrootfolder", action="store", default="GitRepository", help="root path of source files [default: %(default)s]") + parser.add_argument("-s", "--sourceversion", dest="sourceversion", action="store", default="origin/master", help="source version branch or tag to discover compare against [default: %(default)s]") + parser.add_argument("-p", "--previousversion", dest="previousversion", action="store", default="origin/master", help="source branch or tag to compare with [default: %(default)s]") + parser.add_argument("-j", "--jirakeyprefix", dest="jirakeyprefix", action="store", default="GIS", help="jira key prefix [default: %(default)s]") + parser.add_argument("-o", "--outputoptions", dest="outputoptions", action="store", default="", help="output options: Can be: opposite notcommon [default: %(default)s]") + parser.add_argument("-v", "--versionfolder", dest="versionfolder", action="store", default="", help="version folder where differences file stored [default: %(default)s]") + + # Process arguments + args = parser.parse_args() + + try: + gitrootfolder = args.gitrootfolder + sourceversion = args.sourceversion + previousversion = args.previousversion + jirakeyprefix = args.jirakeyprefix + outputoptions = args.outputoptions + versionfolder = args.versionfolder + + print("Git root:", gitrootfolder, "Source version:", sourceversion, "Previous source version:", previousversion) + print("Jira key prefix:", jirakeyprefix, "Output options:", outputoptions, "Version folder:", versionfolder) + + if versionfolder: + makeFolder(versionfolder) + outfh = open(os.path.join(versionfolder, "differences.txt"), 'w') + else: + outfh = sys.stdout + + printDivider(outfh, times = 4) + printTabbed(outfh, "Looking for changes in {2} that are not in {1} of the repository at path: {0}".format(gitrootfolder, previousversion, sourceversion)) + gitlog = getGitLogDifferences(outfh, gitrootfolder, previousversion, sourceversion) + showDifferences(processLog(gitlog, jirakeyprefix), jirakeyprefix, outfh) + if 'opposite' in outputoptions.lower(): + printDivider(outfh, times = 4) + printTabbed(outfh, "Looking for changes in {2} that are not in {1} of the repository at path: {0}".format(gitrootfolder, sourceversion, previousversion)) + gitlog = getGitLogDifferences(outfh, gitrootfolder, sourceversion, previousversion) + showDifferences(processLog(gitlog, jirakeyprefix), jirakeyprefix, outfh) + if 'notcommon' in outputoptions.lower(): + printDivider(outfh, times = 4) + printTabbed(outfh, "Looking for changes that are not common to {1} or {2} at path: {0}".format(gitrootfolder, sourceversion, previousversion)) + gitlog = getGitLogDifferences(outfh, gitrootfolder, sourceversion, previousversion, tripledot = True) + showDifferences(processLog(gitlog, jirakeyprefix), jirakeyprefix, outfh) + + if versionfolder: + outfh.close() + return 0 + except Exception as e: + print("Error while determining differences:", e.__repr__()) + return 1 + + except Exception as e: + indent = len(program_name) * " " + print(program_name + ": " + repr(e) + "\n") + print(indent + " for help use --help") + return 2 + +if __name__ == "__main__": + sys.exit(main()) diff --git a/version/differences.txt b/version/differences.txt new file mode 100644 index 0000000..7ec3ad6 --- /dev/null +++ b/version/differences.txt @@ -0,0 +1,230 @@ +**************************************************************************************************** +**************************************************************************************************** +**************************************************************************************************** +**************************************************************************************************** +Looking for changes in origin/master that are not in origin/1.5.4 of the repository at path: /home/dan/home2/Development/inksystem +Executing: git log --oneline origin/1.5.4..origin/master +**************************************************************************************************** +IMB-Numbers Log: + IMB-11 + Further minor change to tooltip + Changed tooltip for PWN Frequency on ink pumps + Changed the Tooltips for PWM frequency and duty cycle + IMB-12 + Changed the order the events are generated in to prevent master from resetting slave + When a vent command is sent to a slave, it will demand a vent from its master + IMB-14 + Fixed state transition in Controlled Flow Master where it could get stuck in pre-flow + IMB-4 + - Add more logging + IMB-42 + Master sets the slaves to dormant when pre-idling + IMB-43 + Added purge abort for HP Type 2 + Fixed shared controlled flow transition for purge all slaves + Added Idle transitions from Purge + Added missing definition + Added explicit transitions for standby for all states for flowmode 1-3 + IMB-47 + - Tidied up checkStateR to be consistent with setValueR + - The thermistor will only generate an event if a threshold has been crossed, or when "timeToSendAnotherEvent" is true. + - The thermistor will only generate an event if a threshold has been crossed, or when "timeToSendAnotherEvent" is true. + IMB-50 + Temperature setpoint set when entering flow configuration to ensure correct heater operation + IMB-6 + Removed a white-space in the output + IMB-7 + Changed the formatting of the output + IMB-8 + When returning from a purge it now calls the same code as when going into idle, as they effectively were identical. + Added pre-flow to post-flow transitions and vice-versa + In gravity mode: removed the activation of the vacuum pump which speeds up ramps. This caused vent and pump to "fight" each other +**************************************************************************************************** +Revert log: +**************************************************************************************************** +Merges log: + Merge branch '1.10023.j6221-Type2_Pneumatic' of hydra:gis/inksystem into 1.10023.j6221-Type2_Pneumatic + Merge branch 'master' of hydra:gis/inksystem + Merge remote-tracking branch 'remotes/origin/1.10025.j6416-EthernetCongestion' into 1.10023.j6221-Type2_Pneumatic + Merge remote-tracking branch 'remotes/origin/1.5.2' into 1.10023.j6221-Type2_Pneumatic + Merge remote-tracking branch 'remotes/origin/1.5.5' + Merge remote-tracking branch 'remotes/origin/master' into 1.10023.j6221-Type2_Pneumatic +**************************************************************************************************** +Other log: + 095290c GIS-1621 - Make compilation work in case-sensitive linux + 0a8505d GIS-1621 - Remove test code + 0e8ccce GIS-6380 Removed ambiguous "absolute pressure" terminology + 149e0bf GIS 6221: Added logging for gravity mode + 169125b GIS-6221: Corrected Typo + 23c37d0 GIS 43: System will abort purge in a safe manner if standby command is issued + 37dd24b GIS 6479: Controlled flow master now goes through pre-flow. Fixed ordering in controlevent.c and .h + 41ac373 GIS-6253: Fixed bugs + 45cdfbe GIS 6591: Fixed if statement which outputs ITPD and OTPD + 468798e Update release notes whitespace + 4c2badc GIS-1621 - 16 bit integer is not printing correctly + 4c9a1aa GIS-6221 Vent the outlet bottle when purging to prevent "kick" on return from idle + 541c3bb GIS-6253: Added gravity flowmode + 5562461 GIS-6570 - Handle 0 length buffers being sent for TCP transmission; Add some logging for diagnosis + 577444e Update release notes for 1.5.5 + 5c6416b GIS-6416 - Instrument number of buffers on socket transmit queue and grapher empty buffer queue + 603de5a GIS-6221: Fixed more typos + 628b57d GIS 6221: Fixed typo + 6526df4 GIS-6221 Corrected behaviour at idle. When idling, the pressure is now only vacuum pump driven in one direction. + 6da6243 GIS-6221 Changed purge configuration, return from purge still to do + 7d263d0 GIS 6591: Change the output of the settings command on Telnet for clarity + 83f5517 Update 1.5.5 release notes with known issues + 85fc901 GIS-6570 - Handle condition when no bytes are consumed by sck_send (because the connection has died) for TCP transmission; Add some logging for diagnosis + 8a2db28 GIS-6221 Corrected behaviour at idle. When idling, the pressure is now only vacuum pump driven in one direction. + 8df4c1b GIS-1621 - Settings BSP files have changed unexpectedly from 1.5.4 - maybe causing a slow down + 92c135e GIS 6462 Fixed typo + 9400923 GIS-6516: Slave resets from vent when master is reset + 9964521 GIS 6253: Added methods for gravity mode logging in inkchannelinterface.cpp/h + a1f0025 GIS 43: Added PreIdle with slaves in controlled flow master + a900a24 GIS-6221: Changed Idle to be driven from Inlet Side + b2f4383 GIS-1620 - Correct string print + b42ea46 GIS-1621 - Handle version prefix + b498cd5 GIS 6462 Added on the fly idle pressure change in shared pressure controlled flow + b4e1b8c GIS 6221: Resolved merge conflicts and applied fixes from 1.5.3 to the Type 2 High Pressure mode + bbc5e45 GIS 6221 - Changed High Pressure Type 2 to flowmode 6 + bd69b60 GIS-6253: Fixed typos + c568789 GIS 6221 - Bug fixes High Pressure Type 2 Flow mode + c666970 GIS-6570 - Add some logging for diagnosis + c7bbf29 Fixed shared controlled flow transition for purge all slaves to standby + c962c65 GIS-6221 Added Purge Return via Idle + ca1e7b5 GIS-6253: Added the files for gravity flowmode + ca4473b GIS-1621 - Only send pressure updates if there is a 4 point difference in value + cb06440 GIS 6221: Changed descriptions of Flowmodes. Changed output of settings to show purge pressure for flowmode 5 and 6 + d4dd54d GIS 6462: Added on-the-fly pressure change for Shared Pressure Controlled Flow systems + da69186 GIS 6492: Dumpconfig now outputs the software version + df64abd Revert "GIS-1621 - Only send pressure updates if there is a 4 point difference in value" + e51971f GIS 6379: The purge pressure is only shown on High Pressure systems (flowmode 4 and 5) + e6b0227 GIS-6221 Corrected vent operation for outlet bottle + ec13b60 GIS-6416 - Handle multiple writes to a TCP stream until it becomes busy + f018a86 GIS 6479: Added an applysettings command to allow on the fly pressure and temperature changes + f7109ff GIS 43: Added purge to idle transitions for Gravity Mode + f87280b GIS 43: Fixed transition in cfm + f999765 GIS-6253: Removed redundant function + ff37df8 GIS-6253: Fixed typos + ff92b79 GIS 6591: Added statement on Master settings +**************************************************************************************************** +**************************************************************************************************** +**************************************************************************************************** +**************************************************************************************************** +Looking for changes in origin/1.5.4 that are not in origin/master of the repository at path: /home/dan/home2/Development/inksystem +Executing: git log --oneline origin/master..origin/1.5.4 +**************************************************************************************************** +IMB-Numbers Log: +**************************************************************************************************** +Revert log: +**************************************************************************************************** +Merges log: +**************************************************************************************************** +Other log: +**************************************************************************************************** +**************************************************************************************************** +**************************************************************************************************** +**************************************************************************************************** +Looking for changes that are not common to origin/master or origin/1.5.4 at path: /home/dan/home2/Development/inksystem +Executing: git log --oneline origin/master...origin/1.5.4 +**************************************************************************************************** +IMB-Numbers Log: + IMB-11 + Further minor change to tooltip + Changed tooltip for PWN Frequency on ink pumps + Changed the Tooltips for PWM frequency and duty cycle + IMB-12 + Changed the order the events are generated in to prevent master from resetting slave + When a vent command is sent to a slave, it will demand a vent from its master + IMB-14 + Fixed state transition in Controlled Flow Master where it could get stuck in pre-flow + IMB-4 + - Add more logging + IMB-42 + Master sets the slaves to dormant when pre-idling + IMB-43 + Added purge abort for HP Type 2 + Fixed shared controlled flow transition for purge all slaves + Added Idle transitions from Purge + Added missing definition + Added explicit transitions for standby for all states for flowmode 1-3 + IMB-47 + - Tidied up checkStateR to be consistent with setValueR + - The thermistor will only generate an event if a threshold has been crossed, or when "timeToSendAnotherEvent" is true. + - The thermistor will only generate an event if a threshold has been crossed, or when "timeToSendAnotherEvent" is true. + IMB-50 + Temperature setpoint set when entering flow configuration to ensure correct heater operation + IMB-6 + Removed a white-space in the output + IMB-7 + Changed the formatting of the output + IMB-8 + When returning from a purge it now calls the same code as when going into idle, as they effectively were identical. + Added pre-flow to post-flow transitions and vice-versa + In gravity mode: removed the activation of the vacuum pump which speeds up ramps. This caused vent and pump to "fight" each other +**************************************************************************************************** +Revert log: +**************************************************************************************************** +Merges log: + Merge branch '1.10023.j6221-Type2_Pneumatic' of hydra:gis/inksystem into 1.10023.j6221-Type2_Pneumatic + Merge branch 'master' of hydra:gis/inksystem + Merge remote-tracking branch 'remotes/origin/1.10025.j6416-EthernetCongestion' into 1.10023.j6221-Type2_Pneumatic + Merge remote-tracking branch 'remotes/origin/1.5.2' into 1.10023.j6221-Type2_Pneumatic + Merge remote-tracking branch 'remotes/origin/1.5.5' + Merge remote-tracking branch 'remotes/origin/master' into 1.10023.j6221-Type2_Pneumatic +**************************************************************************************************** +Other log: + 095290c GIS-1621 - Make compilation work in case-sensitive linux + 0a8505d GIS-1621 - Remove test code + 0e8ccce GIS-6380 Removed ambiguous "absolute pressure" terminology + 149e0bf GIS 6221: Added logging for gravity mode + 169125b GIS-6221: Corrected Typo + 23c37d0 GIS 43: System will abort purge in a safe manner if standby command is issued + 37dd24b GIS 6479: Controlled flow master now goes through pre-flow. Fixed ordering in controlevent.c and .h + 41ac373 GIS-6253: Fixed bugs + 45cdfbe GIS 6591: Fixed if statement which outputs ITPD and OTPD + 468798e Update release notes whitespace + 4c2badc GIS-1621 - 16 bit integer is not printing correctly + 4c9a1aa GIS-6221 Vent the outlet bottle when purging to prevent "kick" on return from idle + 541c3bb GIS-6253: Added gravity flowmode + 5562461 GIS-6570 - Handle 0 length buffers being sent for TCP transmission; Add some logging for diagnosis + 577444e Update release notes for 1.5.5 + 5c6416b GIS-6416 - Instrument number of buffers on socket transmit queue and grapher empty buffer queue + 603de5a GIS-6221: Fixed more typos + 628b57d GIS 6221: Fixed typo + 6526df4 GIS-6221 Corrected behaviour at idle. When idling, the pressure is now only vacuum pump driven in one direction. + 6da6243 GIS-6221 Changed purge configuration, return from purge still to do + 7d263d0 GIS 6591: Change the output of the settings command on Telnet for clarity + 83f5517 Update 1.5.5 release notes with known issues + 85fc901 GIS-6570 - Handle condition when no bytes are consumed by sck_send (because the connection has died) for TCP transmission; Add some logging for diagnosis + 8a2db28 GIS-6221 Corrected behaviour at idle. When idling, the pressure is now only vacuum pump driven in one direction. + 8df4c1b GIS-1621 - Settings BSP files have changed unexpectedly from 1.5.4 - maybe causing a slow down + 92c135e GIS 6462 Fixed typo + 9400923 GIS-6516: Slave resets from vent when master is reset + 9964521 GIS 6253: Added methods for gravity mode logging in inkchannelinterface.cpp/h + a1f0025 GIS 43: Added PreIdle with slaves in controlled flow master + a900a24 GIS-6221: Changed Idle to be driven from Inlet Side + b2f4383 GIS-1620 - Correct string print + b42ea46 GIS-1621 - Handle version prefix + b498cd5 GIS 6462 Added on the fly idle pressure change in shared pressure controlled flow + b4e1b8c GIS 6221: Resolved merge conflicts and applied fixes from 1.5.3 to the Type 2 High Pressure mode + bbc5e45 GIS 6221 - Changed High Pressure Type 2 to flowmode 6 + bd69b60 GIS-6253: Fixed typos + c568789 GIS 6221 - Bug fixes High Pressure Type 2 Flow mode + c666970 GIS-6570 - Add some logging for diagnosis + c7bbf29 Fixed shared controlled flow transition for purge all slaves to standby + c962c65 GIS-6221 Added Purge Return via Idle + ca1e7b5 GIS-6253: Added the files for gravity flowmode + ca4473b GIS-1621 - Only send pressure updates if there is a 4 point difference in value + cb06440 GIS 6221: Changed descriptions of Flowmodes. Changed output of settings to show purge pressure for flowmode 5 and 6 + d4dd54d GIS 6462: Added on-the-fly pressure change for Shared Pressure Controlled Flow systems + da69186 GIS 6492: Dumpconfig now outputs the software version + df64abd Revert "GIS-1621 - Only send pressure updates if there is a 4 point difference in value" + e51971f GIS 6379: The purge pressure is only shown on High Pressure systems (flowmode 4 and 5) + e6b0227 GIS-6221 Corrected vent operation for outlet bottle + ec13b60 GIS-6416 - Handle multiple writes to a TCP stream until it becomes busy + f018a86 GIS 6479: Added an applysettings command to allow on the fly pressure and temperature changes + f7109ff GIS 43: Added purge to idle transitions for Gravity Mode + f87280b GIS 43: Fixed transition in cfm + f999765 GIS-6253: Removed redundant function + ff37df8 GIS-6253: Fixed typos + ff92b79 GIS 6591: Added statement on Master settings diff --git a/versionnumbering/versioninfo.py b/versionnumbering/versioninfo.py index 35e91cd..c8c79fe 100644 --- a/versionnumbering/versioninfo.py +++ b/versionnumbering/versioninfo.py @@ -21,6 +21,8 @@ __version__ = 0.1 __date__ = '2017-11-29' __updated__ = '2017-11-29' +gitExecutable = os.getenv("GIT_EXECUTABLE", default="git") + def resetFolder(versionfolder): print("Removing folders and contents of: {0}".format(versionfolder)) try: @@ -38,29 +40,22 @@ def getGitRevision(gitrootpath, basenumber): print("Changing current working directory to: {0}".format(path)) os.chdir(path) - gitvar = "GIT_EXECUTABLE" - if gitvar in os.environ and os.environ[gitvar]: - gitexecutable = os.environ[gitvar] - else: - print("Expecting GIT_EXECUTABLE environment variable to have path to git. Defaulting to 'git'") - gitexecutable = "git" - - print("Determining revision info using git command: {0}".format(gitexecutable)) - completed = subprocess.run([gitexecutable, "rev-list", "HEAD", "--count"], stdout=subprocess.PIPE) + print("Determining revision info using git command: {0}".format(gitExecutable)) + completed = subprocess.run([gitExecutable, "rev-list", "HEAD", "--count"], stdout=subprocess.PIPE) print("Command {0} returned: {1}".format(completed.args, completed.returncode)) changecount = completed.stdout.decode("utf-8").strip() print("Change count: {0}".format(changecount)) adjustedchangecount = int(changecount) + int(basenumber) print("Adjusted change count: {0}".format(adjustedchangecount)) - print("Determining current revision info using git command: {0}".format(gitexecutable)) - completed = subprocess.run([gitexecutable, "rev-parse", "HEAD"], stdout=subprocess.PIPE) + print("Determining current revision info using git command: {0}".format(gitExecutable)) + completed = subprocess.run([gitExecutable, "rev-parse", "HEAD"], stdout=subprocess.PIPE) print("Command {0} returned: {1}".format(completed.args, completed.returncode)) revision = completed.stdout.decode("utf-8").strip() print("Revision: {0}".format(revision)) - print("Determining remote info using git command: {0}".format(gitexecutable)) - completed = subprocess.run([gitexecutable, "remote", "show", "origin"], stdout=subprocess.PIPE) + print("Determining remote info using git command: {0}".format(gitExecutable)) + completed = subprocess.run([gitExecutable, "remote", "show", "origin"], stdout=subprocess.PIPE) print("Command {0} returned: {1}".format(completed.args, completed.returncode)) remoteinfo = completed.stdout.decode("utf-8") print("Remote info: {0}".format(remoteinfo)) From 2fab1a566ec16460835b4aefda492ad56b435490 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 2 Dec 2017 21:48:37 +0000 Subject: [PATCH 28/96] Remove redundant files --- README.md | 0 README2.md | 0 version/differences.txt | 230 ---------------------------------------- 3 files changed, 230 deletions(-) delete mode 100644 README.md delete mode 100644 README2.md delete mode 100644 version/differences.txt diff --git a/README.md b/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/README2.md b/README2.md deleted file mode 100644 index e69de29..0000000 diff --git a/version/differences.txt b/version/differences.txt deleted file mode 100644 index 7ec3ad6..0000000 --- a/version/differences.txt +++ /dev/null @@ -1,230 +0,0 @@ -**************************************************************************************************** -**************************************************************************************************** -**************************************************************************************************** -**************************************************************************************************** -Looking for changes in origin/master that are not in origin/1.5.4 of the repository at path: /home/dan/home2/Development/inksystem -Executing: git log --oneline origin/1.5.4..origin/master -**************************************************************************************************** -IMB-Numbers Log: - IMB-11 - Further minor change to tooltip - Changed tooltip for PWN Frequency on ink pumps - Changed the Tooltips for PWM frequency and duty cycle - IMB-12 - Changed the order the events are generated in to prevent master from resetting slave - When a vent command is sent to a slave, it will demand a vent from its master - IMB-14 - Fixed state transition in Controlled Flow Master where it could get stuck in pre-flow - IMB-4 - - Add more logging - IMB-42 - Master sets the slaves to dormant when pre-idling - IMB-43 - Added purge abort for HP Type 2 - Fixed shared controlled flow transition for purge all slaves - Added Idle transitions from Purge - Added missing definition - Added explicit transitions for standby for all states for flowmode 1-3 - IMB-47 - - Tidied up checkStateR to be consistent with setValueR - - The thermistor will only generate an event if a threshold has been crossed, or when "timeToSendAnotherEvent" is true. - - The thermistor will only generate an event if a threshold has been crossed, or when "timeToSendAnotherEvent" is true. - IMB-50 - Temperature setpoint set when entering flow configuration to ensure correct heater operation - IMB-6 - Removed a white-space in the output - IMB-7 - Changed the formatting of the output - IMB-8 - When returning from a purge it now calls the same code as when going into idle, as they effectively were identical. - Added pre-flow to post-flow transitions and vice-versa - In gravity mode: removed the activation of the vacuum pump which speeds up ramps. This caused vent and pump to "fight" each other -**************************************************************************************************** -Revert log: -**************************************************************************************************** -Merges log: - Merge branch '1.10023.j6221-Type2_Pneumatic' of hydra:gis/inksystem into 1.10023.j6221-Type2_Pneumatic - Merge branch 'master' of hydra:gis/inksystem - Merge remote-tracking branch 'remotes/origin/1.10025.j6416-EthernetCongestion' into 1.10023.j6221-Type2_Pneumatic - Merge remote-tracking branch 'remotes/origin/1.5.2' into 1.10023.j6221-Type2_Pneumatic - Merge remote-tracking branch 'remotes/origin/1.5.5' - Merge remote-tracking branch 'remotes/origin/master' into 1.10023.j6221-Type2_Pneumatic -**************************************************************************************************** -Other log: - 095290c GIS-1621 - Make compilation work in case-sensitive linux - 0a8505d GIS-1621 - Remove test code - 0e8ccce GIS-6380 Removed ambiguous "absolute pressure" terminology - 149e0bf GIS 6221: Added logging for gravity mode - 169125b GIS-6221: Corrected Typo - 23c37d0 GIS 43: System will abort purge in a safe manner if standby command is issued - 37dd24b GIS 6479: Controlled flow master now goes through pre-flow. Fixed ordering in controlevent.c and .h - 41ac373 GIS-6253: Fixed bugs - 45cdfbe GIS 6591: Fixed if statement which outputs ITPD and OTPD - 468798e Update release notes whitespace - 4c2badc GIS-1621 - 16 bit integer is not printing correctly - 4c9a1aa GIS-6221 Vent the outlet bottle when purging to prevent "kick" on return from idle - 541c3bb GIS-6253: Added gravity flowmode - 5562461 GIS-6570 - Handle 0 length buffers being sent for TCP transmission; Add some logging for diagnosis - 577444e Update release notes for 1.5.5 - 5c6416b GIS-6416 - Instrument number of buffers on socket transmit queue and grapher empty buffer queue - 603de5a GIS-6221: Fixed more typos - 628b57d GIS 6221: Fixed typo - 6526df4 GIS-6221 Corrected behaviour at idle. When idling, the pressure is now only vacuum pump driven in one direction. - 6da6243 GIS-6221 Changed purge configuration, return from purge still to do - 7d263d0 GIS 6591: Change the output of the settings command on Telnet for clarity - 83f5517 Update 1.5.5 release notes with known issues - 85fc901 GIS-6570 - Handle condition when no bytes are consumed by sck_send (because the connection has died) for TCP transmission; Add some logging for diagnosis - 8a2db28 GIS-6221 Corrected behaviour at idle. When idling, the pressure is now only vacuum pump driven in one direction. - 8df4c1b GIS-1621 - Settings BSP files have changed unexpectedly from 1.5.4 - maybe causing a slow down - 92c135e GIS 6462 Fixed typo - 9400923 GIS-6516: Slave resets from vent when master is reset - 9964521 GIS 6253: Added methods for gravity mode logging in inkchannelinterface.cpp/h - a1f0025 GIS 43: Added PreIdle with slaves in controlled flow master - a900a24 GIS-6221: Changed Idle to be driven from Inlet Side - b2f4383 GIS-1620 - Correct string print - b42ea46 GIS-1621 - Handle version prefix - b498cd5 GIS 6462 Added on the fly idle pressure change in shared pressure controlled flow - b4e1b8c GIS 6221: Resolved merge conflicts and applied fixes from 1.5.3 to the Type 2 High Pressure mode - bbc5e45 GIS 6221 - Changed High Pressure Type 2 to flowmode 6 - bd69b60 GIS-6253: Fixed typos - c568789 GIS 6221 - Bug fixes High Pressure Type 2 Flow mode - c666970 GIS-6570 - Add some logging for diagnosis - c7bbf29 Fixed shared controlled flow transition for purge all slaves to standby - c962c65 GIS-6221 Added Purge Return via Idle - ca1e7b5 GIS-6253: Added the files for gravity flowmode - ca4473b GIS-1621 - Only send pressure updates if there is a 4 point difference in value - cb06440 GIS 6221: Changed descriptions of Flowmodes. Changed output of settings to show purge pressure for flowmode 5 and 6 - d4dd54d GIS 6462: Added on-the-fly pressure change for Shared Pressure Controlled Flow systems - da69186 GIS 6492: Dumpconfig now outputs the software version - df64abd Revert "GIS-1621 - Only send pressure updates if there is a 4 point difference in value" - e51971f GIS 6379: The purge pressure is only shown on High Pressure systems (flowmode 4 and 5) - e6b0227 GIS-6221 Corrected vent operation for outlet bottle - ec13b60 GIS-6416 - Handle multiple writes to a TCP stream until it becomes busy - f018a86 GIS 6479: Added an applysettings command to allow on the fly pressure and temperature changes - f7109ff GIS 43: Added purge to idle transitions for Gravity Mode - f87280b GIS 43: Fixed transition in cfm - f999765 GIS-6253: Removed redundant function - ff37df8 GIS-6253: Fixed typos - ff92b79 GIS 6591: Added statement on Master settings -**************************************************************************************************** -**************************************************************************************************** -**************************************************************************************************** -**************************************************************************************************** -Looking for changes in origin/1.5.4 that are not in origin/master of the repository at path: /home/dan/home2/Development/inksystem -Executing: git log --oneline origin/master..origin/1.5.4 -**************************************************************************************************** -IMB-Numbers Log: -**************************************************************************************************** -Revert log: -**************************************************************************************************** -Merges log: -**************************************************************************************************** -Other log: -**************************************************************************************************** -**************************************************************************************************** -**************************************************************************************************** -**************************************************************************************************** -Looking for changes that are not common to origin/master or origin/1.5.4 at path: /home/dan/home2/Development/inksystem -Executing: git log --oneline origin/master...origin/1.5.4 -**************************************************************************************************** -IMB-Numbers Log: - IMB-11 - Further minor change to tooltip - Changed tooltip for PWN Frequency on ink pumps - Changed the Tooltips for PWM frequency and duty cycle - IMB-12 - Changed the order the events are generated in to prevent master from resetting slave - When a vent command is sent to a slave, it will demand a vent from its master - IMB-14 - Fixed state transition in Controlled Flow Master where it could get stuck in pre-flow - IMB-4 - - Add more logging - IMB-42 - Master sets the slaves to dormant when pre-idling - IMB-43 - Added purge abort for HP Type 2 - Fixed shared controlled flow transition for purge all slaves - Added Idle transitions from Purge - Added missing definition - Added explicit transitions for standby for all states for flowmode 1-3 - IMB-47 - - Tidied up checkStateR to be consistent with setValueR - - The thermistor will only generate an event if a threshold has been crossed, or when "timeToSendAnotherEvent" is true. - - The thermistor will only generate an event if a threshold has been crossed, or when "timeToSendAnotherEvent" is true. - IMB-50 - Temperature setpoint set when entering flow configuration to ensure correct heater operation - IMB-6 - Removed a white-space in the output - IMB-7 - Changed the formatting of the output - IMB-8 - When returning from a purge it now calls the same code as when going into idle, as they effectively were identical. - Added pre-flow to post-flow transitions and vice-versa - In gravity mode: removed the activation of the vacuum pump which speeds up ramps. This caused vent and pump to "fight" each other -**************************************************************************************************** -Revert log: -**************************************************************************************************** -Merges log: - Merge branch '1.10023.j6221-Type2_Pneumatic' of hydra:gis/inksystem into 1.10023.j6221-Type2_Pneumatic - Merge branch 'master' of hydra:gis/inksystem - Merge remote-tracking branch 'remotes/origin/1.10025.j6416-EthernetCongestion' into 1.10023.j6221-Type2_Pneumatic - Merge remote-tracking branch 'remotes/origin/1.5.2' into 1.10023.j6221-Type2_Pneumatic - Merge remote-tracking branch 'remotes/origin/1.5.5' - Merge remote-tracking branch 'remotes/origin/master' into 1.10023.j6221-Type2_Pneumatic -**************************************************************************************************** -Other log: - 095290c GIS-1621 - Make compilation work in case-sensitive linux - 0a8505d GIS-1621 - Remove test code - 0e8ccce GIS-6380 Removed ambiguous "absolute pressure" terminology - 149e0bf GIS 6221: Added logging for gravity mode - 169125b GIS-6221: Corrected Typo - 23c37d0 GIS 43: System will abort purge in a safe manner if standby command is issued - 37dd24b GIS 6479: Controlled flow master now goes through pre-flow. Fixed ordering in controlevent.c and .h - 41ac373 GIS-6253: Fixed bugs - 45cdfbe GIS 6591: Fixed if statement which outputs ITPD and OTPD - 468798e Update release notes whitespace - 4c2badc GIS-1621 - 16 bit integer is not printing correctly - 4c9a1aa GIS-6221 Vent the outlet bottle when purging to prevent "kick" on return from idle - 541c3bb GIS-6253: Added gravity flowmode - 5562461 GIS-6570 - Handle 0 length buffers being sent for TCP transmission; Add some logging for diagnosis - 577444e Update release notes for 1.5.5 - 5c6416b GIS-6416 - Instrument number of buffers on socket transmit queue and grapher empty buffer queue - 603de5a GIS-6221: Fixed more typos - 628b57d GIS 6221: Fixed typo - 6526df4 GIS-6221 Corrected behaviour at idle. When idling, the pressure is now only vacuum pump driven in one direction. - 6da6243 GIS-6221 Changed purge configuration, return from purge still to do - 7d263d0 GIS 6591: Change the output of the settings command on Telnet for clarity - 83f5517 Update 1.5.5 release notes with known issues - 85fc901 GIS-6570 - Handle condition when no bytes are consumed by sck_send (because the connection has died) for TCP transmission; Add some logging for diagnosis - 8a2db28 GIS-6221 Corrected behaviour at idle. When idling, the pressure is now only vacuum pump driven in one direction. - 8df4c1b GIS-1621 - Settings BSP files have changed unexpectedly from 1.5.4 - maybe causing a slow down - 92c135e GIS 6462 Fixed typo - 9400923 GIS-6516: Slave resets from vent when master is reset - 9964521 GIS 6253: Added methods for gravity mode logging in inkchannelinterface.cpp/h - a1f0025 GIS 43: Added PreIdle with slaves in controlled flow master - a900a24 GIS-6221: Changed Idle to be driven from Inlet Side - b2f4383 GIS-1620 - Correct string print - b42ea46 GIS-1621 - Handle version prefix - b498cd5 GIS 6462 Added on the fly idle pressure change in shared pressure controlled flow - b4e1b8c GIS 6221: Resolved merge conflicts and applied fixes from 1.5.3 to the Type 2 High Pressure mode - bbc5e45 GIS 6221 - Changed High Pressure Type 2 to flowmode 6 - bd69b60 GIS-6253: Fixed typos - c568789 GIS 6221 - Bug fixes High Pressure Type 2 Flow mode - c666970 GIS-6570 - Add some logging for diagnosis - c7bbf29 Fixed shared controlled flow transition for purge all slaves to standby - c962c65 GIS-6221 Added Purge Return via Idle - ca1e7b5 GIS-6253: Added the files for gravity flowmode - ca4473b GIS-1621 - Only send pressure updates if there is a 4 point difference in value - cb06440 GIS 6221: Changed descriptions of Flowmodes. Changed output of settings to show purge pressure for flowmode 5 and 6 - d4dd54d GIS 6462: Added on-the-fly pressure change for Shared Pressure Controlled Flow systems - da69186 GIS 6492: Dumpconfig now outputs the software version - df64abd Revert "GIS-1621 - Only send pressure updates if there is a 4 point difference in value" - e51971f GIS 6379: The purge pressure is only shown on High Pressure systems (flowmode 4 and 5) - e6b0227 GIS-6221 Corrected vent operation for outlet bottle - ec13b60 GIS-6416 - Handle multiple writes to a TCP stream until it becomes busy - f018a86 GIS 6479: Added an applysettings command to allow on the fly pressure and temperature changes - f7109ff GIS 43: Added purge to idle transitions for Gravity Mode - f87280b GIS 43: Fixed transition in cfm - f999765 GIS-6253: Removed redundant function - ff37df8 GIS-6253: Fixed typos - ff92b79 GIS 6591: Added statement on Master settings From 4dbbbf2b4247eb39770d2c9f4d4498ed1f4a8c0d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 7 Dec 2017 13:13:23 +0000 Subject: [PATCH 29/96] Provide a comma seperated build stamp --- versionnumbering/versioninfo.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/versionnumbering/versioninfo.py b/versionnumbering/versioninfo.py index c8c79fe..a4162e0 100644 --- a/versionnumbering/versioninfo.py +++ b/versionnumbering/versioninfo.py @@ -124,6 +124,10 @@ def writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevision, r with open(os.path.join(versionfolder, "buildstamp.txt"), 'w') as f: f.write(buildstamp) + buildstampcommasep = buildstamp.replace(".", ",") + with open(os.path.join(versionfolder, "buildstampcommasep.txt"), 'w') as f: + f.write(buildstampcommasep) + def main(argv=None): # IGNORE:C0111 '''Command line options.''' From 584a016c493000ae456182f37b4c50bdf739f9c9 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 7 Dec 2017 13:33:27 +0000 Subject: [PATCH 30/96] Move code to common position --- build/eclipsebuild/eclipsebuild.gsh | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 build/eclipsebuild/eclipsebuild.gsh diff --git a/build/eclipsebuild/eclipsebuild.gsh b/build/eclipsebuild/eclipsebuild.gsh new file mode 100644 index 0000000..e7dcd09 --- /dev/null +++ b/build/eclipsebuild/eclipsebuild.gsh @@ -0,0 +1,34 @@ +// Build and export files +def doBuild(apps) { + for (appInfo in apps ) { + if (appInfo[0]) + { + retry(3) { // Eclipse occasionally raises exceptions (rather than the builds failing) + if (isUnix()) { + sh "${BUILD_COMMAND} -build ${appInfo[1]}/${BUILD_VARIANT}" + } + else { + bat "%BUILD_COMMAND% -build ${appInfo[1]}/${BUILD_VARIANT}" + } + } + echo "Looking at: ${appInfo[2]}" + script { + env.destFolder = "${WORKSPACE}/export/${appInfo[1]}" + env.srcFile = "${WORKSPACE}/${appInfo[2]}" + } + dir (env.destFolder) { + if (appInfo[2]) { + echo "Copy ${srcFile} to ${destFolder}" + if (isUnix()) { + sh 'cp \"${srcFile}\" ${destFolder}' + } + else { + bat 'copy \"%srcFile%\" %destFolder%' + } + } + } + } + } +} + +return this; \ No newline at end of file From aeb712f07339a59e87b47703c71e9e4444313871 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 19 Dec 2017 13:24:11 +0000 Subject: [PATCH 31/96] Make variants of build all in one run --- build/eclipsebuild/eclipsebuild.gsh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/build/eclipsebuild/eclipsebuild.gsh b/build/eclipsebuild/eclipsebuild.gsh index e7dcd09..579a413 100644 --- a/build/eclipsebuild/eclipsebuild.gsh +++ b/build/eclipsebuild/eclipsebuild.gsh @@ -1,23 +1,28 @@ // Build and export files def doBuild(apps) { for (appInfo in apps ) { - if (appInfo[0]) + env.build = appInfo[0] + env.project = appInfo[1] + env.variants = appInfo[2] + env.exportpath = appInfo[3] + if (build) { - retry(3) { // Eclipse occasionally raises exceptions (rather than the builds failing) + for (build_variant in variants) { + retry(3) { // Eclipse occasionally raises exceptions (rather than the builds failing) if (isUnix()) { - sh "${BUILD_COMMAND} -build ${appInfo[1]}/${BUILD_VARIANT}" + sh "${BUILD_COMMAND} -build ${project}/${build_variant}" } else { - bat "%BUILD_COMMAND% -build ${appInfo[1]}/${BUILD_VARIANT}" + bat "%BUILD_COMMAND% -build ${project}/${build_variant}" } } - echo "Looking at: ${appInfo[2]}" + echo "Export path at: ${exportpath}" script { - env.destFolder = "${WORKSPACE}/export/${appInfo[1]}" - env.srcFile = "${WORKSPACE}/${appInfo[2]}" + env.destFolder = "${WORKSPACE}/export/${project}" + env.srcFile = "${WORKSPACE}/${exportpath}" } dir (env.destFolder) { - if (appInfo[2]) { + if (exportpath) { echo "Copy ${srcFile} to ${destFolder}" if (isUnix()) { sh 'cp \"${srcFile}\" ${destFolder}' From 12a002f5a5dbe22a22255019d5ea27364005c179 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 19 Dec 2017 15:35:20 +0000 Subject: [PATCH 32/96] Make variants of build all in one run --- build/eclipsebuild/eclipsebuild.gsh | 1 + 1 file changed, 1 insertion(+) diff --git a/build/eclipsebuild/eclipsebuild.gsh b/build/eclipsebuild/eclipsebuild.gsh index 579a413..c7876d2 100644 --- a/build/eclipsebuild/eclipsebuild.gsh +++ b/build/eclipsebuild/eclipsebuild.gsh @@ -20,6 +20,7 @@ def doBuild(apps) { script { env.destFolder = "${WORKSPACE}/export/${project}" env.srcFile = "${WORKSPACE}/${exportpath}" + env.srcFileExpanded = "${srcFile}" } dir (env.destFolder) { if (exportpath) { From ff5b8f515e7514a31e5aecbb7022c8344b81f9a5 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 19 Dec 2017 15:43:11 +0000 Subject: [PATCH 33/96] Make variants of build all in one run --- build/eclipsebuild/eclipsebuild.gsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/eclipsebuild/eclipsebuild.gsh b/build/eclipsebuild/eclipsebuild.gsh index c7876d2..a4ee79a 100644 --- a/build/eclipsebuild/eclipsebuild.gsh +++ b/build/eclipsebuild/eclipsebuild.gsh @@ -20,16 +20,16 @@ def doBuild(apps) { script { env.destFolder = "${WORKSPACE}/export/${project}" env.srcFile = "${WORKSPACE}/${exportpath}" - env.srcFileExpanded = "${srcFile}" + env.srcFileExpanded = srcFile.replace("-BUILDVARIANT-", "${build_variant}") } dir (env.destFolder) { if (exportpath) { - echo "Copy ${srcFile} to ${destFolder}" + echo "Copy ${srcFileExpanded} to ${destFolder}" if (isUnix()) { - sh 'cp \"${srcFile}\" ${destFolder}' + sh 'cp \"${srcFileExpanded}\" ${destFolder}' } else { - bat 'copy \"%srcFile%\" %destFolder%' + bat 'copy \"%srcFileExpanded%\" %destFolder%' } } } From c21c6348a423654bb9a9d863863877b2bf4ba371 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 19 Dec 2017 16:16:09 +0000 Subject: [PATCH 34/96] Make variants of build all in one run --- build/eclipsebuild/eclipsebuild.gsh | 50 ++++++++++++++--------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/build/eclipsebuild/eclipsebuild.gsh b/build/eclipsebuild/eclipsebuild.gsh index a4ee79a..6e24393 100644 --- a/build/eclipsebuild/eclipsebuild.gsh +++ b/build/eclipsebuild/eclipsebuild.gsh @@ -1,38 +1,38 @@ // Build and export files def doBuild(apps) { for (appInfo in apps ) { - env.build = appInfo[0] - env.project = appInfo[1] - env.variants = appInfo[2] - env.exportpath = appInfo[3] - if (build) - { + build = appInfo[0] + project = appInfo[1] + variants = appInfo[2] + exportpath = appInfo[3] + if (build) { for (build_variant in variants) { retry(3) { // Eclipse occasionally raises exceptions (rather than the builds failing) - if (isUnix()) { - sh "${BUILD_COMMAND} -build ${project}/${build_variant}" - } - else { - bat "%BUILD_COMMAND% -build ${project}/${build_variant}" - } - } - echo "Export path at: ${exportpath}" - script { - env.destFolder = "${WORKSPACE}/export/${project}" - env.srcFile = "${WORKSPACE}/${exportpath}" - env.srcFileExpanded = srcFile.replace("-BUILDVARIANT-", "${build_variant}") - } - dir (env.destFolder) { - if (exportpath) { - echo "Copy ${srcFileExpanded} to ${destFolder}" if (isUnix()) { - sh 'cp \"${srcFileExpanded}\" ${destFolder}' + sh "${BUILD_COMMAND} -build ${project}/${build_variant}" } else { - bat 'copy \"%srcFileExpanded%\" %destFolder%' + bat "%BUILD_COMMAND% -build ${project}/${build_variant}" } } - } + echo "Export path at: ${exportpath}" + script { + env.destFolder = "${WORKSPACE}/export/${project}" + env.srcFile = "${WORKSPACE}/${exportpath}" + env.srcFileExpanded = srcFile.replace("-BUILDVARIANT-", "${build_variant}") + } + dir (env.destFolder) { + if (exportpath) { + echo "Copy ${srcFileExpanded} to ${destFolder}" + if (isUnix()) { + sh 'cp \"${srcFileExpanded}\" ${destFolder}' + } + else { + bat 'copy \"%srcFileExpanded%\" %destFolder%' + } + } + } + } } } } From e76809830b161294c1c832747423df3728ac033e Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 19 Dec 2017 16:26:19 +0000 Subject: [PATCH 35/96] Make variants of build all in one run --- build/eclipsebuild/eclipsebuild.gsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/eclipsebuild/eclipsebuild.gsh b/build/eclipsebuild/eclipsebuild.gsh index 6e24393..351f9d5 100644 --- a/build/eclipsebuild/eclipsebuild.gsh +++ b/build/eclipsebuild/eclipsebuild.gsh @@ -17,7 +17,7 @@ def doBuild(apps) { } echo "Export path at: ${exportpath}" script { - env.destFolder = "${WORKSPACE}/export/${project}" + env.destFolder = "${WORKSPACE}/export/${build_variant}/${project}" env.srcFile = "${WORKSPACE}/${exportpath}" env.srcFileExpanded = srcFile.replace("-BUILDVARIANT-", "${build_variant}") } From 75d8716a0a6ceb1e53a64984fd9765b5323cb8f8 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 19 Dec 2017 16:30:18 +0000 Subject: [PATCH 36/96] Make variants of build all in one run --- build/eclipsebuild/eclipsebuild.gsh | 30 +++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/build/eclipsebuild/eclipsebuild.gsh b/build/eclipsebuild/eclipsebuild.gsh index 351f9d5..26ed411 100644 --- a/build/eclipsebuild/eclipsebuild.gsh +++ b/build/eclipsebuild/eclipsebuild.gsh @@ -15,20 +15,22 @@ def doBuild(apps) { bat "%BUILD_COMMAND% -build ${project}/${build_variant}" } } - echo "Export path at: ${exportpath}" - script { - env.destFolder = "${WORKSPACE}/export/${build_variant}/${project}" - env.srcFile = "${WORKSPACE}/${exportpath}" - env.srcFileExpanded = srcFile.replace("-BUILDVARIANT-", "${build_variant}") - } - dir (env.destFolder) { - if (exportpath) { - echo "Copy ${srcFileExpanded} to ${destFolder}" - if (isUnix()) { - sh 'cp \"${srcFileExpanded}\" ${destFolder}' - } - else { - bat 'copy \"%srcFileExpanded%\" %destFolder%' + if (exportpath) { + echo "Export path at: ${exportpath}" + script { + env.destFolder = "${WORKSPACE}/export/${build_variant}/${project}" + env.srcFile = "${WORKSPACE}/${exportpath}" + env.srcFileExpanded = srcFile.replace("-BUILDVARIANT-", "${build_variant}") + } + dir (env.destFolder) { + if (exportpath) { + echo "Copy ${srcFileExpanded} to ${destFolder}" + if (isUnix()) { + sh 'cp \"${srcFileExpanded}\" ${destFolder}' + } + else { + bat 'copy \"%srcFileExpanded%\" %destFolder%' + } } } } From cfbc3e70c58f182d0eefd7e70f58cbc2ec5a9186 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 19 Dec 2017 18:17:15 +0000 Subject: [PATCH 37/96] Add version stamping --- versionstamping/.project | 17 ++++++++++++++ versionstamping/.pydevproject | 8 +++++++ versionstamping/versionstamper.py | 37 +++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 versionstamping/.project create mode 100644 versionstamping/.pydevproject create mode 100644 versionstamping/versionstamper.py diff --git a/versionstamping/.project b/versionstamping/.project new file mode 100644 index 0000000..74928d6 --- /dev/null +++ b/versionstamping/.project @@ -0,0 +1,17 @@ + + + versionstamping + + + + + + org.python.pydev.PyDevBuilder + + + + + + org.python.pydev.pythonNature + + diff --git a/versionstamping/.pydevproject b/versionstamping/.pydevproject new file mode 100644 index 0000000..746d0f0 --- /dev/null +++ b/versionstamping/.pydevproject @@ -0,0 +1,8 @@ + + + +/${PROJECT_DIR_NAME} + +python 3.0 +python35 + diff --git a/versionstamping/versionstamper.py b/versionstamping/versionstamper.py new file mode 100644 index 0000000..45c94e2 --- /dev/null +++ b/versionstamping/versionstamper.py @@ -0,0 +1,37 @@ +import argparse +import sys +import shutil +from builtins import FileNotFoundError + +def main(argv): + parser = argparse.ArgumentParser(description="Look for version number pattern in file and replace with autobuild version number") + + # Call once arguments to allow or disallow something + parser.add_argument('-f', '--filetoconvert', help='The file to convert') + parser.add_argument('-p', '--pattern', default='1.30000.0.0', help='The pattern to search for and replace') + parser.add_argument('-s', '--substitute', help='The new version number that will substitute the pattern') + + args = parser.parse_args(argv) + + filetoconvert = args.filetoconvert + pattern = args.pattern + substitute = args.substitute + + print("Converting incidences of {0} with {1} in file: {2}\n".format(pattern, substitute, filetoconvert)) + + filecopy = filetoconvert + ".orig" + try: + shutil.move(filetoconvert, filecopy) + except FileNotFoundError: + print("Could not find file: {0}\n".format(filetoconvert)) + return 1 + + with open(filetoconvert, 'x') as f: + with open(filecopy) as c: + converted = c.read().replace(pattern, substitute) + f.write(converted) + + return 0 + +if __name__ == "__main__": + sys.exit(main(sys.argv[1:])) From 64926607ca790789319e01f03ab5595f546b6eb7 Mon Sep 17 00:00:00 2001 From: georgelinsdell Date: Wed, 20 Dec 2017 15:09:34 +0000 Subject: [PATCH 38/96] REVIEW ME: Changing the versionstamp target from 1.30000.0.0 to 1.3000.0.0 so that it stamps over what the ESW is currently outputting by default. This may need to be reverted and the version of the ESW output changed. --- versionstamping/versionstamper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versionstamping/versionstamper.py b/versionstamping/versionstamper.py index 45c94e2..8e445d2 100644 --- a/versionstamping/versionstamper.py +++ b/versionstamping/versionstamper.py @@ -8,7 +8,7 @@ def main(argv): # Call once arguments to allow or disallow something parser.add_argument('-f', '--filetoconvert', help='The file to convert') - parser.add_argument('-p', '--pattern', default='1.30000.0.0', help='The pattern to search for and replace') + parser.add_argument('-p', '--pattern', default='1.3000.0.0', help='The pattern to search for and replace') parser.add_argument('-s', '--substitute', help='The new version number that will substitute the pattern') args = parser.parse_args(argv) From 3c1b453b21ee7bb07b8e93f31ca7a4bf118b206c Mon Sep 17 00:00:00 2001 From: georgelinsdell Date: Wed, 20 Dec 2017 15:16:24 +0000 Subject: [PATCH 39/96] Reverting change as i have realized the blunder --- versionstamping/versionstamper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versionstamping/versionstamper.py b/versionstamping/versionstamper.py index 8e445d2..45c94e2 100644 --- a/versionstamping/versionstamper.py +++ b/versionstamping/versionstamper.py @@ -8,7 +8,7 @@ def main(argv): # Call once arguments to allow or disallow something parser.add_argument('-f', '--filetoconvert', help='The file to convert') - parser.add_argument('-p', '--pattern', default='1.3000.0.0', help='The pattern to search for and replace') + parser.add_argument('-p', '--pattern', default='1.30000.0.0', help='The pattern to search for and replace') parser.add_argument('-s', '--substitute', help='The new version number that will substitute the pattern') args = parser.parse_args(argv) From f3107d5dcfc9cee65a8ac3be876611cea2b417dd Mon Sep 17 00:00:00 2001 From: georgelinsdell Date: Wed, 20 Dec 2017 15:35:58 +0000 Subject: [PATCH 40/96] Adding Debugging for conversion script, Reverting the conversion values for build.gsh --- versionstamping/versionstamper.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/versionstamping/versionstamper.py b/versionstamping/versionstamper.py index 45c94e2..ff5eb0d 100644 --- a/versionstamping/versionstamper.py +++ b/versionstamping/versionstamper.py @@ -28,7 +28,9 @@ def main(argv): with open(filetoconvert, 'x') as f: with open(filecopy) as c: + print("Detected %s instances of %s pre-conversion"%(c.count(pattern),pattern)) converted = c.read().replace(pattern, substitute) + print("Confirmed %s instances of %s post-conversion"%s(converted.count(substitute),substitute)) f.write(converted) return 0 From 35cbc075a36d1a0ed8f83e8a7ef4651f23c5ef79 Mon Sep 17 00:00:00 2001 From: georgelinsdell Date: Wed, 20 Dec 2017 15:37:44 +0000 Subject: [PATCH 41/96] Read the file before attempting to count instances within it. --- versionstamping/versionstamper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versionstamping/versionstamper.py b/versionstamping/versionstamper.py index ff5eb0d..8b43e48 100644 --- a/versionstamping/versionstamper.py +++ b/versionstamping/versionstamper.py @@ -28,7 +28,7 @@ def main(argv): with open(filetoconvert, 'x') as f: with open(filecopy) as c: - print("Detected %s instances of %s pre-conversion"%(c.count(pattern),pattern)) + print("Detected %s instances of %s pre-conversion"%(c.read().count(pattern),pattern)) converted = c.read().replace(pattern, substitute) print("Confirmed %s instances of %s post-conversion"%s(converted.count(substitute),substitute)) f.write(converted) From 58feb9612024208857ecc670294a931876d55949 Mon Sep 17 00:00:00 2001 From: georgelinsdell Date: Wed, 20 Dec 2017 15:38:48 +0000 Subject: [PATCH 42/96] silly 's' --- versionstamping/versionstamper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versionstamping/versionstamper.py b/versionstamping/versionstamper.py index 8b43e48..48d9f45 100644 --- a/versionstamping/versionstamper.py +++ b/versionstamping/versionstamper.py @@ -30,7 +30,7 @@ def main(argv): with open(filecopy) as c: print("Detected %s instances of %s pre-conversion"%(c.read().count(pattern),pattern)) converted = c.read().replace(pattern, substitute) - print("Confirmed %s instances of %s post-conversion"%s(converted.count(substitute),substitute)) + print("Confirmed %s instances of %s post-conversion"%(converted.count(substitute),substitute)) f.write(converted) return 0 From 1124ca5cd683fa690db227c97d7b9e458c1f0e55 Mon Sep 17 00:00:00 2001 From: georgelinsdell Date: Wed, 20 Dec 2017 15:51:45 +0000 Subject: [PATCH 43/96] close the files after we have read/written them. explicily open copy file for reading --- versionstamping/versionstamper.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/versionstamping/versionstamper.py b/versionstamping/versionstamper.py index 48d9f45..f42e54d 100644 --- a/versionstamping/versionstamper.py +++ b/versionstamping/versionstamper.py @@ -27,11 +27,13 @@ def main(argv): return 1 with open(filetoconvert, 'x') as f: - with open(filecopy) as c: + with open(filecopy,'r') as c: print("Detected %s instances of %s pre-conversion"%(c.read().count(pattern),pattern)) converted = c.read().replace(pattern, substitute) print("Confirmed %s instances of %s post-conversion"%(converted.count(substitute),substitute)) f.write(converted) + c.close() + f.close() return 0 From 9b75cd07247ae0d7908a709611a795709593928e Mon Sep 17 00:00:00 2001 From: georgelinsdell Date: Wed, 20 Dec 2017 15:52:52 +0000 Subject: [PATCH 44/96] Print Converted as debug info. --- versionstamping/versionstamper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/versionstamping/versionstamper.py b/versionstamping/versionstamper.py index f42e54d..d953aa4 100644 --- a/versionstamping/versionstamper.py +++ b/versionstamping/versionstamper.py @@ -30,6 +30,7 @@ def main(argv): with open(filecopy,'r') as c: print("Detected %s instances of %s pre-conversion"%(c.read().count(pattern),pattern)) converted = c.read().replace(pattern, substitute) + print ("DEBUG: %s "%converted) print("Confirmed %s instances of %s post-conversion"%(converted.count(substitute),substitute)) f.write(converted) c.close() From 42bdcc82e2e35fa367d2e7cf66ed6490cc07fc43 Mon Sep 17 00:00:00 2001 From: georgelinsdell Date: Wed, 20 Dec 2017 15:58:54 +0000 Subject: [PATCH 45/96] Read to local variable rather than double reading from file. --- versionstamping/versionstamper.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/versionstamping/versionstamper.py b/versionstamping/versionstamper.py index d953aa4..da01aa2 100644 --- a/versionstamping/versionstamper.py +++ b/versionstamping/versionstamper.py @@ -28,12 +28,13 @@ def main(argv): with open(filetoconvert, 'x') as f: with open(filecopy,'r') as c: - print("Detected %s instances of %s pre-conversion"%(c.read().count(pattern),pattern)) - converted = c.read().replace(pattern, substitute) + fileread = c.read() + c.close() + print("Detected %s instances of %s pre-conversion"%(fileread.count(pattern),pattern)) + converted = fileread.replace(pattern, substitute) print ("DEBUG: %s "%converted) print("Confirmed %s instances of %s post-conversion"%(converted.count(substitute),substitute)) f.write(converted) - c.close() f.close() return 0 From ae37de4bc32d1ca82b254d7a9cda94319b541e41 Mon Sep 17 00:00:00 2001 From: georgelinsdell Date: Wed, 20 Dec 2017 16:00:08 +0000 Subject: [PATCH 46/96] Comment Debug Print --- versionstamping/versionstamper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versionstamping/versionstamper.py b/versionstamping/versionstamper.py index da01aa2..ebfad73 100644 --- a/versionstamping/versionstamper.py +++ b/versionstamping/versionstamper.py @@ -32,7 +32,7 @@ def main(argv): c.close() print("Detected %s instances of %s pre-conversion"%(fileread.count(pattern),pattern)) converted = fileread.replace(pattern, substitute) - print ("DEBUG: %s "%converted) + #print ("DEBUG: %s "%converted) print("Confirmed %s instances of %s post-conversion"%(converted.count(substitute),substitute)) f.write(converted) f.close() From 3c0896f1ee63e63d11c065e8836c9725fbf5b8d2 Mon Sep 17 00:00:00 2001 From: georgelinsdell Date: Wed, 20 Dec 2017 16:32:16 +0000 Subject: [PATCH 47/96] Remove File.close() calls as they are not neccessary --- versionstamping/versionstamper.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/versionstamping/versionstamper.py b/versionstamping/versionstamper.py index ebfad73..3e59c6f 100644 --- a/versionstamping/versionstamper.py +++ b/versionstamping/versionstamper.py @@ -29,13 +29,11 @@ def main(argv): with open(filetoconvert, 'x') as f: with open(filecopy,'r') as c: fileread = c.read() - c.close() print("Detected %s instances of %s pre-conversion"%(fileread.count(pattern),pattern)) converted = fileread.replace(pattern, substitute) #print ("DEBUG: %s "%converted) print("Confirmed %s instances of %s post-conversion"%(converted.count(substitute),substitute)) f.write(converted) - f.close() return 0 From 82b7ef85bd50d57db1b3bdfe458430ca2c5ab8a8 Mon Sep 17 00:00:00 2001 From: Damian Smith Date: Fri, 12 Jan 2018 15:57:39 +0000 Subject: [PATCH 48/96] Update versioninfo.py so that default prefix ends with a period (1.30000.0.) --- versionnumbering/versioninfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versionnumbering/versioninfo.py b/versionnumbering/versioninfo.py index a4162e0..59b5225 100644 --- a/versionnumbering/versioninfo.py +++ b/versionnumbering/versioninfo.py @@ -68,7 +68,7 @@ def getGitRevision(gitrootpath, basenumber): def getVersionPrefix(sourcebranch): print("Determining version number prefix from source branch name: {0}".format(sourcebranch)) - defaultversionprefix = "1.30000.0" + defaultversionprefix = "1.30000.0." splits = sourcebranch.split('/') if len(splits) < 1: print("Source branch name is invalid. Defaulting to: {0}".format(defaultversionprefix)) From 22d283a9985c4ea16ce1ea0af4235f04bb7b25dd Mon Sep 17 00:00:00 2001 From: danielbujnik Date: Tue, 13 Feb 2018 09:56:48 +0000 Subject: [PATCH 49/96] Accounting for project names containing spaces. --- build/eclipsebuild/eclipsebuild.gsh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/build/eclipsebuild/eclipsebuild.gsh b/build/eclipsebuild/eclipsebuild.gsh index 26ed411..5d55fe5 100644 --- a/build/eclipsebuild/eclipsebuild.gsh +++ b/build/eclipsebuild/eclipsebuild.gsh @@ -1,18 +1,19 @@ // Build and export files def doBuild(apps) { for (appInfo in apps ) { - build = appInfo[0] - project = appInfo[1] - variants = appInfo[2] - exportpath = appInfo[3] + (build, project, variants, exportpath) = appInfo if (build) { for (build_variant in variants) { retry(3) { // Eclipse occasionally raises exceptions (rather than the builds failing) if (isUnix()) { - sh "${BUILD_COMMAND} -build ${project}/${build_variant}" + sh """ + "${BUILD_COMMAND}" -build "${project}/${build_variant}" + """ } else { - bat "%BUILD_COMMAND% -build ${project}/${build_variant}" + bat """ + "%BUILD_COMMAND%" -build "${project}\\${build_variant}" + """ } } if (exportpath) { @@ -39,4 +40,4 @@ def doBuild(apps) { } } -return this; \ No newline at end of file +return this; From 74e7696ef6dc4f748e810de6300b8ad1d737164f Mon Sep 17 00:00:00 2001 From: danielbujnik Date: Tue, 13 Feb 2018 10:39:40 +0000 Subject: [PATCH 50/96] Auto build fix. --- build/eclipsebuild/eclipsebuild.gsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/eclipsebuild/eclipsebuild.gsh b/build/eclipsebuild/eclipsebuild.gsh index 5d55fe5..da349c6 100644 --- a/build/eclipsebuild/eclipsebuild.gsh +++ b/build/eclipsebuild/eclipsebuild.gsh @@ -7,7 +7,7 @@ def doBuild(apps) { retry(3) { // Eclipse occasionally raises exceptions (rather than the builds failing) if (isUnix()) { sh """ - "${BUILD_COMMAND}" -build "${project}/${build_variant}" + \"${BUILD_COMMAND}\" -build \"${project}/${build_variant}\" """ } else { From 7d8891e227f95361fdc0a2b80b3c1cb114053525 Mon Sep 17 00:00:00 2001 From: danielbujnik Date: Tue, 13 Feb 2018 10:53:00 +0000 Subject: [PATCH 51/96] Auto build fix. --- build/eclipsebuild/eclipsebuild.gsh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/build/eclipsebuild/eclipsebuild.gsh b/build/eclipsebuild/eclipsebuild.gsh index da349c6..b4bbc34 100644 --- a/build/eclipsebuild/eclipsebuild.gsh +++ b/build/eclipsebuild/eclipsebuild.gsh @@ -6,10 +6,8 @@ def doBuild(apps) { for (build_variant in variants) { retry(3) { // Eclipse occasionally raises exceptions (rather than the builds failing) if (isUnix()) { - sh """ - \"${BUILD_COMMAND}\" -build \"${project}/${build_variant}\" - """ - } + sh "${BUILD_COMMAND} -build \"${project}/${build_variant}\"" + } else { bat """ "%BUILD_COMMAND%" -build "${project}\\${build_variant}" From ec0055e572f26eedfbd33134a2da4a1d403e04eb Mon Sep 17 00:00:00 2001 From: danielbujnik Date: Tue, 13 Feb 2018 10:56:32 +0000 Subject: [PATCH 52/96] Auto build fix. --- build/eclipsebuild/eclipsebuild.gsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/eclipsebuild/eclipsebuild.gsh b/build/eclipsebuild/eclipsebuild.gsh index b4bbc34..0ba188d 100644 --- a/build/eclipsebuild/eclipsebuild.gsh +++ b/build/eclipsebuild/eclipsebuild.gsh @@ -6,7 +6,7 @@ def doBuild(apps) { for (build_variant in variants) { retry(3) { // Eclipse occasionally raises exceptions (rather than the builds failing) if (isUnix()) { - sh "${BUILD_COMMAND} -build \"${project}/${build_variant}\"" + sh '${BUILD_COMMAND} -build "${project}/${build_variant}"' } else { bat """ From 61d581de84a5cef38c55e2e345f20f9b447b9130 Mon Sep 17 00:00:00 2001 From: danielbujnik Date: Tue, 13 Feb 2018 11:02:51 +0000 Subject: [PATCH 53/96] Auto build fix. --- build/eclipsebuild/eclipsebuild.gsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/eclipsebuild/eclipsebuild.gsh b/build/eclipsebuild/eclipsebuild.gsh index 0ba188d..b4bbc34 100644 --- a/build/eclipsebuild/eclipsebuild.gsh +++ b/build/eclipsebuild/eclipsebuild.gsh @@ -6,7 +6,7 @@ def doBuild(apps) { for (build_variant in variants) { retry(3) { // Eclipse occasionally raises exceptions (rather than the builds failing) if (isUnix()) { - sh '${BUILD_COMMAND} -build "${project}/${build_variant}"' + sh "${BUILD_COMMAND} -build \"${project}/${build_variant}\"" } else { bat """ From 4400c698df7a556eca83fe1d474c0d066486f6d6 Mon Sep 17 00:00:00 2001 From: danielbujnik Date: Tue, 13 Feb 2018 11:08:10 +0000 Subject: [PATCH 54/96] Auto build fix. --- build/eclipsebuild/eclipsebuild.gsh | 1 + 1 file changed, 1 insertion(+) diff --git a/build/eclipsebuild/eclipsebuild.gsh b/build/eclipsebuild/eclipsebuild.gsh index b4bbc34..367b454 100644 --- a/build/eclipsebuild/eclipsebuild.gsh +++ b/build/eclipsebuild/eclipsebuild.gsh @@ -6,6 +6,7 @@ def doBuild(apps) { for (build_variant in variants) { retry(3) { // Eclipse occasionally raises exceptions (rather than the builds failing) if (isUnix()) { + echo "Build command: ${BUILD_COMMAND} -build \"${project}/${build_variant}\"" sh "${BUILD_COMMAND} -build \"${project}/${build_variant}\"" } else { From c55ffd413675729698bcf1467d25ba05306bc3b6 Mon Sep 17 00:00:00 2001 From: danielbujnik Date: Tue, 13 Feb 2018 11:29:10 +0000 Subject: [PATCH 55/96] Auto build fix. --- build/eclipsebuild/eclipsebuild.gsh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/build/eclipsebuild/eclipsebuild.gsh b/build/eclipsebuild/eclipsebuild.gsh index 367b454..5384341 100644 --- a/build/eclipsebuild/eclipsebuild.gsh +++ b/build/eclipsebuild/eclipsebuild.gsh @@ -6,13 +6,11 @@ def doBuild(apps) { for (build_variant in variants) { retry(3) { // Eclipse occasionally raises exceptions (rather than the builds failing) if (isUnix()) { - echo "Build command: ${BUILD_COMMAND} -build \"${project}/${build_variant}\"" - sh "${BUILD_COMMAND} -build \"${project}/${build_variant}\"" + echo "Build command: \"${BUILD_COMMAND}\" -build \"${project}/${build_variant}\"" + sh "\"${BUILD_COMMAND}\" -build \"${project}/${build_variant}\"" } else { - bat """ - "%BUILD_COMMAND%" -build "${project}\\${build_variant}" - """ + bat "\"%BUILD_COMMAND%\" -build \"${project}/${build_variant}\"" } } if (exportpath) { From a21ec9aace7535a45026110a1fd008fdadd4060a Mon Sep 17 00:00:00 2001 From: danielbujnik Date: Tue, 13 Feb 2018 11:40:39 +0000 Subject: [PATCH 56/96] Revert "Auto build fix." This reverts commit 29e58eead620367c9beccb69b35c6715a5c2ef33. --- build/eclipsebuild/eclipsebuild.gsh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/build/eclipsebuild/eclipsebuild.gsh b/build/eclipsebuild/eclipsebuild.gsh index 5384341..367b454 100644 --- a/build/eclipsebuild/eclipsebuild.gsh +++ b/build/eclipsebuild/eclipsebuild.gsh @@ -6,11 +6,13 @@ def doBuild(apps) { for (build_variant in variants) { retry(3) { // Eclipse occasionally raises exceptions (rather than the builds failing) if (isUnix()) { - echo "Build command: \"${BUILD_COMMAND}\" -build \"${project}/${build_variant}\"" - sh "\"${BUILD_COMMAND}\" -build \"${project}/${build_variant}\"" + echo "Build command: ${BUILD_COMMAND} -build \"${project}/${build_variant}\"" + sh "${BUILD_COMMAND} -build \"${project}/${build_variant}\"" } else { - bat "\"%BUILD_COMMAND%\" -build \"${project}/${build_variant}\"" + bat """ + "%BUILD_COMMAND%" -build "${project}\\${build_variant}" + """ } } if (exportpath) { From 70b23d7049b5a986935164e72e506d17c7de1903 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 18 Feb 2018 17:03:14 +0000 Subject: [PATCH 57/96] Move commonly used methods out to Common_scripts --- commandline/commandline.gsh | 12 ++++++++ configuration/configuration.gsh | 34 +++++++++++++++++++++ versioncontrol/git.gsh | 53 +++++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 commandline/commandline.gsh create mode 100644 configuration/configuration.gsh create mode 100644 versioncontrol/git.gsh diff --git a/commandline/commandline.gsh b/commandline/commandline.gsh new file mode 100644 index 0000000..c03add7 --- /dev/null +++ b/commandline/commandline.gsh @@ -0,0 +1,12 @@ +String getCommandOutput(String cmd) { + if (isUnix()) { + return sh(returnStdout: true, script: '#!/bin/sh -e\n' + cmd).trim() + } else { + return bat(returnStdout: true, script: """ + @echo off + ${cmd} + """ + ).trim() + } +} + diff --git a/configuration/configuration.gsh b/configuration/configuration.gsh new file mode 100644 index 0000000..424765e --- /dev/null +++ b/configuration/configuration.gsh @@ -0,0 +1,34 @@ +def githelper = load("Common_scripts/versioncontrol/git.gsh") + +configurationCollection = [:] + +def registerConfigurationInfo(String configurationName, String configurationURL, String configurationVersion, String configurationSHA) { + def ConfigurationInfo = [configurationURL, configurationVersion, configurationSHA] + configurationCollection.put(configurationName, ConfigurationInfo) +} + +def registerPipelineScriptConfiguration() { + registerConfigurationInfo('pipeline script', '-', '-', getGitInfo("${WORKSPACE}")) +} + +def saveConfigurationInVersionInfo() { + dir("${WORKSPACE}\\version") { + writeFile file: 'configuration.txt', text: getFormattedConfiguration() + } +} + +String getFormattedConfiguration() { + String formattedInfo = "" + def keys = configurationCollection.keySet().sort() + for (key in keys) { + (configurationURL, configurationVersion, configurationSHA) = configurationCollection.get(key) + formattedLine = String.format("%s:%s,%s,%s%n", key, configurationURL, configurationVersion, configurationSHA) + formattedInfo += formattedLine + } + return formattedInfo +} + +def gitCheckoutAndRegister(String tool, String gitURL, String revision, String targetDir, String repoRoot = "", int cloneDepth = 1, boolean shallowClone = true) { + githelper.gitCheckout(gitURL, revision, targetDir, repoRoot, cloneDepth, shallowClone) + registerConfigurationInfo(tool, gitURL, revision, getGitInfo(targetDir)) +} diff --git a/versioncontrol/git.gsh b/versioncontrol/git.gsh new file mode 100644 index 0000000..1f6d88e --- /dev/null +++ b/versioncontrol/git.gsh @@ -0,0 +1,53 @@ +def commandlinehelper = load("Common_scripts/commandline/commandline.gsh") + +String getGitInfo(String workingSetRootPath) { + dir(workingSetRootPath) { + return commandlinehelper.getCommandOutput('git log -1 --format=oneline') + } +} + +def gitCheckout(String gitURL, String revision, String targetDir, String repoRoot = "", int cloneDepth = 1, boolean shallowClone = true) { + checkout([ + $class: 'GitSCM', + userRemoteConfigs: [ + [url: gitURL] + ], + branches: [ + [name: revision] + ], + doGenerateSubmoduleConfigurations: false, + extensions: [ + [$class: 'CleanBeforeCheckout'], + [$class: 'CloneOption', depth: cloneDepth, noTags: false, reference: "${REPO_ROOT}/${repoRoot}", shallow: shallowClone, timeout: 120], + [$class: 'CheckoutOption', timeout: 60], + [$class: 'RelativeTargetDirectory', relativeTargetDir: targetDir] + ], + submoduleCfg: [], + ]) +} + +String getSHAFromVersion(String versionFolder) { + dir (versionFolder) { + srcRevision = readFile("gitrevision.txt").trim() + } + return srcRevision +} + +boolean checkAllVersionsAgree(java.util.LinkedHashMap versions) { + def keys = versions.keySet() + if (keys.size() <= 1) { + return false + } else { + version = "" + for (key in keys) { + nextversion = versions.get(key) + if (version == "") { + version = nextversion + } + if (nextversion != version) { + return false + } + } + } + return true +} From ca2db55d2bb2a292e1bc070eceff75f6c4721174 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 18 Feb 2018 17:16:02 +0000 Subject: [PATCH 58/96] Move commonly used methods out to Common_scripts --- configuration/configuration.gsh | 4 ++-- versioncontrol/git.gsh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configuration/configuration.gsh b/configuration/configuration.gsh index 424765e..1f86c42 100644 --- a/configuration/configuration.gsh +++ b/configuration/configuration.gsh @@ -1,4 +1,4 @@ -def githelper = load("Common_scripts/versioncontrol/git.gsh") +def gh = load("${WORKSPACE}/Common_scripts/versioncontrol/git.gsh") configurationCollection = [:] @@ -29,6 +29,6 @@ String getFormattedConfiguration() { } def gitCheckoutAndRegister(String tool, String gitURL, String revision, String targetDir, String repoRoot = "", int cloneDepth = 1, boolean shallowClone = true) { - githelper.gitCheckout(gitURL, revision, targetDir, repoRoot, cloneDepth, shallowClone) + gh.gitCheckout(gitURL, revision, targetDir, repoRoot, cloneDepth, shallowClone) registerConfigurationInfo(tool, gitURL, revision, getGitInfo(targetDir)) } diff --git a/versioncontrol/git.gsh b/versioncontrol/git.gsh index 1f6d88e..90dc7ee 100644 --- a/versioncontrol/git.gsh +++ b/versioncontrol/git.gsh @@ -1,8 +1,8 @@ -def commandlinehelper = load("Common_scripts/commandline/commandline.gsh") +def clh = load("${WORKSPACE}/Common_scripts/commandline/commandline.gsh") String getGitInfo(String workingSetRootPath) { dir(workingSetRootPath) { - return commandlinehelper.getCommandOutput('git log -1 --format=oneline') + return clh.getCommandOutput('git log -1 --format=oneline') } } From 1e0f22ed5e86d8e0765b764c7cedea1522280c98 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 18 Feb 2018 17:19:29 +0000 Subject: [PATCH 59/96] Move commonly used methods out to Common_scripts --- commandline/commandline.gsh | 1 + 1 file changed, 1 insertion(+) diff --git a/commandline/commandline.gsh b/commandline/commandline.gsh index c03add7..df99a75 100644 --- a/commandline/commandline.gsh +++ b/commandline/commandline.gsh @@ -10,3 +10,4 @@ String getCommandOutput(String cmd) { } } +return this \ No newline at end of file From 4c6372bb8c06143a4a017e02368a40cfd53eb03c Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 18 Feb 2018 17:22:49 +0000 Subject: [PATCH 60/96] Move commonly used methods out to Common_scripts --- configuration/configuration.gsh | 2 ++ versioncontrol/git.gsh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/configuration/configuration.gsh b/configuration/configuration.gsh index 1f86c42..aa732e6 100644 --- a/configuration/configuration.gsh +++ b/configuration/configuration.gsh @@ -32,3 +32,5 @@ def gitCheckoutAndRegister(String tool, String gitURL, String revision, String t gh.gitCheckout(gitURL, revision, targetDir, repoRoot, cloneDepth, shallowClone) registerConfigurationInfo(tool, gitURL, revision, getGitInfo(targetDir)) } + +return this diff --git a/versioncontrol/git.gsh b/versioncontrol/git.gsh index 90dc7ee..06e5b50 100644 --- a/versioncontrol/git.gsh +++ b/versioncontrol/git.gsh @@ -51,3 +51,5 @@ boolean checkAllVersionsAgree(java.util.LinkedHashMap versions) { } return true } + +return this \ No newline at end of file From a1448ac8509c0b512092295700f1f0a6f61bba27 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 18 Feb 2018 17:27:26 +0000 Subject: [PATCH 61/96] Move commonly used methods out to Common_scripts --- configuration/configuration.gsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configuration/configuration.gsh b/configuration/configuration.gsh index aa732e6..976ebf8 100644 --- a/configuration/configuration.gsh +++ b/configuration/configuration.gsh @@ -8,7 +8,7 @@ def registerConfigurationInfo(String configurationName, String configurationURL, } def registerPipelineScriptConfiguration() { - registerConfigurationInfo('pipeline script', '-', '-', getGitInfo("${WORKSPACE}")) + registerConfigurationInfo('pipeline script', '-', '-', gh.getGitInfo("${WORKSPACE}")) } def saveConfigurationInVersionInfo() { @@ -30,7 +30,7 @@ String getFormattedConfiguration() { def gitCheckoutAndRegister(String tool, String gitURL, String revision, String targetDir, String repoRoot = "", int cloneDepth = 1, boolean shallowClone = true) { gh.gitCheckout(gitURL, revision, targetDir, repoRoot, cloneDepth, shallowClone) - registerConfigurationInfo(tool, gitURL, revision, getGitInfo(targetDir)) + registerConfigurationInfo(tool, gitURL, revision, gh.getGitInfo(targetDir)) } return this From d09d20c7b663d7a62cad3130ee91a05a96ab5f4a Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 18 Feb 2018 17:30:21 +0000 Subject: [PATCH 62/96] Move commonly used methods out to Common_scripts --- configuration/configuration.gsh | 2 +- versioncontrol/git.gsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configuration/configuration.gsh b/configuration/configuration.gsh index 976ebf8..29cd7e3 100644 --- a/configuration/configuration.gsh +++ b/configuration/configuration.gsh @@ -1,4 +1,4 @@ -def gh = load("${WORKSPACE}/Common_scripts/versioncontrol/git.gsh") +gh = load("${WORKSPACE}/Common_scripts/versioncontrol/git.gsh") configurationCollection = [:] diff --git a/versioncontrol/git.gsh b/versioncontrol/git.gsh index 06e5b50..fd633eb 100644 --- a/versioncontrol/git.gsh +++ b/versioncontrol/git.gsh @@ -1,4 +1,4 @@ -def clh = load("${WORKSPACE}/Common_scripts/commandline/commandline.gsh") +clh = load("${WORKSPACE}/Common_scripts/commandline/commandline.gsh") String getGitInfo(String workingSetRootPath) { dir(workingSetRootPath) { From 9d32414fca002f779a7d924953dcf4cd7b7778a6 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 18 Feb 2018 18:16:20 +0000 Subject: [PATCH 63/96] Check for undefined REPO_ROOT environment variable --- versioncontrol/git.gsh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/versioncontrol/git.gsh b/versioncontrol/git.gsh index fd633eb..145045c 100644 --- a/versioncontrol/git.gsh +++ b/versioncontrol/git.gsh @@ -7,6 +7,13 @@ String getGitInfo(String workingSetRootPath) { } def gitCheckout(String gitURL, String revision, String targetDir, String repoRoot = "", int cloneDepth = 1, boolean shallowClone = true) { + reporootenv = env.REPO_ROOT + if (reporootenv != mull && repoRoot != "") { + reporootpath = "${reporootenv.trim()}/${repoRoot}" + } else { + reporootpath = "" + echo "To improve Git performance: Define the REPO_ROOT enviroment to a path where a cache of git repositories can be placed on this slave" + } checkout([ $class: 'GitSCM', userRemoteConfigs: [ @@ -18,7 +25,7 @@ def gitCheckout(String gitURL, String revision, String targetDir, String repoRoo doGenerateSubmoduleConfigurations: false, extensions: [ [$class: 'CleanBeforeCheckout'], - [$class: 'CloneOption', depth: cloneDepth, noTags: false, reference: "${REPO_ROOT}/${repoRoot}", shallow: shallowClone, timeout: 120], + [$class: 'CloneOption', depth: cloneDepth, noTags: false, reference: reporootpath, shallow: shallowClone, timeout: 120], [$class: 'CheckoutOption', timeout: 60], [$class: 'RelativeTargetDirectory', relativeTargetDir: targetDir] ], From 69be84aac0e12da69f55d2c5b01f7ad22f775922 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 18 Feb 2018 18:17:26 +0000 Subject: [PATCH 64/96] Check for undefined REPO_ROOT environment variable --- versioncontrol/git.gsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versioncontrol/git.gsh b/versioncontrol/git.gsh index 145045c..70fe6bc 100644 --- a/versioncontrol/git.gsh +++ b/versioncontrol/git.gsh @@ -8,7 +8,7 @@ String getGitInfo(String workingSetRootPath) { def gitCheckout(String gitURL, String revision, String targetDir, String repoRoot = "", int cloneDepth = 1, boolean shallowClone = true) { reporootenv = env.REPO_ROOT - if (reporootenv != mull && repoRoot != "") { + if (reporootenv != null && repoRoot != "") { reporootpath = "${reporootenv.trim()}/${repoRoot}" } else { reporootpath = "" From d1a8c098a6ba03fe5461f82db036de2f48aa2c62 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 19 Feb 2018 17:50:05 +0000 Subject: [PATCH 65/96] Make the version number 1.20000.x if the branch name is .x or ..x --- versionnumbering/versioninfo.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/versionnumbering/versioninfo.py b/versionnumbering/versioninfo.py index 59b5225..45fd1ca 100644 --- a/versionnumbering/versioninfo.py +++ b/versionnumbering/versioninfo.py @@ -65,10 +65,14 @@ def getGitRevision(gitrootpath, basenumber): return (adjustedchangecount, revision, remoteinfo) -def getVersionPrefix(sourcebranch): +# Handle: +# origin/master +# origin/2.0.x + def getVersionPrefix(sourcebranch): print("Determining version number prefix from source branch name: {0}".format(sourcebranch)) defaultversionprefix = "1.30000.0." + mastertypeversionprefix = "1.20000.0." splits = sourcebranch.split('/') if len(splits) < 1: print("Source branch name is invalid. Defaulting to: {0}".format(defaultversionprefix)) @@ -77,7 +81,7 @@ def getVersionPrefix(sourcebranch): sourcebranch = splits[-1] if sourcebranch.lower().endswith("master"): # Special case - return "1.20000.0." + return mastertypeversionprefix splits = sourcebranch.split('.') versionprefix = "" @@ -86,21 +90,27 @@ def getVersionPrefix(sourcebranch): versionprefix = defaultversionprefix else: splitnumbercount = 0 + isIntermediateReleaseBranch = false for split in splits: if split.isdigit(): versionprefix += split + "." splitnumbercount += 1 else: + if split == "x": + isIntermediateReleaseBranch = true break if splitnumbercount > 2: break if splitnumbercount == 0: print("No leading numbers were found in source branch name so defaulting to: {0}".format(defaultversionprefix)) versionprefix = defaultversionprefix - elif splitnumbercount == 1: - versionprefix += "0.0." - elif splitnumbercount == 2: - versionprefix += "0." + else: + if isIntermediateReleaseBranch: + versionprefix = mastertypeversionprefix + elif splitnumbercount == 1: + versionprefix += "0.0." + elif splitnumbercount == 2: + versionprefix += "0." print("Determined version prefix to be: {0}".format(versionprefix)) return versionprefix From 061b3d4fcfb9fe3f0a853b63cf6ea48ea8f1ce0b Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 19 Feb 2018 18:14:49 +0000 Subject: [PATCH 66/96] Make the version number 1.20000.x if the branch name is .x or ..x --- .pydevproject | 2 +- versionnumbering/versioninfo.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.pydevproject b/.pydevproject index d111c07..1ce5929 100644 --- a/.pydevproject +++ b/.pydevproject @@ -3,6 +3,6 @@ /${PROJECT_DIR_NAME} -python interpreter +python 2.7 python35 diff --git a/versionnumbering/versioninfo.py b/versionnumbering/versioninfo.py index 45fd1ca..d9e6681 100644 --- a/versionnumbering/versioninfo.py +++ b/versionnumbering/versioninfo.py @@ -68,7 +68,7 @@ def getGitRevision(gitrootpath, basenumber): # Handle: # origin/master # origin/2.0.x - def getVersionPrefix(sourcebranch): +def getVersionPrefix(sourcebranch): print("Determining version number prefix from source branch name: {0}".format(sourcebranch)) defaultversionprefix = "1.30000.0." @@ -90,14 +90,14 @@ def getGitRevision(gitrootpath, basenumber): versionprefix = defaultversionprefix else: splitnumbercount = 0 - isIntermediateReleaseBranch = false + isIntermediateReleaseBranch = False for split in splits: if split.isdigit(): versionprefix += split + "." splitnumbercount += 1 else: if split == "x": - isIntermediateReleaseBranch = true + isIntermediateReleaseBranch = True break if splitnumbercount > 2: break From 9af8da5da65ee4420ce6394e5c34c3fedf9fef8f Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 20 Feb 2018 11:13:49 +0000 Subject: [PATCH 67/96] gitrevision.txt and revision.txt file content were mixed up with previous way of generating version folder --- versionnumbering/versioninfo.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/versionnumbering/versioninfo.py b/versionnumbering/versioninfo.py index d9e6681..25644a6 100644 --- a/versionnumbering/versioninfo.py +++ b/versionnumbering/versioninfo.py @@ -115,7 +115,7 @@ def getVersionPrefix(sourcebranch): print("Determined version prefix to be: {0}".format(versionprefix)) return versionprefix -def writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevision, remoteinfo, buildnumber, buildstamp): +def writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevisioncount, gitrevision, remoteinfo, buildnumber, buildstamp): with open(os.path.join(versionfolder, "buildjobname.txt"), 'w') as f: f.write(buildjobname) @@ -123,6 +123,9 @@ def writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevision, r f.write(versionprefix) with open(os.path.join(versionfolder, "revision.txt"), 'w') as f: + f.write(gitrevisioncount) + + with open(os.path.join(versionfolder, "gitrevision.txt"), 'w') as f: f.write(gitrevision) with open(os.path.join(versionfolder, "remoteinfo.txt"), 'w') as f: @@ -195,7 +198,7 @@ USAGE buildstamp = versionprefix + str(gitrevisioncount) print("Build stamp is: {0}".format(buildstamp)) - writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevision, remoteinfo, buildnumber, buildstamp) + writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevisioncount, gitrevision, remoteinfo, buildnumber, buildstamp) return 0 except Exception as e: From d3ba4321ae5b3e3bedf77ec23d232a66b927c7f8 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 20 Feb 2018 11:38:11 +0000 Subject: [PATCH 68/96] The print server base revision number is 5000 --- versionnumbering/versioninfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versionnumbering/versioninfo.py b/versionnumbering/versioninfo.py index 25644a6..9a7cd6a 100644 --- a/versionnumbering/versioninfo.py +++ b/versionnumbering/versioninfo.py @@ -123,7 +123,7 @@ def writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevisioncou f.write(versionprefix) with open(os.path.join(versionfolder, "revision.txt"), 'w') as f: - f.write(gitrevisioncount) + f.write(str(gitrevisioncount)) with open(os.path.join(versionfolder, "gitrevision.txt"), 'w') as f: f.write(gitrevision) From 99bb2d6465220a29e7a3dfd7031dd49454f5013f Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 21 Feb 2018 13:28:27 +0000 Subject: [PATCH 69/96] Provide a parameter for deciding where files are exported --- build/eclipsebuild/eclipsebuild.gsh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build/eclipsebuild/eclipsebuild.gsh b/build/eclipsebuild/eclipsebuild.gsh index 367b454..30fe4d5 100644 --- a/build/eclipsebuild/eclipsebuild.gsh +++ b/build/eclipsebuild/eclipsebuild.gsh @@ -1,24 +1,24 @@ // Build and export files -def doBuild(apps) { +def doBuild(apps, exportfolder = "${WORKSPACE}/bin") { for (appInfo in apps ) { (build, project, variants, exportpath) = appInfo if (build) { for (build_variant in variants) { retry(3) { // Eclipse occasionally raises exceptions (rather than the builds failing) if (isUnix()) { - echo "Build command: ${BUILD_COMMAND} -build \"${project}/${build_variant}\"" + echo "Build command: ${BUILD_COMMAND} -build \"${project}/${build_variant}\"" sh "${BUILD_COMMAND} -build \"${project}/${build_variant}\"" - } + } else { bat """ - "%BUILD_COMMAND%" -build "${project}\\${build_variant}" - """ + "%BUILD_COMMAND%" -build "${project}\\${build_variant}" + """ } } if (exportpath) { echo "Export path at: ${exportpath}" script { - env.destFolder = "${WORKSPACE}/export/${build_variant}/${project}" + env.destFolder = "${exportfolder}/${build_variant}/${project}" env.srcFile = "${WORKSPACE}/${exportpath}" env.srcFileExpanded = srcFile.replace("-BUILDVARIANT-", "${build_variant}") } From 96ac5a636249e5ccb392cc2c78755de22afd4044 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 21 Feb 2018 16:47:21 +0000 Subject: [PATCH 70/96] Configuration information was not being written into version folder on linux machine --- configuration/configuration.gsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configuration/configuration.gsh b/configuration/configuration.gsh index 29cd7e3..b91e0a3 100644 --- a/configuration/configuration.gsh +++ b/configuration/configuration.gsh @@ -12,7 +12,8 @@ def registerPipelineScriptConfiguration() { } def saveConfigurationInVersionInfo() { - dir("${WORKSPACE}\\version") { + dir("${WORKSPACE}/version") { + echo "Writing configuration info to ${WORKSPACE}/version/configuration.txt" writeFile file: 'configuration.txt', text: getFormattedConfiguration() } } From 049b242a2a93c3e8efb4037ca6b82c3759b1baf6 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 23 Feb 2018 13:00:31 +0000 Subject: [PATCH 71/96] Change folders and files to match convention --- .../eclipsebuild.gsh => compile/eclipsebuild/eclipseds5build.gsh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename build/eclipsebuild/eclipsebuild.gsh => compile/eclipsebuild/eclipseds5build.gsh (100%) diff --git a/build/eclipsebuild/eclipsebuild.gsh b/compile/eclipsebuild/eclipseds5build.gsh similarity index 100% rename from build/eclipsebuild/eclipsebuild.gsh rename to compile/eclipsebuild/eclipseds5build.gsh From 17eae1e1357f6e7d3361639dc3bf184bd308f9bc Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 24 Feb 2018 09:17:05 +0000 Subject: [PATCH 72/96] Save the slave machine name in the version folder --- versionnumbering/versioninfo.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/versionnumbering/versioninfo.py b/versionnumbering/versioninfo.py index 9a7cd6a..a9d8738 100644 --- a/versionnumbering/versioninfo.py +++ b/versionnumbering/versioninfo.py @@ -22,6 +22,7 @@ __date__ = '2017-11-29' __updated__ = '2017-11-29' gitExecutable = os.getenv("GIT_EXECUTABLE", default="git") +slaveMachine = os.getenv("NODE_NAME", default="-") def resetFolder(versionfolder): print("Removing folders and contents of: {0}".format(versionfolder)) @@ -141,6 +142,9 @@ def writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevisioncou with open(os.path.join(versionfolder, "buildstampcommasep.txt"), 'w') as f: f.write(buildstampcommasep) + with open(os.path.join(versionfolder, "buildmachine.txt"), 'w') as f: + f.write(slaveMachine) + def main(argv=None): # IGNORE:C0111 '''Command line options.''' From 423e88d3221238b488c2c1b9eeaa6bfe77d4f383 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 12 Jun 2018 15:22:13 +0100 Subject: [PATCH 73/96] HMBXR5601-143 - Handle projects that aren't built but do provide binaries --- compile/eclipsebuild/eclipseds5build.gsh | 52 +++++++++++++++--------- 1 file changed, 32 insertions(+), 20 deletions(-) diff --git a/compile/eclipsebuild/eclipseds5build.gsh b/compile/eclipsebuild/eclipseds5build.gsh index 30fe4d5..e17f4b9 100644 --- a/compile/eclipsebuild/eclipseds5build.gsh +++ b/compile/eclipsebuild/eclipseds5build.gsh @@ -1,7 +1,34 @@ + +def doExport(exportpathlist, build_variant = "") { + for (exportpath in exportpathlist) { + echo "Export path at: ${exportpath}" + script { + if (build_variant) { + env.destFolder = "${exportfolder}/${build_variant}/${project}" + env.srcFile = "${WORKSPACE}/${exportpath}" + env.srcFileExpanded = srcFile.replace("-BUILDVARIANT-", "${build_variant}") + } + else { + env.destFolder = "${exportfolder}/${project}" + env.srcFileExpanded = "${WORKSPACE}/${exportpath}" + } + } + dir (env.destFolder) { + echo "Copy ${srcFileExpanded} to ${destFolder}" + if (isUnix()) { + sh 'cp \"${srcFileExpanded}\" ${destFolder}' + } + else { + bat 'copy \"%srcFileExpanded%\" %destFolder%' + } + } + } +} + // Build and export files def doBuild(apps, exportfolder = "${WORKSPACE}/bin") { for (appInfo in apps ) { - (build, project, variants, exportpath) = appInfo + (build, project, variants, exportpathlist) = appInfo if (build) { for (build_variant in variants) { retry(3) { // Eclipse occasionally raises exceptions (rather than the builds failing) @@ -15,27 +42,12 @@ def doBuild(apps, exportfolder = "${WORKSPACE}/bin") { """ } } - if (exportpath) { - echo "Export path at: ${exportpath}" - script { - env.destFolder = "${exportfolder}/${build_variant}/${project}" - env.srcFile = "${WORKSPACE}/${exportpath}" - env.srcFileExpanded = srcFile.replace("-BUILDVARIANT-", "${build_variant}") - } - dir (env.destFolder) { - if (exportpath) { - echo "Copy ${srcFileExpanded} to ${destFolder}" - if (isUnix()) { - sh 'cp \"${srcFileExpanded}\" ${destFolder}' - } - else { - bat 'copy \"%srcFileExpanded%\" %destFolder%' - } - } - } - } + doExport(exportpathlist, build_variant) } } + else { + doExport(exportpathlist, build_variant) + } } } From a34f8ee1e896397e4e1eb7a7ca5331c07b748878 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 12 Jun 2018 15:34:48 +0100 Subject: [PATCH 74/96] HMBXR5601-143 - Handle projects that aren't built but do provide binaries --- compile/eclipsebuild/eclipseds5build.gsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compile/eclipsebuild/eclipseds5build.gsh b/compile/eclipsebuild/eclipseds5build.gsh index e17f4b9..065e64a 100644 --- a/compile/eclipsebuild/eclipseds5build.gsh +++ b/compile/eclipsebuild/eclipseds5build.gsh @@ -34,8 +34,8 @@ def doBuild(apps, exportfolder = "${WORKSPACE}/bin") { retry(3) { // Eclipse occasionally raises exceptions (rather than the builds failing) if (isUnix()) { echo "Build command: ${BUILD_COMMAND} -build \"${project}/${build_variant}\"" - sh "${BUILD_COMMAND} -build \"${project}/${build_variant}\"" - } + sh "${BUILD_COMMAND} -build \"${project}/${build_variant}\"" + } else { bat """ "%BUILD_COMMAND%" -build "${project}\\${build_variant}" @@ -46,7 +46,7 @@ def doBuild(apps, exportfolder = "${WORKSPACE}/bin") { } } else { - doExport(exportpathlist, build_variant) + doExport(exportpathlist) } } } From 07a0a49d06993d2423a87e5c9bbef438e1cce3ff Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 12 Jun 2018 15:47:21 +0100 Subject: [PATCH 75/96] HMBXR5601-143 - Handle projects that aren't built but do provide binaries --- compile/eclipsebuild/eclipseds5build.gsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compile/eclipsebuild/eclipseds5build.gsh b/compile/eclipsebuild/eclipseds5build.gsh index 065e64a..f0700b4 100644 --- a/compile/eclipsebuild/eclipseds5build.gsh +++ b/compile/eclipsebuild/eclipseds5build.gsh @@ -1,5 +1,5 @@ -def doExport(exportpathlist, build_variant = "") { +def doExport(exportfolder, exportpathlist, build_variant = "") { for (exportpath in exportpathlist) { echo "Export path at: ${exportpath}" script { @@ -42,11 +42,11 @@ def doBuild(apps, exportfolder = "${WORKSPACE}/bin") { """ } } - doExport(exportpathlist, build_variant) + doExport(exportfolder, exportpathlist, build_variant) } } else { - doExport(exportpathlist) + doExport(exportfolder, exportpathlist) } } } From 783c61598d02d01722eb6f50812693a6b4683431 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 12 Jun 2018 16:06:33 +0100 Subject: [PATCH 76/96] HMBXR5601-143 - Handle projects that aren't built but do provide binaries --- 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 f0700b4..ca4fd2c 100644 --- a/compile/eclipsebuild/eclipseds5build.gsh +++ b/compile/eclipsebuild/eclipseds5build.gsh @@ -16,7 +16,7 @@ def doExport(exportfolder, exportpathlist, build_variant = "") { dir (env.destFolder) { echo "Copy ${srcFileExpanded} to ${destFolder}" if (isUnix()) { - sh 'cp \"${srcFileExpanded}\" ${destFolder}' + sh 'cp -v \"${srcFileExpanded}\" ${destFolder}' } else { bat 'copy \"%srcFileExpanded%\" %destFolder%' From e77d9f03a1da9ae10211c8120f1947e916413e73 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 12 Jun 2018 16:26:27 +0100 Subject: [PATCH 77/96] HMBXR5601-143 - Handle projects that aren't built but do provide binaries --- 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 ca4fd2c..0801386 100644 --- a/compile/eclipsebuild/eclipseds5build.gsh +++ b/compile/eclipsebuild/eclipseds5build.gsh @@ -16,10 +16,13 @@ def doExport(exportfolder, exportpathlist, build_variant = "") { dir (env.destFolder) { echo "Copy ${srcFileExpanded} to ${destFolder}" if (isUnix()) { - sh 'cp -v \"${srcFileExpanded}\" ${destFolder}' + sh """ + echo cp -v -\"${srcFileExpanded}\"- -\"${destFolder}\"- + cp -v \"${srcFileExpanded}\" \"${destFolder}\" + """ } else { - bat 'copy \"%srcFileExpanded%\" %destFolder%' + bat 'copy \"%srcFileExpanded%\" \"%destFolder%\"' } } } From c937856bfd2d3a5ca3258ecf43717d522315e247 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 12 Jun 2018 16:43:32 +0100 Subject: [PATCH 78/96] HMBXR5601-143 - Handle projects that aren't built but do provide binaries --- compile/eclipsebuild/eclipseds5build.gsh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/compile/eclipsebuild/eclipseds5build.gsh b/compile/eclipsebuild/eclipseds5build.gsh index 0801386..357e64a 100644 --- a/compile/eclipsebuild/eclipseds5build.gsh +++ b/compile/eclipsebuild/eclipseds5build.gsh @@ -16,10 +16,7 @@ def doExport(exportfolder, exportpathlist, build_variant = "") { dir (env.destFolder) { echo "Copy ${srcFileExpanded} to ${destFolder}" if (isUnix()) { - sh """ - echo cp -v -\"${srcFileExpanded}\"- -\"${destFolder}\"- - cp -v \"${srcFileExpanded}\" \"${destFolder}\" - """ + sh "cp -v \"${srcFileExpanded}\" \"${destFolder}\" } else { bat 'copy \"%srcFileExpanded%\" \"%destFolder%\"' From 142e5955443a97e25d2410689e0f9356a76219b0 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 12 Jun 2018 16:55:28 +0100 Subject: [PATCH 79/96] HMBXR5601-143 - Handle projects that aren't built but do provide binaries --- 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 357e64a..477d68d 100644 --- a/compile/eclipsebuild/eclipseds5build.gsh +++ b/compile/eclipsebuild/eclipseds5build.gsh @@ -16,7 +16,7 @@ def doExport(exportfolder, exportpathlist, build_variant = "") { dir (env.destFolder) { echo "Copy ${srcFileExpanded} to ${destFolder}" if (isUnix()) { - sh "cp -v \"${srcFileExpanded}\" \"${destFolder}\" + sh 'cp -v \"${srcFileExpanded}\" \"${destFolder}\"' } else { bat 'copy \"%srcFileExpanded%\" \"%destFolder%\"' From 8c63eee9697553883202fb26e1cc9ef97a4ff469 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 12 Jun 2018 17:22:08 +0100 Subject: [PATCH 80/96] HMBXR5601-143 - Handle projects that aren't built but do provide binaries --- 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 477d68d..fc8ecd0 100644 --- a/compile/eclipsebuild/eclipseds5build.gsh +++ b/compile/eclipsebuild/eclipseds5build.gsh @@ -14,9 +14,9 @@ def doExport(exportfolder, exportpathlist, build_variant = "") { } } dir (env.destFolder) { - echo "Copy ${srcFileExpanded} to ${destFolder}" + echo "Copy \"${srcFileExpanded}\" to \"${destFolder}\"" if (isUnix()) { - sh 'cp -v \"${srcFileExpanded}\" \"${destFolder}\"' + bash 'cp -v \"${srcFileExpanded}\" \"${destFolder}\"' } else { bat 'copy \"%srcFileExpanded%\" \"%destFolder%\"' From 585ddabcf5570d1f1c7133d74fce7524596283e4 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 12 Jun 2018 17:25:12 +0100 Subject: [PATCH 81/96] HMBXR5601-143 - Handle projects that aren't built but do provide binaries --- compile/eclipsebuild/eclipseds5build.gsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compile/eclipsebuild/eclipseds5build.gsh b/compile/eclipsebuild/eclipseds5build.gsh index fc8ecd0..b91e487 100644 --- a/compile/eclipsebuild/eclipseds5build.gsh +++ b/compile/eclipsebuild/eclipseds5build.gsh @@ -14,9 +14,11 @@ def doExport(exportfolder, exportpathlist, build_variant = "") { } } dir (env.destFolder) { + echo 'Copy \"${srcFileExpanded}\" to \"${destFolder}\"' echo "Copy \"${srcFileExpanded}\" to \"${destFolder}\"" if (isUnix()) { - bash 'cp -v \"${srcFileExpanded}\" \"${destFolder}\"' + echo "cp -v \"${srcFileExpanded}\" \"${destFolder}\"" + sh "cp -v \"${srcFileExpanded}\" \"${destFolder}\"" } else { bat 'copy \"%srcFileExpanded%\" \"%destFolder%\"' From ec69c45d90ce01745dd5c828e0292471f0f4054b Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 12 Jun 2018 17:50:08 +0100 Subject: [PATCH 82/96] HMBXR5601-143 - Handle projects that aren't built but do provide binaries --- compile/eclipsebuild/eclipseds5build.gsh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/compile/eclipsebuild/eclipseds5build.gsh b/compile/eclipsebuild/eclipseds5build.gsh index b91e487..9544faf 100644 --- a/compile/eclipsebuild/eclipseds5build.gsh +++ b/compile/eclipsebuild/eclipseds5build.gsh @@ -15,10 +15,8 @@ def doExport(exportfolder, exportpathlist, build_variant = "") { } dir (env.destFolder) { echo 'Copy \"${srcFileExpanded}\" to \"${destFolder}\"' - echo "Copy \"${srcFileExpanded}\" to \"${destFolder}\"" if (isUnix()) { - echo "cp -v \"${srcFileExpanded}\" \"${destFolder}\"" - sh "cp -v \"${srcFileExpanded}\" \"${destFolder}\"" + sh "cp -v ${srcFileExpanded} \"${destFolder}\"" } else { bat 'copy \"%srcFileExpanded%\" \"%destFolder%\"' From 20a392db61328799b2357b2b38dff56ed95566b8 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 12 Jun 2018 18:30:39 +0100 Subject: [PATCH 83/96] HMBXR5601-143 - Handle projects that aren't built but do provide binaries --- 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 9544faf..5b113d3 100644 --- a/compile/eclipsebuild/eclipseds5build.gsh +++ b/compile/eclipsebuild/eclipseds5build.gsh @@ -3,20 +3,23 @@ def doExport(exportfolder, exportpathlist, build_variant = "") { for (exportpath in exportpathlist) { echo "Export path at: ${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}") } else { + echo "No build variant" env.destFolder = "${exportfolder}/${project}" env.srcFileExpanded = "${WORKSPACE}/${exportpath}" } } dir (env.destFolder) { - echo 'Copy \"${srcFileExpanded}\" to \"${destFolder}\"' + echo "Copy \"${srcFileExpanded}\" to \"${destFolder}\"" if (isUnix()) { - sh "cp -v ${srcFileExpanded} \"${destFolder}\"" + sh "cp -v \"${srcFileExpanded}\" \"${destFolder}\"" } else { bat 'copy \"%srcFileExpanded%\" \"%destFolder%\"' From 93443e340ddb102379ccb8dc25168d6f3a8e7bc9 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 12 Jun 2018 18:56:17 +0100 Subject: [PATCH 84/96] HMBXR5601-143 - Handle projects that aren't built but do provide binaries --- compile/eclipsebuild/eclipseds5build.gsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compile/eclipsebuild/eclipseds5build.gsh b/compile/eclipsebuild/eclipseds5build.gsh index 5b113d3..d9b2a92 100644 --- a/compile/eclipsebuild/eclipseds5build.gsh +++ b/compile/eclipsebuild/eclipseds5build.gsh @@ -49,7 +49,10 @@ def doBuild(apps, exportfolder = "${WORKSPACE}/bin") { } } else { - doExport(exportfolder, exportpathlist) + // Only export if the project has no variants - signifying that there are files to export which have been prebuilt + if (!variants) { + doExport(exportfolder, exportpathlist) + } } } } From 305ae709aacbf8cf203263211ac376f8eea2114f Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 25 Jun 2018 13:50:09 +0100 Subject: [PATCH 85/96] HMBXR5601-233 - Extend checkout timeout to 2 hours --- versioncontrol/git.gsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versioncontrol/git.gsh b/versioncontrol/git.gsh index 70fe6bc..9d96232 100644 --- a/versioncontrol/git.gsh +++ b/versioncontrol/git.gsh @@ -26,7 +26,7 @@ def gitCheckout(String gitURL, String revision, String targetDir, String repoRoo extensions: [ [$class: 'CleanBeforeCheckout'], [$class: 'CloneOption', depth: cloneDepth, noTags: false, reference: reporootpath, shallow: shallowClone, timeout: 120], - [$class: 'CheckoutOption', timeout: 60], + [$class: 'CheckoutOption', timeout: 120], [$class: 'RelativeTargetDirectory', relativeTargetDir: targetDir] ], submoduleCfg: [], From 8f69abb656f35569c21f193d5620057302fcd90d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 6 Jul 2018 11:47:15 +0100 Subject: [PATCH 86/96] Add build switch to perform clean builds --- compile/eclipsebuild/eclipseds5build.gsh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/compile/eclipsebuild/eclipseds5build.gsh b/compile/eclipsebuild/eclipseds5build.gsh index d9b2a92..5acc0ae 100644 --- a/compile/eclipsebuild/eclipseds5build.gsh +++ b/compile/eclipsebuild/eclipseds5build.gsh @@ -31,17 +31,23 @@ def doExport(exportfolder, exportpathlist, build_variant = "") { // Build and export files def doBuild(apps, exportfolder = "${WORKSPACE}/bin") { for (appInfo in apps ) { - (build, project, variants, exportpathlist) = appInfo + (build, cleanbuild, project, variants, exportpathlist) = appInfo if (build) { + if (cleanbuild) { + buildtype = "-cleanBuild" + } + else { + buildtype = "-build" + } 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}\"" if (isUnix()) { - echo "Build command: ${BUILD_COMMAND} -build \"${project}/${build_variant}\"" - sh "${BUILD_COMMAND} -build \"${project}/${build_variant}\"" + sh "${BUILD_COMMAND} ${buildtype} \"${project}/${build_variant}\"" } else { bat """ - "%BUILD_COMMAND%" -build "${project}\\${build_variant}" + "%BUILD_COMMAND%" ${buildtype} "${project}\\${build_variant}" """ } } From ef5bcc9ffe7ade78c0eee7271e9e9dbe9eb671f4 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 7 Jul 2018 19:25:33 +0100 Subject: [PATCH 87/96] Use LFS for all checkouts --- versioncontrol/git.gsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/versioncontrol/git.gsh b/versioncontrol/git.gsh index 9d96232..dbc09ff 100644 --- a/versioncontrol/git.gsh +++ b/versioncontrol/git.gsh @@ -24,6 +24,7 @@ def gitCheckout(String gitURL, String revision, String targetDir, String repoRoo ], doGenerateSubmoduleConfigurations: false, extensions: [ + [$class: 'GitLFSPull'], [$class: 'CleanBeforeCheckout'], [$class: 'CloneOption', depth: cloneDepth, noTags: false, reference: reporootpath, shallow: shallowClone, timeout: 120], [$class: 'CheckoutOption', timeout: 120], @@ -59,4 +60,4 @@ boolean checkAllVersionsAgree(java.util.LinkedHashMap versions) { return true } -return this \ No newline at end of file +return this From beaf754ea2eb644061322886d629740856492517 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 9 Jul 2018 19:08:38 +0100 Subject: [PATCH 88/96] 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 89/96] 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 90/96] 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 91/96] 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 92/96] 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 93/96] 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 94/96] 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 95/96] 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 """ From 9282feb36dedac15d6cfb22cb2eb506a1b7dce49 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 11 Oct 2019 13:24:01 +0100 Subject: [PATCH 96/96] Add VS2017 installation configuration --- .../vs2017install/buildmachines.vsconfig | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tool configurations/vs2017install/buildmachines.vsconfig diff --git a/tool configurations/vs2017install/buildmachines.vsconfig b/tool configurations/vs2017install/buildmachines.vsconfig new file mode 100644 index 0000000..ea618a3 --- /dev/null +++ b/tool configurations/vs2017install/buildmachines.vsconfig @@ -0,0 +1,25 @@ +{ + "version": "1.0", + "components": [ + "Microsoft.VisualStudio.Workload.ManagedDesktop", + "Microsoft.VisualStudio.Workload.NativeDesktop", + "Microsoft.VisualStudio.Workload.NetWeb", + "Microsoft.VisualStudio.Workload.NetCoreTools", + "microsoft.net.componentgroup.targetingpacks.common", + "microsoft.componentgroup.blend", + "microsoft.visualstudio.component.entityframework", + "microsoft.visualstudio.component.debugger.justintime", + "microsoft.visualstudio.component.wcf.tooling", + "microsoft.visualstudio.component.vc.diagnostictools", + "microsoft.visualstudio.component.vc.cmake.project", + "microsoft.visualstudio.component.vc.testadapterforboosttest", + "microsoft.visualstudio.component.vc.testadapterforgoogletest", + "microsoft.visualstudio.component.vc.atlmfc", + "microsoft.visualstudio.component.appinsights.tools", + "microsoft.visualstudio.component.diagnostictools", + "microsoft.visualstudio.componentgroup.web.cloudtools", + "microsoft.visualstudio.component.aspnet45", + "microsoft.visualstudio.component.webdeploy", + "microsoft.visualstudio.component.nuget.buildtools" + ] +} \ No newline at end of file