Run Code Sniffer via phing.

This commit is contained in:
Andreas Fischer 2014-04-12 07:47:53 +02:00
parent 8c9b7083d8
commit 4a064a0506
2 changed files with 27 additions and 2 deletions

View File

@ -21,8 +21,7 @@ before_script:
- sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' ]; then travis/setup-composer.sh; fi" - sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' ]; then travis/setup-composer.sh; fi"
script: script:
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.5' ]; then vendor/bin/phpcs -s --extensions=php --standard=build/code-sniffer-ruleset.xml phpseclib/; fi" - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.5' ]; then vendor/bin/phing -f build/build.xml sniff; fi"
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.5' ]; then vendor/bin/phpcs -s --extensions=php --standard=build/code-sniffer-ruleset-tests.xml tests/; fi"
- travis/run-phpunit.sh - travis/run-phpunit.sh
after_success: after_success:

26
build/build.xml Normal file
View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="phpseclib"
description="PHP Secure Communications Library"
default="all"
>
<target name="all" depends="sniff" />
<!-- Code Sniffer -->
<target name="sniff" depends="sniff-php-code,sniff-php-tests" />
<target name="sniff-php-code">
<exec command="vendor/bin/phpcs -s
--extensions=php
--standard=build/code-sniffer-ruleset.xml
phpseclib/"
dir=".." passthru="true" />
</target>
<target name="sniff-php-tests">
<exec command="vendor/bin/phpcs -s
--extensions=php
--standard=build/code-sniffer-ruleset-tests.xml
tests/"
dir=".." passthru="true" />
</target>
</project>