Skip to content

Instantly share code, notes, and snippets.

@jmahony
Created February 27, 2014 19:36
Show Gist options
  • Save jmahony/9257610 to your computer and use it in GitHub Desktop.
Save jmahony/9257610 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<project name="sussexfire" default="build" basedir=".">
<description>
SussexFire
</description>
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="tests" location="tests"/>
<target name="build">
<tstamp/>
<copy todir="${build}">
<fileset dir="${src}" excludes="**/scss/**"/>
</copy>
<antcall target="composer"></antcall>
<antcall target="phpsyntaxcheck"></antcall>
<antcall target="test"></antcall>
<antcall target="psr2"></antcall>
<antcall target="twitter-bootstrap"></antcall>
<antcall target="phpdocs"></antcall>
</target>
<target name="composer">
<echo message="Downloading Composer" />
<exec executable="/bin/bash">
<arg value="-c" />
<arg value="curl -s https://getcomposer.org/installer | php" />
</exec>
<echo message="Composer Downloaded!" />
<echo message="Downloaded Dependencies!" />
<exec executable="/bin/bash">
<arg value="-c" />
<arg value="./composer.phar install" />
</exec>
<echo message="Dependencies Downloaded!" />
</target>
<target name="phpdocs">
<echo message="Generating PHPDocs" />
<exec executable="/bin/bash">
<arg value="-c" />
<arg value="${build}/vendor/bin/phpdoc.php -d ${src}" />
</exec>
<echo message="Generated PHPDocs!" />
</target>
<target name="phpsyntaxcheck">
<echo message="Validating PHP Syntax" />
<apply executable="php" failonerror="true">
<arg value="-l" />
<fileset dir=".">
<include name="${src}/**/*.php" />
<include name="${tests}/**/*.php" />
</fileset>
</apply>
<echo message="PHP Validation Success!" />
</target>
<target name="twitter-bootstrap">
<echo message="Compiling Stylesheets" />
<exec executable="/bin/bash" failonerror="true">
<arg value="-c" />
<arg value="compass compile" />
</exec>
<echo message="Stylesheets Compiled!" />
</target>
<target name="psr2">
<echo message="Checking PHP Source Code Against PSR-2" />
<exec executable="/bin/bash" failonerror="true">
<arg value="-c" />
<arg value="${build}/vendor/bin/phpcs --standard=PSR2 ${src}" />
</exec>
<echo message="Source Code Is Valid PSR-2!" />
</target>
<target name="concat-js">
<echo message="Concatinating JS!" />
<concat destfile="app.min.js" encoding="UTF-8" outputencoding="UTF-8" fixlastline="true">
<filelist refid="filelist" />
</concat>
<filelist id="filelist" dir="${tempjsdir}">
<file name="util.js"/>
<file name="commons.js" />
</filelist>
<echo message="Concatinating JS Complete!" />
</target>
<target name="test">
<echo message="Running unit tests with PHPUnit" />
<exec executable="/bin/bash" failonerror="true">
<arg value="-c" />
<arg value="${build}/vendor/bin/phpunit ${tests}/*" />
</exec>
</target>
<target name="clean">
<echo message="Reversing build" />
<delete dir="${build}"/>
<delete file="composer.lock"/>
<delete file="composer.phar"/>
<delete dir=".sass-cache"/>
<delete dir="output"/>
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment