Handle path exclusions
This commit is contained in:
parent
c82bbc6b47
commit
9c9e0999fc
1 changed files with 18 additions and 14 deletions
|
|
@ -87,22 +87,26 @@ pipeline {
|
|||
dir(PPDFOLDER) {
|
||||
def EXCLUDE_PARAM = ''
|
||||
if (EXCLUDE_PATHS) {
|
||||
EXCLUDE_PARAM = """--exclude "${EXCLUDE_PATHS}" """
|
||||
}
|
||||
dir(SRC) {
|
||||
if (isUnix()) {
|
||||
sh """#!/bin/bash
|
||||
set -ev
|
||||
|
||||
export PMD_JAVA_OPTS=-Xmx65536m
|
||||
"${PPD}/run.sh" cpd --minimum-tokens 100 --files . --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml
|
||||
"""
|
||||
} else {
|
||||
bat """
|
||||
set PMD_JAVA_OPTS=-Xmx2048m
|
||||
"${PPD}/cpd.bat" --minimum-tokens 100 --files . --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml
|
||||
"""
|
||||
EXCLUDE_PARAM = '--exclude "'
|
||||
def exclude_path_list = EXCLUDE_PATHS.split()
|
||||
for (exclude_path in exclude_path_list) {
|
||||
EXCLUDE_PARAM += "${WORKSPACE}/${exclude_path.trim()},"
|
||||
}
|
||||
EXCLUDE_PARAM += '"'
|
||||
}
|
||||
if (isUnix()) {
|
||||
sh """#!/bin/bash
|
||||
set -ev
|
||||
|
||||
export PMD_JAVA_OPTS=-Xmx65536m
|
||||
echo "${PPD}/run.sh" cpd --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml
|
||||
"${PPD}/run.sh" cpd --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml
|
||||
"""
|
||||
} else {
|
||||
bat """
|
||||
set PMD_JAVA_OPTS=-Xmx2048m
|
||||
"${PPD}/cpd.bat" --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml
|
||||
"""
|
||||
}
|
||||
}
|
||||
recordIssues(tools: [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue