Created
March 10, 2014 11:23
-
-
Save andy-williams/9463326 to your computer and use it in GitHub Desktop.
Example phing build.xml - seems to be more or less the same as Ant
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project name="ProjectName" default="dist"> | |
<property name="builddir" value="./build" /> | |
<!-- ============================================ --> | |
<!-- Target: prepare --> | |
<!-- ============================================ --> | |
<target name="prepare"> | |
<echo msg="Making directory ${builddir}" /> | |
<mkdir dir="${builddir}" /> | |
</target> | |
<!-- ============================================ --> | |
<!-- Target: build --> | |
<!-- ============================================ --> | |
<target name="build" depends="prepare"> | |
<echo msg="Copying file to ${builddir}" /> | |
<copy todir="${builddir}"> | |
<fileset dir="."> | |
<!-- Exclude large and unneeded files --> | |
<include name="**" /> | |
<exclude name="**/*.png" /> | |
<exclude name="**/*.jpg" /> | |
<exclude name="**/*.gif" /> | |
<exclude name="**/*.mp4" /> | |
<exclude name="**/*.pdf" /> | |
<exclude name="**/*.xlsx" /> | |
<exclude name="**.hg" /> | |
<exclude name="**.hg/**" /> | |
<exclude name="**/build/" /> | |
<exclude name="**/.idea/" /> | |
<exclude name="**/.idea/**" /> | |
<exclude name="**/.settings/" /> | |
<exclude name="**/.settings/**" /> | |
<exclude name="**/.project" /> | |
<exclude name="**/.travis.yml" /> | |
<exclude name="**/build.xml" /> | |
<exclude name="**/build.properties" /> | |
<exclude name="**/composer.json" /> | |
<exclude name="**/composer.lock" /> | |
<exclude name="**/composer.phar" /> | |
<exclude name="**/LICENSE.md" /> | |
<exclude name="**/README.md" /> | |
<exclude name="**/application/logs/**" /> | |
<exclude name="**/application/log/**" /> | |
</fileset> | |
</copy> | |
<delete file="${builddir}/.htaccess" /> | |
<move file="${builddir}/.htaccess.live" tofile="${builddir}/.htaccess" /> | |
<echo msg="replaced .htaccess with .htaccess.live" /> | |
<echo msg="Copied file to ${builddir}" /> | |
</target> | |
<!-- ============================================ --> | |
<!-- (DEFAULT) Target: dist --> | |
<!-- ============================================ --> | |
<target name="dist" depends="build"> | |
<echo msg="Creating archive..." /> | |
<zip destfile="./build/build.zip"> | |
<fileset dir="./build"> | |
<include name="*" /> | |
</fileset> | |
</zip> | |
<echo msg="Files copied and compressed in build directory OK!" /> | |
</target> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment