Merge pull request #173 from TouchInstinct/make_cpd_paths_relative
make cpd paths relative, so developers won't rewrite entire file
This commit is contained in:
commit
8eb9ab9887
|
|
@ -8,9 +8,13 @@ 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
|
||||
|
||||
# running script
|
||||
php ./build-scripts/xcode/aux_scripts/cpd_script.php ${REPORTS_DIR}/cpd-output.xml | tee ${REPORTS_DIR}/CPDLog.txt
|
||||
|
||||
# Make paths relative to SOURCES_DIR, so different developers won't rewrite entire file
|
||||
readonly SED_REPLACEMENT_STRING=$(echo ${SOURCES_DIR} | sed "s/\//\\\\\//g")
|
||||
|
||||
sed -i '' "s/${SED_REPLACEMENT_STRING}//g" "${REPORTS_DIR}/CPDLog.txt"
|
||||
else
|
||||
echo "warning: pmd not installed, install using 'brew install pmd'"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
Loading…
Reference in New Issue