update changelog and release version 0.4.0
[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.4.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   <include name="data/**"/>
10   <include name="lib/**"/>
11   <include name="src/**"/>
12   <include name="www/**"/>
13
14   <include name="README.rst"/>
15   <include name="www/README.html"/>
16
17   <exclude name="data/phancap.config.php"/>
18   <exclude name="www/imgcache/"/>
19   <exclude name="www/*.phar"/>
20  </fileset>
21
22  <typedef name="pearPackageFileSet" classname="phing.types.PearPackageFileSet" />
23
24  <target name="phar" depends="collectdeps,docs"
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="phancap.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  </target>
42
43
44  <target name="collectdeps" description="Copy package dependencies to lib/">
45   <delete dir="${libdir}"/>
46   <mkdir dir="${libdir}"/>
47
48   <pearPackageFileset id="dep-PEAR" package="pear.php.net/PEAR">
49    <include name="PEAR/Exception.php"/>
50    <include name="PEAR.php"/>
51    <include name="PEAR5.php"/>
52    <include name="System.php"/>
53   </pearPackageFileset>
54   <pearPackageFileset id="dep-Getopt" package="pear.php.net/Console_Getopt" />
55
56   <copy todir="${libdir}">
57    <fileset refid="dep-PEAR"/>
58    <fileset refid="dep-Getopt"/>
59   </copy>
60  </target>
61
62
63  <target name="docs" description="render documentation">
64   <rst file="README.rst" destination="www/README.html"/>
65  </target>
66
67 </project>