Handle path exclusions

This commit is contained in:
Dan Hawkins 2020-10-04 10:18:32 +01:00
commit caf5ddbe8c

View file

@ -85,17 +85,21 @@ pipeline {
script {
def PPDFOLDER = "${STATICANALYSIS}/ppd"
dir(PPDFOLDER) {
def EXCLUDE_PARAM = ''
if (EXCLUDE_PATHS) {
EXCLUDE_PARAM = """--exclude "%EXCLUDE_PATHS%" """
}
if (isUnix()) {
sh """#!/bin/bash
set -e
export PMD_JAVA_OPTS=-Xmx65536m
"${PPD}/run.sh" cpd --minimum-tokens 100 --files "${SRC}" --language cpp --format xml --failOnViolation false > cpd.xml
"${PPD}/run.sh" cpd --minimum-tokens 100 --files "${SRC}" --language cpp --format xml %EXCLUDE_PARAM% --failOnViolation false > cpd.xml
"""
} else {
bat """
set PMD_JAVA_OPTS=-Xmx2048m
"${PPD}/cpd.bat" --minimum-tokens 100 --files "${SRC}" --language cpp --format xml --failOnViolation false > cpd.xml
"${PPD}/cpd.bat" --minimum-tokens 100 --files "${SRC}" --language cpp --format xml %EXCLUDE_PARAM% --failOnViolation false > cpd.xml
"""
}
}