From 0ac129bc90340112a32bafcc65578b0b3d6820f4 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 13 Nov 2021 15:48:55 +0000 Subject: [PATCH] Resurrect ccm --- staticanalysis/ccm.groovy | 46 ++++++++++----------------------------- 1 file changed, 11 insertions(+), 35 deletions(-) diff --git a/staticanalysis/ccm.groovy b/staticanalysis/ccm.groovy index 5a7c6f5..0be80fa 100644 --- a/staticanalysis/ccm.groovy +++ b/staticanalysis/ccm.groovy @@ -13,12 +13,6 @@ pipeline { script { configurationhelper = autobuilder.configurationhelper() - PYTHONURL = 'git@hydra:tools/python.git' - PYTHONBRANCH = 'origin/3.6.3_windows' - PYTHONDIR = "${WORKSPACE}/python" - configurationhelper.gitCheckoutAndRegister(meta, 'python', PYTHONURL, PYTHONBRANCH, PYTHONDIR) - env.PYTHON = "${PYTHONDIR}/ver/python.exe" - CCMURL = 'git@hydra:tools/ccm.git' CCMBRANCH = 'origin/master' CCMDIR = "${WORKSPACE}/ccm" @@ -41,9 +35,9 @@ pipeline { stage("Clean exports") { steps { script { - STATICANALYSIS = 'staticanalysis' + RESULTS = 'results' cleanfolders = [ - STATICANALYSIS, + RESULTS, ] cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy") cleaner.clean(cleanfolders) @@ -61,18 +55,19 @@ pipeline { stage('Static analysis') { steps { script { - def CCMOLDER = "${STATICANALYSIS}/ccm" - dir(CCMOLDER) { - echo "Executing: ${CCM} ${SRC} /xml /nummetrics=100 > ccm.xml" + def ccmconfigurationfile = "${WORKSPACE}/ccm.xml" + writeFile(file: ccmconfigurationfile, text: CCM_CONFIGURATION) + echo "Configuration file: ${ccmconfigurationfile} contains:\n${CCM_CONFIGURATION}" + + dir(RESULTS) { + echo "Executing: ${CCM} ${ccmconfigurationfile} > ccm.xml" if (isUnix()) { sh """#!/bin/bash - find "${SRC}" -type f ! -name "*.cpp" -a ! -name "*.h" -a ! -name "*.hpp" -a ! -name "*.c" -exec rm -r {} \\; - # Uses mono - "${CCM}" "${SRC}" /xml /nummetrics=100 > ccm.xml + ${CCM}" "${ccmconfigurationfile}" > ccm.xml """ } else { - bat """ - "${CCM}" "${SRC}" /xml /nummetrics=100 > ccm.xml + powershell """ + "${CCM}" "${ccmconfigurationfile}" > ccm.xml """ } } @@ -82,25 +77,6 @@ pipeline { } } } - stage('Classifying publishable artifacts') { - steps { - script { - def publishable = [ - ] - publishutils = load("${autobuilder.commonscripts()}/publishing/utils.groovy") - publishutils.generatelist(meta, publishable) - } - } - } - stage('Archiving artifacts') { - steps { - script { - ArrayList itemsForRelease = ["${STATICANALYSIS}/**"] - def artifactlist = meta.generateartifacts(itemsForRelease) - archiveArtifacts artifactlist - } - } - } } post { always {