1 <?xml version="1.0" encoding="utf-8"?>
2 <project name="shpub" default="phar" basedir=".">
4 <property name="version" value="0.0.1" />
5 <property name="pharfile" value="${phing.dir}/dist/${phing.project.name}-${version}.phar" />
6 <property name="libdir" value="${phing.dir}/lib"/>
8 <fileset id="fs.phar" dir="${phing.dir}">
9 <include name="bin/**"/>
10 <include name="lib/**"/>
11 <include name="src/**"/>
13 <include name="README.rst"/>
15 <exclude name="bin/shpub.php"/>
19 <typedef name="pearPackageFileSet" classname="phing.types.PearPackageFileSet" />
21 <target name="phar" depends="collectdeps"
22 description="Create zip file for release"
24 <!-- strip the shebang -->
25 <copy file="${phing.dir}/bin/shpub.php" tofile="${phing.dir}/bin/phar-shpub.php">
33 <mkdir dir="${phing.dir}/dist"/>
34 <delete file="${pharfile}"/>
35 <pharpackage basedir="${phing.dir}"
36 destfile="${pharfile}"
37 stub="${phing.dir}/src/phar-stub.php"
40 <fileset refid="fs.phar"/>
43 <exec executable="chmod" checkreturn="1">
45 <arg file="${pharfile}"/>
50 <target name="collectdeps" description="Copy package dependencies to lib/">
51 <delete dir="${libdir}"/>
52 <mkdir dir="${libdir}"/>
54 <pearPackageFileset id="dep-Console_CommandLine" package="pear.php.net/Console_CommandLine"/>
55 <pearPackageFileset id="dep-HTTP_Request2" package="pear.php.net/HTTP_Request2"/>
56 <pearPackageFileset id="dep-Net_URL2" package="pear.php.net/Net_URL2"/>
57 <pearPackageFileset id="dep-PEAR" package="pear.php.net/PEAR">
58 <include name="PEAR/Exception.php"/>
61 <copy todir="${libdir}">
62 <fileset refid="dep-Console_CommandLine"/>
63 <fileset refid="dep-HTTP_Request2"/>
64 <fileset refid="dep-Net_URL2"/>
65 <fileset refid="dep-PEAR"/>
70 <target name="docs" description="render documentation">
71 <rst file="README.rst"/>