Created
March 4, 2014 21:48
-
-
Save marten-cz/9356477 to your computer and use it in GitHub Desktop.
Simple PHP analysis makefile Continuous integration. Useful for projects based on Nette framework.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/make | |
all: analyze | |
# no more commands | |
mo: | |
find ./app/locale/ -name '*.po' -exec bash -c 'msgfmt -cv -o $${0/\.po/\.mo} $$0' {} \; | |
# Delete last build artifacts | |
cleanbuild: | |
rm -rf ./build/ | |
mkdir -p ./build/api | |
mkdir -p ./build/phpdoc | |
mkdir -p ./build/code-browser | |
mkdir -p ./build/logs | |
mkdir -p ./build/apigen | |
analyze: cleanbuild phpmd phpcpd phpcb phpcs | |
# no more commands | |
# Generate Mess detector report - pmd.xml | |
phpmd: | |
phpmd ./app/ xml codesize,unusedcode,naming --reportfile ./build/logs/pmd.xml || true | |
# Generate Copy detector report - pmd-cpd.xml | |
phpcpd: | |
phpcpd --log-pmd ./build/logs/pmd-cpd.xml --min-lines 3 --min-tokens 20 ./app/ || true | |
# Generate checkstyle.xml | |
phpcs: | |
phpcs --report=checkstyle --report-file='./build/logs/checkstyle.xml' --standard=Marten --extensions=php ./app/ || true | |
# Generate APIGen documentation | |
apigen: | |
apigen --quiet --source app --destination ./build/apigen/ --todo yes --undocumented ./build/apigen/undocumented.txt --title "IceWarp docs" --allowed-html "b,i,a,ul,ol,li,p,br,var,samp,kbd,tt,pre" | |
# Generate Code Browser | |
phpcb: | |
phpcb --log ./build/logs/ --source ./app/ --output ./build/code-browser || true | |
# Generate PHPLoc report - phploc.csv | |
phploc: | |
phploc --log-csv ./build/logs/phploc.csv --suffixes php ./app/ || true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment