The following example under Getting Started, Writing A Simple Buildfile
has errors in it.
<?xml version="1.0"?>
<project name="FooBar" default="dist" basedir=".">
<target name="prepare">
<echo msg="Preparing build..." />
<mkdir dir="./build" />
</target>
<target name="build" depends="prepare">
<echo>Building...</echo>
<copy file="./src/File.php" to="./build/File.php"/>
<copy file="./src/File2.php" to="./build/File2.php"/>
</target>
<target name="dist" depends="build">
<echo message="Creating archive..." />
<tar outfile="furbee.tar.gz" basedir="./build"/>
</target>
<target name="clean">
<echo msg="Cleaning up..."/>
<delete file="./build"/>
</target>
</project>
********************
I think it's important to have a working example build file for new users, to use as a base template to create their own build files with. Therefore I have tagged this as a major bug.
Here is a re-written version that works OK. Provided the files exist in the current directory, and phing can read/write this directory and creae new sub directories, then phing will:
create the sub-dir build in the current directory;
copy the three files about.php, browsers.php, contact.php to the build sub-dir;
compress the three files into a tar.gzip file (in the build sub-dir) called build.tar.gz
<?xml version="1.0"?>
<project name="FooBar" default="dist" basedir=".">
<target name="prepare">
<echo msg="Making directory ./build" />
<mkdir dir="./build" />
</target>
<target name="build" depends="prepare">
<echo>Copying Files to build directory...</echo>
<echo msg="Copying ./about.php to ./build directory..." />
<copy file="./about.php" tofile="./build/about.php" />
<echo msg="Copying ./browsers.php to ./build directory..." />
<copy file="./browsers.php" tofile="./build/browsers.php" />
<echo msg="Copying ./contact.php to ./build directory..." />
<copy file="./contact.php" tofile="./build/contact.php" />
</target>
<target name="dist" depends="build">
<echo msg="Creating archive..." />
<tar destfile="./build/build.tar.gz" compression="gzip">
<fileset dir="./build">
<include name="*" />
</fileset>
</tar>
<echo msg="Files Copied and compressed in build directory OK!" />
</target>
</project>