fix redirects when running as phar
[phancap.git] / build.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <project name="phancap" default="phar" basedir=".">
3
4  <property name="version"  value="0.1.0" />
5  <property name="pharfile" value="${phing.dir}/dist/${phing.project.name}-${version}.phar" />
6  <property name="libdir" value="${phing.dir}/lib"/>
7
8  <fileset id="fs.phar" dir="${phing.dir}">
9 <!---->
10   <include name="data/**"/>
11   <include name="lib/**"/>
12   <include name="src/**"/>
13   <include name="www/**"/>
14
15   <include name="README.rst"/>
16
17   <exclude name="data/phancap.config.php"/>
18 <!--
19   <include name="www/index.php"/> -->
20  </fileset>
21
22  <typedef name="pearPackageFileSet" classname="phing.types.PearPackageFileSet" />
23
24  <target name="phar" depends="collectdeps"
25          description="Create zip file for release"
26  >
27   <mkdir dir="${phing.dir}/dist/"/>
28   <delete file="${pharfile}"/>
29   <pharpackage basedir="${phing.dir}"
30    destfile="${pharfile}"
31    stub="${phing.dir}/src/phar-stub.php"
32    alias="test.phar"
33   >
34    <fileset refid="fs.phar"/>
35   </pharpackage>
36   <!--
37   <exec executable="bzip2" dir="${phing.dir}/dist">
38    <arg value="-kf"/>
39    <arg file="${pharfile}"/>
40   </exec>
41   -->
42  </target>
43
44
45  <target name="collectdeps" description="Copy package dependencies to lib/">
46   <delete dir="${libdir}"/>
47   <mkdir dir="${libdir}"/>
48
49   <pearPackageFileset id="dep-PEAR" package="pear.php.net/PEAR">
50    <include name="PEAR/Exception.php"/>
51    <include name="PEAR.php"/>
52    <include name="PEAR5.php"/>
53    <include name="System.php"/>
54   </pearPackageFileset>
55   <pearPackageFileset id="dep-Getopt" package="pear.php.net/Console_Getopt" />
56
57   <copy todir="${libdir}">
58    <fileset refid="dep-PEAR"/>
59    <fileset refid="dep-Getopt"/>
60   </copy>
61  </target>
62
63
64  <target name="docs" description="render documentation">
65   <rst file="README.rst"/>
66  </target>
67
68 </project>