Handle path exclusions
This commit is contained in:
parent
29cfbbf9d6
commit
562c1cbc21
1 changed files with 18 additions and 23 deletions
|
|
@ -84,30 +84,25 @@ pipeline {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
def PPDFOLDER = "${STATICANALYSIS}/ppd"
|
def PPDFOLDER = "${STATICANALYSIS}/ppd"
|
||||||
dir(PPDFOLDER) {
|
def EXCLUDE_PARAM = ''
|
||||||
def EXCLUDE_PARAM = ''
|
if (EXCLUDE_PATHS) {
|
||||||
if (EXCLUDE_PATHS) {
|
EXCLUDE_PARAM = """--exclude "${EXCLUDE_PATHS.trim}""""
|
||||||
EXCLUDE_PARAM = '--exclude "'
|
}
|
||||||
def exclude_path_list = EXCLUDE_PATHS.split(',')
|
dir(SRC) {
|
||||||
for (exclude_path in exclude_path_list) {
|
if (isUnix()) {
|
||||||
EXCLUDE_PARAM += "${SRC}/${exclude_path.trim()},"
|
sh """#!/bin/bash
|
||||||
}
|
set -ev
|
||||||
EXCLUDE_PARAM += '"'
|
|
||||||
}
|
|
||||||
dir(SRC) {
|
|
||||||
if (isUnix()) {
|
|
||||||
sh """#!/bin/bash
|
|
||||||
set -ev
|
|
||||||
|
|
||||||
export PMD_JAVA_OPTS=-Xmx65536m
|
mkdir "${PPDFOLDER}"
|
||||||
"${PPD}/run.sh" cpd --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml
|
export PMD_JAVA_OPTS=-Xmx65536m
|
||||||
"""
|
"${PPD}/run.sh" cpd --minimum-tokens 100 --files . --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > "${PPDFOLDER}cpd.xml"
|
||||||
} else {
|
"""
|
||||||
bat """
|
} else {
|
||||||
set PMD_JAVA_OPTS=-Xmx2048m
|
bat """
|
||||||
"${PPD}/cpd.bat" --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > cpd.xml
|
mkdir "${PPDFOLDER}"
|
||||||
"""
|
set PMD_JAVA_OPTS=-Xmx2048m
|
||||||
}
|
"${PPD}/cpd.bat" --minimum-tokens 100 --files . --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > "${PPDFOLDER}cpd.xml"
|
||||||
|
"""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
recordIssues(tools: [
|
recordIssues(tools: [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue