<?xml version="1.0" encoding="UTF-8"?>
<project name="bones" default="build" basedir=".">
    <target name="prepare">
        <mkdir dir="../build" />
        <mkdir dir="../docs/app/public/dist" />
    </target>
    <target name="build" depends="prepare">
        <copy file="index.php" tofile="../build/index.php" />
        <copy file="constants.php" tofile="../build/constants.php" />
        <copy file="Classes/Configuration.php" tofile="../build/Configuration.php" />
        <copy file="Classes/SQLite.php" tofile="../build/SQLite.php" />
        <copy file="Classes/Template.php" tofile="../build/Template.php" />
        <copy file="Classes/Obfuscation.php" tofile="../build/Obfuscation.php" />      
    </target>
    <target name="dist" depends="build">
        <tar destfile="../docs/app/public/dist/bones.tar.gz" compression="gzip">
            <fileset dir="../build">
                <include name="*" />
            </fileset>
        </tar>
        <pharpackage destfile="../docs/app/public/dist/bones.phar" basedir="../build/" compression="gzip">
            <fileset dir="../build">
                <include name="*" />
            </fileset>
            <metadata>
                <element name="version" value="beta" />
                <element name="authors">
                    <element name="netico">
                        <element name="e-mail" value="netico@riseup.net" />
                    </element>
                </element>
            </metadata>
        </pharpackage>
        <delete dir="../build" includeemptydirs="true" verbose="true" failonerror="true" />
    </target>
</project>
