Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
86 lines (68 sloc) 2.99 KB
<?xml version="1.0" encoding="UTF-8"?>
<project name="Logos" basedir="." default="">
<fileset dir="tests" id="unit-tests">
<include name="**/Test*.php" />
</fileset>
<fileset dir="." id="system-classes">
<include name="system/classes/**/*.php" />
</fileset>
<target name="unit-test" description="Generates unit test report">
<phpunit haltonfailure="true" haltonerror="true" printsummary="true">
<formatter type="xml" outfile="test-report.xml" />
<batchtest>
<fileset refid="unit-tests" />
</batchtest>
</phpunit>
<delete dir="docs/test_report" quiet="true" includeemptydirs="true" verbose="false" failonerror="false" />
<mkdir dir="docs/test_report" />
<phpunitreport infile="test-report.xml" format="frames" todir="docs/test_report" />
<delete file="test-report.xml" />
</target>
<target name="coverage-report" description="Generates unit test coverage report">
<exec command="phpunit --coverage-html docs/coverage/ tests/" checkreturn="false" />
</target>
<target name="api-docs" description="Generates API documentation">
<phpdoc title="API Documentation" destdir="docs/api" sourcecode="false" output="HTML:Smarty:PHP" quiet="true">
<fileset refid="system-classes" />
</phpdoc>
</target>
<target name="static-analysis" description="Performs static analysis">
<mkdir dir="docs/analysis" />
<!--
<phpmd file="system/classes">
<formatter type="html" outfile="docs/analysis/pmd.html"/>
</phpmd>
-->
<phpcpd file="system/classes">
<formatter type="pmd" outfile="docs/analysis/phpcpd.xml"/>
</phpcpd>
</target>
<target name="enable-profiling">
<available file="./public/.htaccess.bak" property="profilingEnabled" value="Yes"/>
<if>
<equals arg1="${profilingEnabled}" arg2="1" />
<then>
<echo>Profiling is already enabled!</echo>
</then>
<else>
<exec command="ln -s ../system/lib/profile/xhprof public/profile"/>
<exec command="cp public/.htaccess public/.htaccess.bak"/>
<exec command="cat system/lib/profile/start.htaccess public/.htaccess system/lib/profile/stop.htaccess > public/.htaccess.new" />
<exec command="mv public/.htaccess.new public/.htaccess" />
</else>
</if>
</target>
<target name="disable-profiling">
<available file="./public/.htaccess.bak" property="profilingEnabled" value="Yes"/>
<if>
<equals arg1="${profilingEnabled}" arg2="1" />
<then>
<exec command="mv public/.htaccess.bak public/.htaccess" />
<exec command="unlink public/profile" />
</then>
<else>
<echo>Profiling is already disabled!</echo>
</else>
</if>
</target>
</project>