pass CPD_XML_PATH to cpd_script.php
This commit is contained in:
parent
ab666b6a57
commit
2fbfcf3d59
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
foreach (simplexml_load_file('cpd-output.xml')->duplication as $duplication) {
|
$CPD_XML_PATH = $argv[2];
|
||||||
|
|
||||||
|
foreach (simplexml_load_file($CPD_XML_PATH)->duplication as $duplication) {
|
||||||
$files = $duplication->xpath('file');
|
$files = $duplication->xpath('file');
|
||||||
foreach ($files as $file) {
|
foreach ($files as $file) {
|
||||||
echo $file['path'].':'.$file['line'].':1: warning: '.$duplication['lines'].' copy-pasted lines from: '
|
echo $file['path'].':'.$file['line'].':1: warning: '.$duplication['lines'].' copy-pasted lines from: '
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ if which pmd >/dev/null; then
|
||||||
pmd cpd --files ${SOURCES_DIR} --exclude ${FILES_TO_EXCLUDE} --minimum-tokens 50 --language swift --encoding UTF-8 --format net.sourceforge.pmd.cpd.XMLRenderer > ${REPORTS_DIR}/cpd-output.xml --failOnViolation true
|
pmd cpd --files ${SOURCES_DIR} --exclude ${FILES_TO_EXCLUDE} --minimum-tokens 50 --language swift --encoding UTF-8 --format net.sourceforge.pmd.cpd.XMLRenderer > ${REPORTS_DIR}/cpd-output.xml --failOnViolation true
|
||||||
|
|
||||||
# running script
|
# running script
|
||||||
php ./build-scripts/xcode/aux_scripts/cpd_script.php -cpd-xml ${REPORTS_DIR}/cpd-output.xml | tee ${REPORTS_DIR}/CPDLog.txt
|
php ./build-scripts/xcode/aux_scripts/cpd_script.php ${REPORTS_DIR}/cpd-output.xml | tee ${REPORTS_DIR}/CPDLog.txt
|
||||||
else
|
else
|
||||||
echo "warning: pmd not installed, install using 'brew install pmd'"
|
echo "warning: pmd not installed, install using 'brew install pmd'"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue