PHP by Ant
Ant build scripts are designed for languages that need to be compiled, so for PHP web applications, there's not much need. However, auxiliary tools are making it useful to have some build scripts on hand.
Template
Your basic Ant template looks something like:
<?xml version="1.0" encoding="UTF-8"?>
<project name="MySite.com" default="default" basedir=".">
<description>
simple example build file
</description>
<target name="default">
<exec executable="dir"></exec>
</target>
</project>
Compass (CSS)
If you have a configuration file for your project set up properly, you just need:
<target name="compass">
<exec executable="compass">
<arg value="compile"/>
<arg value="--environment"/>
<arg value="production"/>
</exec>
</target>
If you want all the configuration options set in the build script:
<target name="compass">
<exec executable="compass">
<arg value="compile"/>
<arg value="--css_dir=inc"/>
<arg value="--sass_dir=sass"/>
<arg value="--output_style=compact"/>
</exec>
</target>
SASS (CSS)
<pre class="prettyprint">
<target name="default">
<exec executable="sass">
<arg value="--style"/>
<arg value="compact"/>
<arg value="inc/main.scss:inc/main.css"/>
</exec>
</target>
</pre>
Written by MidnightLightning
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#