Changes
This commit is contained in:
parent
67db51e2b5
commit
3fa2d6ce71
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
/nbproject
|
||||
152
build.xml
Normal file
152
build.xml
Normal file
|
|
@ -0,0 +1,152 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="Radiant" default="build">
|
||||
<target name="build" depends="prepare,lint,phploc-ci,pdepend,phpmd-ci,phpcs-ci,phpcpd-ci,phpunit,phpdox,-check-failure"/>
|
||||
|
||||
<target name="clean" unless="clean.done" description="Cleanup build artifacts">
|
||||
<delete dir="${basedir}/build/api"/>
|
||||
<delete dir="${basedir}/build/coverage"/>
|
||||
<delete dir="${basedir}/build/logs"/>
|
||||
<delete dir="${basedir}/build/pdepend"/>
|
||||
<property name="clean.done" value="true"/>
|
||||
</target>
|
||||
|
||||
<target name="prepare" unless="prepare.done" depends="clean,generate-code" description="Prepare for build">
|
||||
<mkdir dir="${basedir}/build/api"/>
|
||||
<mkdir dir="${basedir}/build/coverage"/>
|
||||
<mkdir dir="${basedir}/build/logs"/>
|
||||
<mkdir dir="${basedir}/build/pdepend"/>
|
||||
<property name="prepare.done" value="true"/>
|
||||
</target>
|
||||
|
||||
<target name="generate-code" description="Generate Currency-specific subclasses of Money and autoloader code">
|
||||
<exec executable="/root/vendor/bin/phpab" taskname="generate-code">
|
||||
<arg value="--output"/>
|
||||
<arg path="vendor/autoload.php"/>
|
||||
<arg path="app"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="lint" depends="generate-code">
|
||||
<apply executable="php" failonerror="true" taskname="lint">
|
||||
<arg value="-l"/>
|
||||
|
||||
<fileset dir="${basedir}/app">
|
||||
<include name="**/*.php"/>
|
||||
<modified/>
|
||||
</fileset>
|
||||
|
||||
<fileset dir="${basedir}/tests">
|
||||
<include name="**/*.php"/>
|
||||
<modified/>
|
||||
</fileset>
|
||||
</apply>
|
||||
</target>
|
||||
|
||||
<target name="phploc" description="Measure project size using PHPLOC">
|
||||
<exec executable="/root/vendor/bin/phploc" taskname="phploc">
|
||||
<arg value="--count-tests"/>
|
||||
<arg path="${basedir}/app"/>
|
||||
<arg path="${basedir}/tests"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="phploc-ci" depends="prepare"
|
||||
description="Measure project size using PHPLOC and log result in CSV and XML format">
|
||||
<exec executable="/root/vendor/bin/phploc" taskname="phploc">
|
||||
<arg value="--count-tests"/>
|
||||
<arg value="--log-csv"/>
|
||||
<arg path="${basedir}/build/logs/phploc.csv"/>
|
||||
<arg value="--log-xml"/>
|
||||
<arg path="${basedir}/build/logs/phploc.xml"/>
|
||||
<arg path="${basedir}/app"/>
|
||||
<arg path="${basedir}/tests"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="pdepend" depends="prepare" description="Calculate software metrics using PHP_Depend">
|
||||
<exec executable="/root/vendor/bin/pdepend" taskname="pdepend">
|
||||
<arg value="--jdepend-xml=${basedir}/build/logs/jdepend.xml"/>
|
||||
<arg value="--jdepend-chart=${basedir}/build/pdepend/dependencies.svg"/>
|
||||
<arg value="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg"/>
|
||||
<arg path="${basedir}/app"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="phpmd" description="Perform project mess detection using PHPMD and print result in text format">
|
||||
<exec executable="/root/vendor/bin/phpmd" taskname="phpmd">
|
||||
<arg path="${basedir}/app"/>
|
||||
<arg value="text"/>
|
||||
<arg path="${basedir}/phpmd.xml"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="phpmd-ci" depends="prepare"
|
||||
description="Perform project mess detection using PHPMD and log result in XML format">
|
||||
<exec executable="/root/vendor/bin/phpmd" taskname="phpmd">
|
||||
<arg path="${basedir}/app"/>
|
||||
<arg value="xml"/>
|
||||
<arg path="${basedir}/phpmd.xml"/>
|
||||
<arg value="--reportfile"/>
|
||||
<arg path="${basedir}/build/logs/pmd.xml"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="phpcs"
|
||||
description="Find coding standard violations using PHP_CodeSniffer and print result in text format">
|
||||
<exec executable="/root/vendor/bin/phpcs" taskname="phpcs">
|
||||
<arg value="--standard=PSR2"/>
|
||||
<arg value="--extensions=php"/>
|
||||
<arg value="--ignore=autoload.php"/>
|
||||
<arg path="${basedir}/app"/>
|
||||
<arg path="${basedir}/tests"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="phpcs-ci" depends="prepare"
|
||||
description="Find coding standard violations using PHP_CodeSniffer and log result in XML format">
|
||||
<exec executable="/root/vendor/bin/phpcs" output="/dev/null" taskname="phpcs">
|
||||
<arg value="--report=checkstyle"/>
|
||||
<arg value="--report-file=${basedir}/build/logs/checkstyle.xml"/>
|
||||
<arg value="--standard=PSR2"/>
|
||||
<arg value="--extensions=php"/>
|
||||
<arg value="--ignore=autoload.php"/>
|
||||
<arg path="${basedir}/app"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="phpcpd" description="Find duplicate code using PHPCPD">
|
||||
<exec executable="/root/vendor/bin/phpcpd" taskname="phpcpd">
|
||||
<arg path="${basedir}/app"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="phpcpd-ci" depends="prepare"
|
||||
description="Find duplicate code using PHPCPD and log result in XML format">
|
||||
<exec executable="/root/vendor/bin/phpcpd" taskname="phpcpd">
|
||||
<arg value="--log-pmd"/>
|
||||
<arg path="${basedir}/build/logs/pmd-cpd.xml"/>
|
||||
<arg path="${basedir}/app"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="phpunit" depends="prepare" description="Run unit tests with PHPUnit">
|
||||
<exec executable="/root/vendor/bin/phpunit" resultproperty="result.phpunit" taskname="phpunit">
|
||||
<arg value="--configuration"/>
|
||||
<arg path="${basedir}/phpunit.xml"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="phpdox" depends="phploc-ci,phpcs-ci,phpmd-ci" description="Generate API documentation using phpDox">
|
||||
<exec executable="/root/vendor/bin/phpdox" dir="${basedir}" taskname="phpdox"/>
|
||||
</target>
|
||||
|
||||
<target name="-check-failure">
|
||||
<fail message="PHPUnit did not finish successfully">
|
||||
<condition>
|
||||
<not>
|
||||
<equals arg1="${result.phpunit}" arg2="0"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
</target>
|
||||
</project>
|
||||
24
phpdox.xml
Normal file
24
phpdox.xml
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<phpdox xmlns="http://xml.phpdox.net/config">
|
||||
<project name="JTest" source="src" workdir="phpdox">
|
||||
<collector publiconly="false">
|
||||
<include mask="*.php" />
|
||||
<exclude mask="*autoload.php" />
|
||||
</collector>
|
||||
|
||||
<generator output=".">
|
||||
<enrich base="build/logs">
|
||||
<source type="build" />
|
||||
<source type="git" />
|
||||
<source type="phploc" />
|
||||
<source type="checkstyle" />
|
||||
<source type="pmd" />
|
||||
<source type="phpunit" />
|
||||
</enrich>
|
||||
|
||||
<build engine="html" enabled="true" output="api">
|
||||
<file extension="html" />
|
||||
</build>
|
||||
</generator>
|
||||
</project>
|
||||
</phpdox>
|
||||
26
phpmd.xml
Normal file
26
phpmd.xml
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<ruleset name="PHPmd"
|
||||
xmlns="http://pmd.sf.net/ruleset/1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
|
||||
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
|
||||
<description>Jenkins PHPmd ruleset</description>
|
||||
|
||||
<rule ref="rulesets/codesize.xml/CyclomaticComplexity" />
|
||||
<rule ref="rulesets/codesize.xml/NPathComplexity" />
|
||||
<rule ref="rulesets/codesize.xml/ExcessiveClassComplexity" />
|
||||
<rule ref="rulesets/codesize.xml/ExcessiveClassLength" />
|
||||
<rule ref="rulesets/codesize.xml/ExcessiveMethodLength" />
|
||||
<rule ref="rulesets/codesize.xml/ExcessiveParameterList" />
|
||||
|
||||
<rule ref="rulesets/design.xml/EvalExpression" />
|
||||
<rule ref="rulesets/design.xml/ExitExpression" />
|
||||
<rule ref="rulesets/design.xml/GotoStatement" />
|
||||
|
||||
<rule ref="rulesets/naming.xml/ConstructorWithNameAsEnclosingClass" />
|
||||
|
||||
<rule ref="rulesets/unusedcode.xml/UnusedFormalParameter" />
|
||||
<rule ref="rulesets/unusedcode.xml/UnusedLocalVariable" />
|
||||
<rule ref="rulesets/unusedcode.xml/UnusedPrivateField" />
|
||||
<rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod" />
|
||||
46
phpunit.xml
Normal file
46
phpunit.xml
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/5.2/phpunit.xsd"
|
||||
bootstrap="vendor/autoload.php"
|
||||
backupGlobals="false"
|
||||
backupStaticAttributes="false"
|
||||
beStrictAboutCoversAnnotation="true"
|
||||
beStrictAboutOutputDuringTests="true"
|
||||
beStrictAboutTestsThatDoNotTestAnything="true"
|
||||
beStrictAboutTodoAnnotatedTests="true"
|
||||
forceCoversAnnotation="true"
|
||||
verbose="true">
|
||||
<testsuites>
|
||||
<testsuite name="Unit Tests">
|
||||
<directory suffix="Test.php">./tests/Unit</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<logging>
|
||||
<log type="coverage-html" target="build/coverage"/>
|
||||
<log type="coverage-clover" target="build/logs/clover.xml"/>
|
||||
<log type="coverage-crap4j" target="build/logs/crap4j.xml"/>
|
||||
<log type="coverage-xml" target="build/logs/coverage"/>
|
||||
<log type="junit" target="build/logs/junit.xml"/>
|
||||
<log type="testdox-html" target="build/testdox/index.html"/>
|
||||
</logging>
|
||||
<filter>
|
||||
<whitelist processUncoveredFilesFromWhitelist="true">
|
||||
<directory suffix=".php">./app/Http/Composers</directory>
|
||||
<directory suffix=".php">./app/Http/Controllers</directory>
|
||||
<directory suffix=".php">./app/Http/Middleware</directory>
|
||||
<directory suffix=".php">./app/Http/Requests</directory>
|
||||
<directory suffix=".php">./app/Http/Resources</directory>
|
||||
<directory suffix=".php">./app/Http/Utilities</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
<php>
|
||||
<env name="APP_ENV" value="testing"/>
|
||||
<env name="DB_CONNECTION" value="sqlite"/>
|
||||
<env name="DB_DATABASE" value=":memory:"/>
|
||||
<env name="CACHE_DRIVER" value="array"/>
|
||||
<env name="SESSION_DRIVER" value="array"/>
|
||||
<env name="QUEUE_DRIVER" value="sync"/>
|
||||
<env name="SCOUT_DRIVER" value="null"/>
|
||||
<env name="TELESCOPE_ENABLED" value="false"/>
|
||||
</php>
|
||||
</phpunit>
|
||||
Loading…
Reference in New Issue
Block a user